/* ─── Container (painted Christmas backdrop) ────────────────────────── */
/* Painted backdrop with nisser/ornaments on the edges and a clean central
   strip where the grid + keyboard sit. The dark-red gradient is the safe
   fallback if the image hasn't loaded yet. */
#game-root .ju-wrap {
    padding: 0.75rem;
    max-width: 500px; margin: 0 auto;
    background:
        linear-gradient(180deg, rgba(42,16,16,0.0) 0%, rgba(42,16,16,0.0) 100%),
        url('/games/julordle/items/background.jpg') center/cover no-repeat,
        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: pill cards ───────────────────────────────────────────────── */
#game-root .ju-header {
    display: flex; align-items: stretch; gap: 0.4rem;
    margin-bottom: 0.6rem;
    flex-wrap: wrap;
}
#game-root .ju-pill {
    flex: 1 1 0; min-width: 80px;
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.7rem;
    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 .ju-pill-icon {
    font-size: 1.4rem; line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}
#game-root .ju-pill-body { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
#game-root .ju-lbl {
    display: block;
    font-size: 0.62rem; letter-spacing: 0.08em;
    color: #8a5a1a; text-transform: uppercase; font-weight: 700;
}
#game-root .ju-val {
    font-size: 1.1rem; 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);
    white-space: nowrap;
}
#game-root .ju-audio {
    flex: 0 0 auto;
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 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 .ju-mute {
    background: transparent; border: 0;
    width: 28px; height: 28px; cursor: pointer;
    font-size: 1rem; padding: 0;
}
#game-root .ju-vol {
    width: 64px; cursor: pointer;
    accent-color: var(--jul-red-700, #8B0000);
}

/* ─── Board frame (wooden, matching the cover) ──────────────────────── */
#game-root .ju-frame {
    background: linear-gradient(180deg, #6b3f1d 0%, #5a3217 100%);
    border-radius: 12px;
    padding: 1rem 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.15), inset 0 0 12px rgba(0,0,0,0.4);
}
#game-root .ju-board {
    display: grid;
    gap: 6px;
    justify-content: center;
}
#game-root .ju-row {
    display: grid;
    grid-template-columns: repeat(5, 56px);
    gap: 6px;
}
#game-root .ju-cell {
    width: 56px; height: 56px;
    border: 2px solid rgba(0,0,0,0.18);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.6rem;
    background: #fff8e1;
    color: #2a1500;
    text-transform: uppercase;
    transition: background 200ms ease, border-color 200ms ease, color 200ms ease;
    box-shadow: inset 0 -2px 0 rgba(0,0,0,0.08);
}
#game-root .ju-cell--active { border-color: #ffd66b; box-shadow: 0 0 0 2px rgba(255, 214, 107, 0.5); }
#game-root .ju-cell--filled { color: #fff; border-color: transparent; }
#game-root .ju-cell--hit { background: #4caf50; }
#game-root .ju-cell--present { background: #d4a72a; }
#game-root .ju-cell--miss { background: #6f6f6f; }

#game-root .ju-message {
    text-align: center;
    min-height: 1.2em;
    color: #ffd66b;
    font-weight: 700;
    opacity: 0;
    transition: opacity 150ms;
    margin-top: 0.5rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
#game-root .ju-msg--show { opacity: 1; }

/* ─── Keyboard ──────────────────────────────────────────────────────── */
#game-root .ju-keyboard {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    margin-bottom: 0.75rem;
}
#game-root .ju-keyrow {
    display: flex;
    gap: 4px;
    justify-content: center;
}
#game-root .ju-key {
    min-width: 32px;
    height: 48px;
    padding: 0 8px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    color: #2a1500;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 2px 0 rgba(0,0,0,0.25);
    transition: transform 60ms ease, box-shadow 60ms ease;
}
#game-root .ju-key:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(0,0,0,0.25); }
#game-root .ju-key--wide { min-width: 60px; }

/* ENTER is the action key — make it visually distinct (green pill with text)
   so first-time players don't miss it. BACKSPACE stays subtle. */
#game-root .ju-key--enter {
    background: linear-gradient(180deg, #4caf50 0%, #3d8b40 100%);
    color: #fff;
    min-width: 84px;
    padding: 0 12px;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
#game-root .ju-key--backspace {
    min-width: 60px;
}

#game-root .ju-key--hit { background: #4caf50; color: #fff; }
#game-root .ju-key--present { background: #d4a72a; color: #fff; }
#game-root .ju-key--miss { background: #6f6f6f; color: #fff; }

/* ─── Result card ───────────────────────────────────────────────────── */
#game-root .ju-result {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,0.18);
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
#game-root .ju-result__msg { margin-bottom: 1rem; color: var(--jul-red-700, #8B0000); }

@media (max-width: 480px) {
    #game-root .ju-row { grid-template-columns: repeat(5, 44px); }
    #game-root .ju-cell { width: 44px; height: 44px; font-size: 1.2rem; }
    #game-root .ju-key { min-width: 26px; height: 42px; font-size: 0.8rem; padding: 0 4px; }
    #game-root .ju-key--wide { min-width: 48px; }
}
