/* ─── Container (wine-red console) ──────────────────────────────────── */
#game-root .su-wrap {
    position: relative;
    padding: 0.75rem;
    max-width: 480px;
    margin: 0 auto;
    background: linear-gradient(180deg, #2a1010 0%, #5a1818 100%);
    border-radius: var(--jul-radius-lg, 20px);
    user-select: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* ─── HUD pills ─────────────────────────────────────────────────────── */
#game-root .su-header { display: flex; align-items: stretch; gap: 0.4rem; margin-bottom: 0.55rem; }
#game-root .su-pill {
    flex: 1 1 0; min-width: 0;
    display: flex; align-items: center; gap: 0.45rem;
    padding: 0.32rem 0.65rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18);
}
#game-root .su-pill-icon { font-size: 1.2rem; line-height: 1; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15)); }
#game-root .su-pill-body { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
#game-root .su-lbl { font-size: 0.6rem; letter-spacing: 0.08em; color: #8a5a1a; text-transform: uppercase; font-weight: 700; }
#game-root .su-val {
    font-size: 1.2rem; font-weight: 800;
    color: var(--jul-red-700, #8B0000);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
#game-root .su-audio {
    display: flex; align-items: center; gap: 0.3rem;
    padding: 0.28rem 0.5rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18);
}
#game-root .su-mute { background: transparent; border: 0; width: 26px; height: 26px; cursor: pointer; font-size: 0.95rem; padding: 0; }
#game-root .su-vol { width: 56px; cursor: pointer; accent-color: var(--jul-red-700, #8B0000); }

/* ─── Difficulty chips ──────────────────────────────────────────────── */
#game-root .su-modes { display: flex; gap: 0.3rem; margin-bottom: 0.6rem; }
#game-root .su-mode {
    flex: 1 1 0;
    padding: 0.32rem 0.55rem;
    font-size: 0.8rem; font-weight: 700;
    color: #fde9a8;
    background: rgba(0,0,0,0.28);
    border: 1px solid rgba(255, 221, 100, 0.18);
    border-radius: 999px;
    cursor: pointer; letter-spacing: 0.02em;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
#game-root .su-mode:hover:not(.su-mode--active) { background: rgba(0,0,0,0.42); color: #fff8d0; }
#game-root .su-mode--active {
    background: linear-gradient(180deg, #fbd24a 0%, #d99b1e 100%);
    color: #4a1a05; border-color: #b8870b;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6), 0 2px 4px rgba(0,0,0,0.3);
}

/* ─── Playfield (painted bg frames the grid) ────────────────────────── */
#game-root .su-playfield {
    position: relative;
    padding: 16px;
    border: 3px solid #ffd66b;
    border-radius: 14px;
    overflow: hidden;
    background-image: url('/games/jule-sudoku/background.jpg');
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4), inset 0 0 16px rgba(0,0,0,0.25);
}
#game-root .su-board-panel {
    background: rgba(250, 244, 228, 0.94);
    border: 1px solid rgba(120, 80, 40, 0.4);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.6);
}
#game-root .su-board {
    display: grid; grid-template-columns: repeat(9, 1fr);
    gap: 1px; background: #8a6a40; padding: 2px;
    border-radius: 6px;
}
#game-root .su-cell {
    aspect-ratio: 1; border: 0; background: #fdf7e6;
    cursor: pointer; padding: 2px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    transition: background 0.12s ease;
}
#game-root .su-cell img, #game-root .su-padbtn img {
    width: 100%; height: 100%; object-fit: contain; pointer-events: none;
}
#game-root .su-cell--top { border-top: 2px solid #4a2f12; }
#game-root .su-cell--left { border-left: 2px solid #4a2f12; }
#game-root .su-cell--right { border-right: 2px solid #4a2f12; }
#game-root .su-cell--bottom { border-bottom: 2px solid #4a2f12; }
#game-root .su-cell--fixed { background: #ece0c2; cursor: pointer; }
#game-root .su-cell--hint { background: #cfe8f7; box-shadow: inset 0 0 0 2px #5aa0c8; }
#game-root .su-cell--peer { background: #f4ead0; }
#game-root .su-cell--same { background: #f7e3a8; }
#game-root .su-cell--sel { background: var(--jul-gold-300, #FFD66B); box-shadow: inset 0 0 0 2px #d99b1e; }
#game-root .su-cell--bad { background: #f7c3c0; box-shadow: inset 0 0 0 2px #c0392b; }
#game-root .su-cell--wrong { background: #f5b6b2; box-shadow: inset 0 0 0 2px #c0392b; animation: su-wrong 0.55s ease; }
@keyframes su-wrong { 0%,100% { transform: none; } 25% { transform: translateX(-2px); } 75% { transform: translateX(2px); } }

/* ─── Symbol palette ────────────────────────────────────────────────── */
#game-root .su-pad {
    display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px;
    margin: 0.6rem 0 0.6rem;
    padding: 0.4rem;
    background: rgba(0,0,0,0.3);
    border-radius: 12px;
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
}
#game-root .su-padbtn {
    aspect-ratio: 1; border: 1px solid #6a4222; background: #fdf7e6;
    cursor: pointer; padding: 4px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.6);
    transition: transform 0.08s ease, background 0.15s ease;
}
#game-root .su-padbtn:hover { background: #fffaf0; transform: translateY(-2px); }
#game-root .su-padbtn:active { transform: translateY(1px); }

/* ─── Buttons ───────────────────────────────────────────────────────── */
#game-root .su-actions { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; }
#game-root .su-btn {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 1.3rem;
    font-size: 0.95rem; font-weight: 700;
    border-radius: 999px; cursor: pointer;
    transition: transform 0.08s ease, background 0.2s ease, opacity 0.2s ease;
}
#game-root .su-btn--primary {
    background: linear-gradient(180deg, #dc2626 0%, #991b1b 100%);
    color: #fff; border: 1px solid #7f1d1d;
    box-shadow: 0 3px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.3);
}
#game-root .su-btn--primary:hover { background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%); transform: translateY(-1px); }
#game-root .su-btn--primary:active { transform: translateY(1px); }
#game-root .su-btn--ghost {
    background: rgba(255, 248, 225, 0.95); color: #4a1a05;
    border: 1px solid rgba(0,0,0,0.12);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18);
}
#game-root .su-btn--ghost:hover { background: #fff; transform: translateY(-1px); }
#game-root .su-btn--ghost:active { transform: translateY(1px); }

/* ─── Win overlay ───────────────────────────────────────────────────── */
#game-root .su-overlay {
    position: absolute; inset: 0; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    padding: 1rem;
    background: rgba(20, 10, 10, 0.5);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
}
#game-root .su-overlay[hidden] { display: none; }
#game-root .su-overlay-card {
    max-width: 300px; width: 100%; text-align: center;
    padding: 1.3rem 1.2rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(150, 95, 40, 0.45); border-radius: 16px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.7);
    animation: su-pop 0.3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes su-pop { 0% { transform: scale(0.85); opacity: 0; } 100% { transform: none; opacity: 1; } }
#game-root .su-overlay-card h2 { margin: 0 0 0.4rem; color: var(--jul-red-700, #8B0000); font-size: 1.4rem; }
#game-root .su-overlay-card p { margin: 0 0 0.95rem; color: #4a2a10; font-size: 0.95rem; }

/* ─── Confetti ──────────────────────────────────────────────────────── */
#game-root .su-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6; }
#game-root .su-confetti-piece {
    position: absolute; top: 34%; left: 50%;
    width: 8px; height: 13px; border-radius: 2px;
    animation: su-confetti-fall 1.5s ease-out forwards;
}
@keyframes su-confetti-fall {
    0%   { transform: translate(0, 0) rotate(0); opacity: 1; }
    100% { transform: translate(var(--dx), 280px) rotate(var(--rot)); opacity: 0; }
}

/* ─── Status message ────────────────────────────────────────────────── */
#game-root .su-msg { text-align: center; margin-top: 0.6rem; min-height: 1.4em; font-weight: 600; color: #fde9a8; }

/* ─── Responsive ────────────────────────────────────────────────────── */
@media (min-width: 720px) {
    #game-root .su-wrap { max-width: 560px; padding: 1rem; }
    #game-root .su-val { font-size: 1.35rem; }
    #game-root .su-mode { padding: 0.42rem 0.7rem; font-size: 0.86rem; }
    #game-root .su-overlay-card h2 { font-size: 1.5rem; }
}
@media (max-width: 480px) {
    #game-root .su-wrap { padding: 0.6rem; }
    #game-root .su-header { flex-wrap: wrap; gap: 0.3rem; }
    #game-root .su-val { font-size: 1.05rem; }
    #game-root .su-vol { width: 48px; }
    #game-root .su-playfield { padding: 10px; }
    #game-root .su-pad { gap: 3px; padding: 0.3rem; }
    #game-root .su-mode { font-size: 0.74rem; padding: 0.3rem 0.45rem; }
}
