/* =========================================================
   sudoku-game.css — Las Casas Sudoku
   Цветовая схема совпадает с memory-game: тёмный модал,
   золотые монетки, зелёный акцент для призового режима.
========================================================= */

/* ── Обёртка ─────────────────────────────────────────── */
.sd-wrapper {
    display: inline-block;
}

/* ── Кнопка открытия ─────────────────────────────────── */
.sd-open-btn {
    background: linear-gradient(135deg, #1a472a 0%, #2d6a4f 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
    transition: transform .15s, box-shadow .15s;
}
.sd-open-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,.3);
}

/* ── Модалка (оверлей) ───────────────────────────────── */
.sd-modal {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0,0,0,.72);
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.sd-modal-inner {
    background: #1a1a2e;
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    max-height: 95dvh;
    overflow-y: auto;
    padding: 20px;
    color: #e8e8f0;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}

/* ── Шапка ───────────────────────────────────────────── */
.sd-prize-title {
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
    letter-spacing: .12em;
    color: #f4c430;
    text-transform: uppercase;
    margin-bottom: 6px;
}
.sd-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.sd-logo {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: .04em;
}
.sd-logo span {
    color: #f4c430;
}
.sd-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.3rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background .15s;
}
.sd-close:hover { background: rgba(255,255,255,.08); }

/* ── Монетки ─────────────────────────────────────────── */
.sd-coins-bar {
    background: rgba(255,255,255,.04);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
    position: relative;
}
.sd-coins-label {
    font-size: .75rem;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.sd-coins-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.sd-coin-slot {
    width: calc(5% - 4px);
    min-width: 20px;
    aspect-ratio: 1;
}
.sd-coin {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    border-radius: 50%;
    transition: transform .3s;
}
.sd-coin--empty { opacity: .25; }
.sd-coin--filled {
    opacity: 1;
    animation: sd-coin-pop .4s cubic-bezier(.17,.67,.47,1.4);
}
@keyframes sd-coin-pop {
    0%   { transform: scale(0); }
    60%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}
.sd-info-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    color: #ccc;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: .8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sd-info-btn:hover { background: rgba(255,255,255,.15); }

/* ── Инфо-попап ──────────────────────────────────────── */
.sd-info-popup {
    display: flex;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.8);
    z-index: 10;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 20px;
}
.sd-info-popup-inner {
    background: #16213e;
    border-radius: 12px;
    padding: 24px;
    max-width: 360px;
    width: 100%;
    position: relative;
    max-height: 80vh;
    overflow-y: auto;
}
.sd-info-popup-inner h3 { color: #f4c430; margin-bottom: 14px; }
.sd-info-popup-inner ul { padding-left: 1.2em; line-height: 1.9; }
.sd-info-popup-inner li { font-size: .9rem; color: #d0d0e0; }
.sd-info-note { font-size: .78rem; color: #888; margin-top: 12px; }
.sd-info-close {
    position: absolute;
    top: 10px; right: 12px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 1.2rem;
    cursor: pointer;
}

/* ── Статус игрока ───────────────────────────────────── */
.sd-player-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.04);
    border-radius: 10px;
    padding: 8px 14px;
    margin-bottom: 14px;
}
.sd-rank-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .9rem;
    font-weight: 600;
}
.sd-rank-icon { font-size: 1.1rem; }
.sd-rank-name { color: #d0d0e0; }
.sd-stats {
    display: flex;
    gap: 14px;
    font-size: .78rem;
    color: #888;
}
.sd-stat-val { color: #f4c430; font-weight: 700; }

/* ── Выбор режима ────────────────────────────────────── */
.sd-screen--mode h2 {
    text-align: center;
    font-size: 1rem;
    color: #d0d0e0;
    margin-bottom: 16px;
}
.sd-mode-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}
.sd-mode-card {
    background: rgba(255,255,255,.05);
    border: 1.5px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 18px 12px;
    text-align: center;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}
.sd-mode-card:hover { background: rgba(255,255,255,.09); }
.sd-mode-card--prize { border-color: rgba(244,196,48,.25); }
.sd-mode-card--prize:hover { border-color: #f4c430; background: rgba(244,196,48,.06); }
.sd-mode-card--locked { opacity: .75; }
.sd-mode-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: #f4c430;
    color: #1a1a2e;
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .08em;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.sd-mode-icon { font-size: 2rem; margin-bottom: 8px; }
.sd-mode-title { font-size: .95rem; font-weight: 700; margin-bottom: 6px; }
.sd-mode-desc { font-size: .78rem; color: #888; line-height: 1.5; margin-bottom: 12px; }
.sd-mode-btn {
    background: rgba(255,255,255,.1);
    border: none;
    color: #e8e8f0;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: .85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    width: 100%;
}
.sd-mode-btn:hover { background: rgba(255,255,255,.18); }
.sd-mode-btn--prize {
    background: linear-gradient(135deg, #f4c430, #e0a800);
    color: #1a1a2e;
}
.sd-mode-btn--prize:hover { background: linear-gradient(135deg, #f8d04a, #f4c430); }

/* Popup регистрации */
.sd-register-popup {
    display: flex;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.8);
    z-index: 10;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    padding: 20px;
}
.sd-register-popup-inner {
    background: #16213e;
    border-radius: 12px;
    padding: 28px 24px;
    max-width: 320px;
    width: 100%;
    text-align: center;
    position: relative;
}
.sd-register-popup-inner h3 { color: #f4c430; margin-bottom: 10px; font-size: 1rem; }
.sd-register-popup-inner p { font-size: .88rem; color: #ccc; margin-bottom: 16px; }
.sd-register-close {
    position: absolute;
    top: 10px; right: 12px;
    background: none; border: none;
    color: #aaa; font-size: 1.1rem; cursor: pointer;
}
.sd-register-btn {
    display: inline-block;
    background: linear-gradient(135deg, #f4c430, #e0a800);
    color: #1a1a2e;
    text-decoration: none;
    border-radius: 8px;
    padding: 10px 28px;
    font-weight: 700;
    font-size: .9rem;
}

/* ── Экран игры ──────────────────────────────────────── */
.sd-game-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: .82rem;
    color: #aaa;
}
.sd-level-val { font-weight: 700; color: #f4c430; margin: 0 4px; }
.sd-level-name { color: #888; }
.sd-timer-icon { margin-right: 3px; }
.sd-timer-val { font-weight: 700; color: #d0d0e0; }
.sd-errors-val { color: #e74c3c; font-weight: 700; }

/* Кнопки управления */
.sd-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}
.sd-ctrl-btn {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    color: #d0d0e0;
    border-radius: 8px;
    padding: 7px 18px;
    font-size: .9rem;
    cursor: pointer;
    transition: background .15s;
}
.sd-ctrl-btn:hover { background: rgba(255,255,255,.14); }
.sd-ctrl-btn.active {
    background: rgba(244,196,48,.2);
    border-color: #f4c430;
    color: #f4c430;
}

/* ── Поле судоку ─────────────────────────────────────── */
.sd-board {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 1px;
    background: #3a3a5c;
    border: 2px solid #5a5a8a;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    aspect-ratio: 1;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
}
.sd-cell {
    background: #16213e;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(.7rem, 2.2vw, 1.1rem);
    font-weight: 600;
    cursor: pointer;
    transition: background .1s;
    position: relative;
    user-select: none;
    aspect-ratio: 1;
}
/* Жирные границы между блоками 3×3 */
.sd-cell--bl { border-left: 2px solid #5a5a8a !important; }
.sd-cell--bt { border-top: 2px solid #5a5a8a !important; }

.sd-cell--given {
    color: #e8e8f0;
    font-weight: 800;
    background: rgba(255,255,255,.03);
}
.sd-cell:not(.sd-cell--given) { color: #7ec8e3; }

.sd-cell--selected { background: #2a4a7a !important; }
.sd-cell--highlight { background: rgba(42,74,122,.35); }
.sd-cell--same-num { background: rgba(42,74,122,.6); }
.sd-cell--error {
    color: #e74c3c !important;
    animation: sd-shake .3s;
}
@keyframes sd-shake {
    0%, 100% { transform: translateX(0); }
    25%       { transform: translateX(-3px); }
    75%       { transform: translateX(3px); }
}

/* Заметки */
.sd-cell--notes { font-size: 0; }
.sd-notes-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
    height: 100%;
    padding: 1px;
}
.sd-notes-grid span {
    font-size: clamp(.45rem, 1.2vw, .6rem);
    font-weight: 400;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ── Числовая клавиатура ─────────────────────────────── */
.sd-numpad {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.sd-num-btn {
    width: 42px;
    height: 42px;
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.1);
    color: #e8e8f0;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.sd-num-btn:hover {
    background: rgba(126,200,227,.2);
    border-color: #7ec8e3;
    color: #7ec8e3;
}

/* Кнопка назад */
.sd-back-btn {
    background: none;
    border: none;
    color: #666;
    font-size: .82rem;
    cursor: pointer;
    padding: 4px 8px;
    display: block;
    margin: 0 auto;
}
.sd-back-btn:hover { color: #aaa; }

/* ── Победа ──────────────────────────────────────────── */
.sd-screen--win, .sd-screen--lose, .sd-screen--champion {
    text-align: center;
    padding: 20px 0;
}
.sd-win-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: #f4c430;
    margin-bottom: 8px;
}
.sd-win-time {
    color: #888;
    font-size: .88rem;
    margin-bottom: 12px;
}
.sd-win-coins-anim {
    font-size: 1.4rem;
    margin-bottom: 8px;
    min-height: 2rem;
}
.sd-win-msg {
    font-size: .95rem;
    color: #d0d0e0;
    margin-bottom: 14px;
    min-height: 1.4em;
}
.sd-win-btns, .sd-lose-btns {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 16px;
}
.sd-win-next-btn, .sd-lose-retry-btn {
    background: linear-gradient(135deg, #2d6a4f, #1a472a);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 11px 24px;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
}
.sd-win-menu-btn, .sd-lose-menu-btn {
    background: rgba(255,255,255,.07);
    border: 1px solid rgba(255,255,255,.12);
    color: #ccc;
    border-radius: 10px;
    padding: 11px 24px;
    font-size: .9rem;
    cursor: pointer;
}

/* ── Поражение ───────────────────────────────────────── */
.sd-lose-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #e74c3c;
    margin-bottom: 10px;
}
.sd-screen--lose p { color: #aaa; font-size: .9rem; margin-bottom: 4px; }

/* ── Чемпион ─────────────────────────────────────────── */
.sd-champion-title {
    font-size: 2rem;
    font-weight: 900;
    color: #f4c430;
    text-shadow: 0 0 20px rgba(244,196,48,.5);
    margin-bottom: 12px;
}
.sd-champion-coins {
    font-size: 1.1rem;
    color: #f4c430;
    margin-bottom: 14px;
}
.sd-champion-content p { font-size: .92rem; color: #ccc; margin-bottom: 8px; }
.sd-champion-sub { font-size: .8rem !important; color: #888 !important; }
.sd-champion-btn {
    display: inline-block;
    background: linear-gradient(135deg, #f4c430, #e0a800);
    color: #1a1a2e;
    text-decoration: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-weight: 800;
    font-size: .95rem;
    margin-bottom: 12px;
    margin-top: 8px;
}
.sd-champion-play-btn {
    background: none;
    border: 1px solid rgba(255,255,255,.15);
    color: #888;
    border-radius: 8px;
    padding: 8px 20px;
    font-size: .85rem;
    cursor: pointer;
    display: block;
    margin: 0 auto;
}

/* ── Скроллбар ───────────────────────────────────────── */
.sd-modal-inner::-webkit-scrollbar { width: 4px; }
.sd-modal-inner::-webkit-scrollbar-track { background: transparent; }
.sd-modal-inner::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }

/* ── Адаптив ─────────────────────────────────────────── */
@media (max-width: 420px) {
    .sd-modal-inner { padding: 14px; }
    .sd-mode-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
    .sd-mode-card { padding: 14px 8px; }
    .sd-num-btn { width: 36px; height: 36px; font-size: 1rem; }
    .sd-numpad { gap: 4px; }
    .sd-coin-slot { min-width: 16px; }
}

/* v2: призовая карточка вырезана — единственная карточка по центру
   (сетка была на 2 колонки, и карточка прижималась влево) */
.sd-mode-cards { display: flex !important; justify-content: center; grid-template-columns: none; }
.sd-mode-cards .sd-mode-card { width: 100%; max-width: 300px; }
