/* ─── Container (wine-red console) ──────────────────────────────────── */
#game-root .px-wrap {
    position: relative; padding: 0.85rem; max-width: 520px; 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 .px-header { display: flex; align-items: stretch; gap: 0.4rem; margin-bottom: 0.55rem; }
#game-root .px-pill {
    flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 0.4rem; padding: 0.32rem 0.55rem;
    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 .px-pill-icon { font-size: 1.1rem; line-height: 1; }
#game-root .px-pill-body { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
#game-root .px-lbl { font-size: 0.58rem; letter-spacing: 0.08em; color: #8a5a1a; text-transform: uppercase; font-weight: 700; }
#game-root .px-val { font-size: 1.1rem; font-weight: 800; color: var(--jul-red-700, #8B0000); font-variant-numeric: tabular-nums; }
#game-root .px-audio { display: flex; align-items: center; gap: 0.3rem; padding: 0.28rem 0.45rem; 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 .px-mute { background: transparent; border: 0; width: 26px; height: 26px; cursor: pointer; font-size: 0.95rem; padding: 0; }
#game-root .px-vol { width: 52px; cursor: pointer; accent-color: var(--jul-red-700, #8B0000); }

/* ─── Template chips ────────────────────────────────────────────────── */
#game-root .px-templates { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.6rem; }
#game-root .px-tmpl {
    padding: 0.3rem 0.7rem; font-size: 0.78rem; font-weight: 700; border-radius: 999px; cursor: pointer;
    color: #fde9a8; background: rgba(0,0,0,0.28); border: 1px solid rgba(255,221,100,0.18);
}
#game-root .px-tmpl:hover:not(.px-tmpl--active) { background: rgba(0,0,0,0.42); color: #fff8d0; }
#game-root .px-tmpl--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); }

/* ─── Playfield + grid ──────────────────────────────────────────────── */
#game-root .px-playfield { position: relative; aspect-ratio: 1; border: 3px solid #ffd66b; border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px rgba(0,0,0,0.4); }
#game-root .px-grid { display: grid; gap: 1px; background: #c9b48a; padding: 1px; width: 100%; height: 100%; }
#game-root .px-cell { background: #fff; border: none; padding: 0; min-width: 0; aspect-ratio: 1; cursor: pointer; font-size: clamp(0.45rem, 1.6vw, 0.78rem); font-weight: 700; color: #8a8a8a; display: flex; align-items: center; justify-content: center; }
#game-root .px-cell--empty { background: #efe7d4; cursor: default; }
#game-root .px-cell--done { color: transparent; }
#game-root .px-cell--nope { animation: px-nope 0.25s ease; }
@keyframes px-nope { 0%,100% { transform: scale(1); } 50% { transform: scale(0.8); background: #f3a3a3; } }

/* ─── Palette ───────────────────────────────────────────────────────── */
#game-root .px-palette { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; margin: 0.7rem 0 0.2rem; }
#game-root .px-color { width: 36px; height: 36px; border-radius: 8px; border: 2px solid rgba(255,255,255,0.5); box-shadow: 0 0 0 1px rgba(0,0,0,0.3); cursor: pointer; font-weight: 800; font-size: 0.85rem; }
#game-root .px-color--active { border-color: #ffd66b; box-shadow: 0 0 0 2px #ffd66b, 0 0 8px rgba(255,214,107,0.7); transform: scale(1.12); }

/* ─── Actions ───────────────────────────────────────────────────────── */
#game-root .px-actions { display: flex; gap: 0.4rem; justify-content: center; flex-wrap: wrap; margin-top: 0.6rem; }
#game-root .px-btn { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.5rem 1.1rem; font-size: 0.9rem; font-weight: 700; border-radius: 999px; cursor: pointer; transition: transform 0.08s ease, background 0.2s ease; }
#game-root .px-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 .px-btn--primary:hover { background: linear-gradient(180deg, #ef4444 0%, #b91c1c 100%); transform: translateY(-1px); }
#game-root .px-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); }
#game-root .px-btn--ghost:hover { background: #fff; transform: translateY(-1px); }

/* ─── Confetti + msg ────────────────────────────────────────────────── */
#game-root .px-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
#game-root .px-confetti-piece { position: absolute; top: 20%; left: 50%; width: 8px; height: 13px; border-radius: 2px; animation: px-confetti-fall 1.6s ease-out forwards; }
@keyframes px-confetti-fall { 0% { transform: translate(0,0) rotate(0); opacity: 1; } 100% { transform: translate(var(--dx), 320px) rotate(var(--rot)); opacity: 0; } }
#game-root .px-msg { text-align: center; margin-top: 0.5rem; min-height: 1.3em; font-weight: 700; color: #fde9a8; }

@media (max-width: 480px) {
    #game-root .px-wrap { padding: 0.6rem; }
    #game-root .px-color { width: 30px; height: 30px; }
    #game-root .px-vol { width: 44px; }
}
