/* Owlypia Combinations */

.cmb-root {
    --cmb-orange: #ff9f1c;
    --cmb-tile: #d4eaf7;
    --cmb-tile-text: #1e3a4c;
    --cmb-selected: #ffd166;
    --cmb-done: #bfe6c4;
    --cmb-board: #f6efe3;
    --cmb-ink: #243041;
    position: relative;
    overflow: hidden;
    max-width: none;
    margin: 0 auto;
    padding: 20px 14px 26px;
    border-radius: 24px;
    background: var(--wpg-card-gradient, linear-gradient(135deg, #5a04b8 0%, #e02a8c 48%, #ff5a38 100%));
    box-shadow: 0 12px 34px rgba(20, 8, 46, 0.45);
    font-family: 'Segoe UI', system-ui, sans-serif;
    -webkit-user-select: none;
    user-select: none;
}

.cmb-header { text-align: center; margin-bottom: 12px; }
.cmb-title {
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 800;
    color: var(--cmb-orange);
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
}
.cmb-subtitle { color: #e8ddff; font-size: clamp(13px, 3vw, 15px); }

.cmb-levels {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.cmb-level-btn {
    border: 2px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: #f1e9ff;
    padding: 7px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    min-width: 78px;
}
.cmb-level-btn small { font-size: 11px; opacity: 0.8; }
.cmb-level-btn.cmb-level-active {
    background: var(--cmb-orange);
    border-color: var(--cmb-orange);
    color: #34145e;
}

.cmb-hud {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    color: #fff;
}
.cmb-hud-item strong { color: #ffd166; font-variant-numeric: tabular-nums; }
.cmb-new-btn,
.cmb-give-btn {
    border: 0;
    color: #fff;
    font-weight: 700;
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
}
.cmb-new-btn { background: #e63946; }
.cmb-give-btn { background: rgba(255, 255, 255, 0.16); }

.cmb-play {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.9fr);
    gap: 16px;
    background: var(--cmb-board);
    border-radius: 18px;
    padding: 16px 14px 14px;
    color: var(--cmb-ink);
}

.cmb-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}
.cmb-pill {
    display: inline-flex;
    align-items: center;
    background: #efe4d0;
    color: #3a2a16;
    font-weight: 800;
    font-size: 15px;
    padding: 6px 14px;
    border-radius: 999px;
}
.cmb-score-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 8px;
}
.cmb-score-line strong { font-variant-numeric: tabular-nums; }

.cmb-stars {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0;
    margin: 0 2px 14px;
    height: 18px;
    position: relative;
}
.cmb-stars::before {
    content: '';
    position: absolute;
    left: 8px;
    right: 8px;
    top: 50%;
    height: 3px;
    background: #d7cbb8;
    border-radius: 99px;
    transform: translateY(-50%);
}
.cmb-stars-fill {
    position: absolute;
    left: 8px;
    top: 50%;
    height: 3px;
    background: #e8a317;
    border-radius: 99px;
    transform: translateY(-50%);
    width: 0;
    max-width: calc(100% - 16px);
    transition: width 0.35s ease;
}
.cmb-star {
    position: relative;
    z-index: 1;
    font-size: 16px;
    color: #c9bba6;
    line-height: 1;
}
.cmb-star.cmb-star-on { color: #e2a100; }

.cmb-formed {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex-wrap: wrap;
    margin-bottom: 12px;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: 0.06em;
    line-height: 1.1;
    color: #3d2a12;
}
.cmb-formed-empty { color: #9a8b76; font-weight: 600; font-size: 14px; letter-spacing: 0; }
.cmb-formed-part { letter-spacing: 0.06em; }
.cmb-formed-a { color: #1d4ed8; }
.cmb-formed-b { color: #dc2626; }

.cmb-grid {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}
.cmb-root[data-cols="4"] .cmb-grid { grid-template-columns: repeat(4, 1fr); }
.cmb-root[data-cols="5"] .cmb-grid { grid-template-columns: repeat(5, 1fr); }

.cmb-tile {
    position: relative;
    box-sizing: border-box;
    min-height: 58px;
    border: 0;
    border-radius: 12px;
    background: var(--cmb-tile);
    color: var(--cmb-tile-text);
    font-size: clamp(16px, 3.2vw, 22px);
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    padding: 14px 8px 10px;
    line-height: 1;
    box-shadow: 0 2px 0 rgba(90, 130, 160, 0.25);
}
.cmb-tile:hover:not(:disabled) { filter: brightness(1.04); }
.cmb-tile:disabled { cursor: default; }
.cmb-tile.cmb-tile-on {
    background: var(--cmb-selected);
    color: #3a2a16;
    box-shadow: 0 0 0 2px #e2a100;
}
.cmb-tile.cmb-tile-done {
    background: var(--cmb-done);
    color: #2d6a38;
}
.cmb-tile.cmb-tile-hint {
    box-shadow: 0 0 0 3px #ff9f1c, 0 2px 0 rgba(90, 130, 160, 0.25);
    animation: cmb-pulse 0.9s ease 3;
}
.cmb-tile.cmb-tile-on.cmb-tile-hint {
    box-shadow: 0 0 0 2px #e2a100;
}
.cmb-count {
    position: absolute;
    top: 5px;
    right: 7px;
    font-size: 11px;
    font-weight: 700;
    color: #7a8b99;
}
.cmb-tile.cmb-tile-on .cmb-count,
.cmb-tile.cmb-tile-done .cmb-count { color: inherit; opacity: 0.7; }
.cmb-ord {
    position: absolute;
    top: 5px;
    left: 7px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3a2a16;
    color: #ffd166;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cmb-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.cmb-icon-btn,
.cmb-submit {
    border: 0;
    cursor: pointer;
    font-weight: 800;
}
.cmb-icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #d4eaf7;
    color: #1e3a4c;
    font-size: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}
.cmb-icon-btn svg {
    width: 26px;
    height: 26px;
    display: block;
    flex-shrink: 0;
}
.cmb-icon-btn:disabled { opacity: 0.4; cursor: default; }
.cmb-hint-n {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 99px;
    background: #e63946;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    font-weight: 800;
}
.cmb-submit {
    flex: 1;
    min-width: 110px;
    height: 48px;
    border-radius: 12px;
    background: #1f2933;
    color: #fff;
    font-size: 15px;
}
.cmb-submit:disabled { opacity: 0.35; cursor: default; }

.cmb-msg {
    min-height: 20px;
    margin-top: 8px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #7a5a20;
}
.cmb-msg.cmb-msg-bad { color: #b02a37; }
.cmb-msg.cmb-msg-good { color: #2d6a38; }

.cmb-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fffaf2;
    border-radius: 14px;
    padding: 12px;
    border: 1px solid rgba(180, 150, 110, 0.25);
}
.cmb-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}
.cmb-tab {
    flex: 1;
    border: 0;
    background: transparent;
    color: #8a7760;
    font-weight: 800;
    font-size: 13px;
    padding: 6px 8px;
    border-radius: 8px;
    cursor: pointer;
}
.cmb-tab.cmb-tab-on {
    background: #efe4d0;
    color: #3a2a16;
}
.cmb-found-count {
    font-size: 13px;
    font-weight: 700;
    color: #5c4a32;
    margin-bottom: 10px;
}

.cmb-groups {
    overflow: auto;
    max-height: 420px;
    padding-right: 4px;
}
.cmb-group { margin-bottom: 12px; }
.cmb-group-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #8a7760;
    margin-bottom: 6px;
}
.cmb-left {
    color: #b08950;
    font-weight: 700;
    font-size: 12px;
    margin-bottom: 6px;
}
.cmb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cmb-chip {
    background: #efe4d0;
    color: #3a2a16;
    font-weight: 700;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}
.cmb-chip.cmb-chip-hinted {
    background: #ffe8b0;
}
.cmb-chip.cmb-chip-new {
    animation: cmb-pop 0.35s ease;
}
.cmb-chip.cmb-chip-missed {
    background: #f3e8ff;
    color: #5b2a92;
    border: 1px dashed #b089d6;
}

.cmb-help {
    margin-top: 12px;
    background: rgba(12, 6, 28, 0.34);
    border-radius: 12px;
    padding: 10px 14px;
    color: #e8ddff;
    font-size: 14px;
}
.cmb-help summary { cursor: pointer; font-weight: 700; color: #fff; }
.cmb-help ul { margin: 8px 0 4px; padding-left: 20px; }

.cmb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(24, 8, 50, 0.82);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 24px;
    padding: 16px;
    overflow: auto;
}
.cmb-overlay.cmb-hidden { display: none; }
.cmb-win-card {
    box-sizing: border-box;
    text-align: center;
    padding: 22px 28px;
    background: linear-gradient(160deg, #3d1670, #5b2a92);
    border: 2px solid rgba(255, 209, 102, 0.5);
    border-radius: 20px;
    max-width: 340px;
    max-height: 100%;
    overflow: auto;
}
.cmb-win-card.cmb-win-wide {
    width: min(100%, 560px);
    max-width: min(100%, 560px);
}
.cmb-win-title { color: var(--cmb-orange); font-size: 22px; font-weight: 800; }
.cmb-win-stars { font-size: 36px; margin: 4px 0; }
.cmb-win-star { color: rgba(255, 255, 255, 0.22); }
.cmb-win-star.cmb-star-on { color: #ffd166; }
.cmb-win-score { color: #fff; font-size: 20px; font-weight: 800; }
.cmb-win-meta { color: #cbb8ee; margin-bottom: 12px; }
.cmb-answers { text-align: left; margin: 4px 0 14px; }
.cmb-answers-label {
    color: #ffd166;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.4px;
    margin: 8px 0 6px;
    text-transform: uppercase;
}
.cmb-answers-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.cmb-end-chip {
    display: inline-block;
    font-weight: 700;
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 8px;
    text-transform: uppercase;
}
.cmb-end-chip-found { background: #2a9d8f; color: #fff; }
.cmb-end-chip-bonus { background: var(--cmb-orange); color: #34145e; }
.cmb-end-chip-missed {
    background: rgba(255, 255, 255, 0.08);
    color: #e8ddff;
    border: 1px dashed rgba(255, 255, 255, 0.28);
}
.cmb-win-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cmb-win-btn {
    border: 0;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    background: #e63946;
    color: #fff;
}
.cmb-win-btn.cmb-win-ghost {
    background: rgba(255, 255, 255, 0.16);
}

.cmb-shake { animation: cmb-shake 0.4s ease; }

@keyframes cmb-pop {
    0% { transform: scale(0.7); opacity: 0.4; }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes cmb-pulse {
    0%, 100% { box-shadow: 0 0 0 3px #ff9f1c, 0 2px 0 rgba(90, 130, 160, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(255, 159, 28, 0.7), 0 2px 0 rgba(90, 130, 160, 0.25); }
}
@keyframes cmb-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-7px); }
    40% { transform: translateX(7px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

@media (max-width: 760px) {
    .cmb-play { grid-template-columns: 1fr; }
    .cmb-groups { max-height: 260px; }
    .cmb-tile { min-height: 50px; font-size: 16px; padding: 12px 6px 8px; }
}
