/* === PixelGuesser — Main Stylesheet === */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --color-bg: #030712;
    --color-surface: #111827;
    --color-surface-2: #1f2937;
    --color-border: #374151;
    --color-accent: #6366f1;
    --color-accent-glow: rgba(99,102,241,0.4);
    --color-success: #22c55e;
    --color-danger: #ef4444;
    --color-gold: #eab308;
    --font-pixel: 'Press Start 2P', monospace;
    --font-body: 'Inter', sans-serif;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    background-color: var(--color-bg);
    color: #f9fafb;
    font-family: var(--font-body);
    min-height: 100vh;
    min-height: 100dvh;   /* dynamic viewport: shrinks when the mobile keyboard opens */
}

/* === Layout === */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.nav { background: var(--color-surface); border-bottom: 1px solid var(--color-border); padding: 0 1.5rem; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.nav-logo { font-family: var(--font-pixel); font-size: 0.75rem; color: var(--color-accent); letter-spacing: 0.1em; }
.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-link { color: #9ca3af; text-decoration: none; font-size: 0.9rem; transition: color 0.2s; }
.nav-link:hover, .nav-link.active { color: white; }
.nav-user { color: #e5e7eb; font-size: 0.85rem; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-auth-in { background: var(--color-accent); color: white !important; padding: 0.35rem 0.9rem; border-radius: 999px; font-weight: 600; }
.nav-auth-in:hover { filter: brightness(1.1); }
.nav-auth-out { color: #9ca3af; }
.page-content { flex: 1; padding: 2rem 1rem; max-width: 900px; margin: 0 auto; width: 100%; }

/* === Embedded in the native MAUI app === */
/* When the page is shown inside the app's WebView (UA tag "PixelGuesserApp"), the native
   shell already provides the header + bottom nav, so we hide the web's own nav/drawer to
   avoid a double menu. Pure CSS: the nav component still renders (its push/claim/admin
   logic keeps running) — only the chrome is hidden. */
.app-embedded .nav,
.app-embedded .mobile-drawer-backdrop { display: none !important; }
.app-embedded .page-content { padding-top: 0.75rem; }

/* === Blur Image === */
/* Wrapper sizes to the natural aspect ratio of the cover (4:3, 16:9, square…)
   so nothing gets cropped. Desktop: max 480px wide centred. Mobile: edge-to-edge. */
.game-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--color-border);
    box-shadow: 0 0 40px var(--color-accent-glow);
    background: #0b0b0f;
}
.game-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    transition: filter 0.8s ease;
    image-rendering: pixelated;
}

/* Mobile: break out of the .daily-container max-width and stretch viewport-wide */
@media (max-width: 520px) {
    .game-image-wrapper {
        max-width: 100vw;
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}
.blur-8  { filter: blur(24px) brightness(0.8); }
.blur-7  { filter: blur(20px) brightness(0.85); }
.blur-6  { filter: blur(16px) brightness(0.9); }
.blur-5  { filter: blur(12px) brightness(0.92); }
.blur-4  { filter: blur(8px); }
.blur-3  { filter: blur(5px); }
.blur-2  { filter: blur(3px); }
.blur-1  { filter: blur(1px); }
.blur-0  { filter: blur(0); }

.blur-steps { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }
.blur-step-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--color-border); }
.blur-step-dot.used { background: var(--color-accent); }

/* === Guess Input === */
.guess-area { text-align: center; margin-top: 1.5rem; }
.title-mask {
    font-family: var(--font-pixel);
    font-size: 1rem;
    letter-spacing: 0.25em;
    color: #d1d5db;
    min-height: 1.5em;
    margin-bottom: 1rem;
    word-break: break-all;
}
.guess-input {
    background: var(--color-surface-2);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    color: white;
    font-size: 1.1rem;
    padding: 0.6rem 1rem;
    width: 100%;
    max-width: 420px;
    outline: none;
    transition: border-color 0.2s;
}
.guess-input:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-glow); }
.guess-input.correct { border-color: var(--color-success); }
.guess-input.wrong { border-color: var(--color-danger); animation: shake 0.3s ease; }

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* === Hints === */
.hints-bar { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }
.hint-btn {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: #9ca3af;
    padding: 0.4rem 0.9rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}
.hint-btn:hover:not(:disabled) { border-color: var(--color-accent); color: white; }
.hint-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.hint-btn.used { border-color: var(--color-accent); color: var(--color-accent); }
.hint-box {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #d1d5db;
    text-align: left;
    max-width: 420px;
    margin-inline: auto;
}

/* === Score / Result === */
.score-badge {
    font-family: var(--font-pixel);
    font-size: 1.5rem;
    color: var(--color-gold);
    text-shadow: 0 0 20px rgba(234,179,8,0.6);
}
/* Banner shown when a shared ?invite= link auto-joins you to a friend's weekly ranking */
.invite-joined-banner {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid var(--color-success);
    color: var(--color-success);
    border-radius: 0.5rem;
    padding: 0.6rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    text-align: center;
}
.result-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    max-width: 480px;
    margin: 0 auto;
}
.result-stats-pills {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
}
.result-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 22px;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    color: #e5e7eb;
    white-space: nowrap;
}
.copy-btn {
    background: var(--color-accent);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}
.copy-btn:hover { opacity: 0.85; }

/* === Mode Cards (Home) === */
.mode-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; }
.mode-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.75rem 1.25rem;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
    display: block;
}
.mode-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px var(--color-accent-glow);
}
.mode-card-fav {
    border-color: rgba(234, 179, 8, 0.35);
    background: radial-gradient(circle at top, rgba(234, 179, 8, 0.02) 0%, var(--color-surface) 70%);
}
.mode-card-fav:hover {
    border-color: var(--color-gold);
    box-shadow: 0 8px 30px rgba(234, 179, 8, 0.15);
}
.mode-card-done {
    border-color: rgba(34, 197, 94, 0.35);
    background: radial-gradient(circle at top, rgba(34, 197, 94, 0.03) 0%, var(--color-surface) 70%);
}
.mode-card-done:hover {
    border-color: var(--color-success);
    box-shadow: 0 8px 30px rgba(34, 197, 94, 0.12);
}
.mode-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.mode-title { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.4rem; }
.mode-desc { font-size: 0.8rem; color: #9ca3af; line-height: 1.5; }
.mode-badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 99px;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.badge-daily { background: rgba(234,179,8,0.15); color: var(--color-gold); }
.badge-done { background: rgba(34,197,94,0.18); color: var(--color-success); }
.badge-versus { background: rgba(239,68,68,0.15); color: var(--color-danger); }
.badge-speed { background: rgba(99,102,241,0.15); color: var(--color-accent); }
.badge-free { background: rgba(34,197,94,0.15); color: var(--color-success); }

/* === Versus Specific === */
.vs-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.vs-player { flex: 1; text-align: center; }
.vs-player-name { font-weight: 700; font-size: 0.95rem; }
.vs-score { font-family: var(--font-pixel); font-size: 1.8rem; color: var(--color-accent); }
.vs-vs { font-family: var(--font-pixel); font-size: 0.7rem; color: #6b7280; }
.vs-round-dots { display: flex; gap: 6px; justify-content: center; }
.vs-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--color-border); }
.vs-dot.won { background: var(--color-accent); }
.room-input {
    background: var(--color-surface-2);
    border: 2px solid var(--color-border);
    border-radius: 8px;
    color: white;
    font-size: 1.2rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    padding: 0.6rem 1rem;
    text-align: center;
    width: 200px;
    outline: none;
}
.room-input:focus { border-color: var(--color-accent); }

/* === Speedrun === */
.timer-bar {
    background: var(--color-surface-2);
    border-radius: 99px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}
.timer-fill { height: 100%; background: var(--color-accent); transition: width 0.1s linear; }
.timer-fill.danger { background: var(--color-danger); }
.counter-display { font-family: var(--font-pixel); font-size: 2.5rem; color: white; text-align: center; }
.leaderboard-row { display: flex; align-items: center; gap: 1rem; padding: 0.6rem 0; border-bottom: 1px solid var(--color-border); }
.lb-rank { font-family: var(--font-pixel); font-size: 0.7rem; color: #6b7280; width: 24px; }
.lb-name { flex: 1; font-weight: 600; }
.lb-score { font-family: var(--font-pixel); font-size: 0.8rem; color: var(--color-gold); }

/* === Buttons === */
.btn { border: none; border-radius: 8px; padding: 0.6rem 1.5rem; font-size: 0.95rem; font-weight: 600; cursor: pointer; transition: opacity 0.2s, transform 0.1s; }
.btn:hover { opacity: 0.9; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--color-accent); color: white; }
.btn-outline { background: transparent; border: 1px solid var(--color-border); color: white; }
.btn-danger { background: var(--color-danger); color: white; }
.btn-success { background: var(--color-success); color: white; }
.btn-lg { padding: 0.8rem 2rem; font-size: 1.1rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

/* === Utilities === */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.text-center { text-align: center; }
.text-sm { font-size: 0.85rem; }
.text-muted { color: #6b7280; }
.text-success { color: var(--color-success); }
.text-danger { color: var(--color-danger); }
.text-accent { color: var(--color-accent); }
.text-gold { color: var(--color-gold); }
.font-pixel { font-family: var(--font-pixel); }
.w-full { width: 100%; }

/* Blazor error UI */
#blazor-error-ui { display: none; }

/* ═══════════════════════════════════════════════════════════
   Daily — Wordle-style redesign
   ═══════════════════════════════════════════════════════════ */

/* ── Container ─────────────────────────────────────────────── */
.daily-container {
    width: 100%;          /* must be explicit so margin:auto can center children */
    max-width: 500px;
    margin: 0 auto;
}

/* ── Active-play layout: fit image + tiles + input above the keyboard ─────────
   When playing, the container becomes a flex column that fills the available
   (dynamic) viewport height. The image block is the ONLY flexible element, so as
   the soft keyboard shrinks the viewport the image shrinks first and the letter
   tiles + input stay visible. Everything else keeps its natural height. */
/* Trim page padding while playing so more fits above the keyboard. */
.page-content:has(.daily-playing) { padding: 0.6rem 0.75rem; }

/* Active-play layout. Kept deliberately simple (normal flow + a dvh-based image cap)
   so it's robust: the cover's height tracks the *dynamic* viewport, so when the mobile
   keyboard opens (interactive-widget=resizes-content shrinks dvh) the image shrinks and
   the letter tiles + input rise into view. No flex-fill tricks → no percentage-height
   collapse edge-cases. */
.daily-play { display: flex; flex-direction: column; gap: 0.5rem; }
.daily-play-image { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.daily-play-image .game-image-wrapper { margin: 0 auto; }
.daily-play-image .game-image {
    height: auto;
    max-height: 46dvh;
    object-fit: contain;
}
.daily-play .hint-pills { margin-top: 0.5rem; }

/* ── Header ────────────────────────────────────────────────── */
.daily-header {
    display: flex;
    flex-direction: column;
    align-items: center;  /* centres block-level children, not just text */
    text-align: center;
    margin-bottom: 1.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
    width: 100%;
}
.daily-title {
    font-family: var(--font-pixel);
    font-size: 1rem;
    color: white;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}
.daily-date {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--color-gold);
}
.daily-score-row {
    margin-top: 0.6rem;
}
.live-score-chip {
    display: inline-block;
    background: rgba(234,179,8,0.12);
    border: 1px solid rgba(234,179,8,0.35);
    border-radius: 99px;
    padding: 4px 16px;
    font-family: var(--font-pixel);
    font-size: 0.7rem;
    color: var(--color-gold);
    letter-spacing: 0.05em;
}
.scoring-legend {
    font-size: 0.68rem;
    color: #6b7280;
    margin-top: 0.45rem;
    line-height: 1.6;
}
.scoring-legend strong { color: #9ca3af; }

/* ── Game meta chips ───────────────────────────────────────── */
.game-meta {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 8px 0 0;
}
.game-meta-chip {
    font-size: 0.7rem;
    color: #9ca3af;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 99px;
    padding: 3px 12px;
    font-weight: 500;
}

/* ── Blur bar (replaces dots) ──────────────────────────────── */
.blur-bar {
    max-width: 280px;
    margin: 8px auto 4px;
    height: 6px;
    background: var(--color-border);   /* #374151 — visible even when fill=0% */
    border-radius: 99px;
    overflow: hidden;
}
.blur-bar-fill {
    height: 100%;
    background: var(--color-accent);
    transition: width 0.6s ease;
    border-radius: 99px;
    min-width: 4px;   /* always a sliver visible so bar doesn't look broken */
}
.blur-label {
    font-size: 0.68rem;
    color: #6b7280;
    text-align: center;
    margin-top: 2px;
}

/* ── Blur action button ────────────────────────────────────── */
.blur-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px dashed var(--color-border);
    border-radius: 8px;
    color: #6b7280;
    padding: 0.5rem 1.1rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 1rem;
}
.blur-action:hover:not(:disabled) {
    border-color: var(--color-accent);
    border-style: solid;
    color: var(--color-accent);
}
.blur-action:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Tile caption (word / letter count) ────────────────────── */
.tile-caption {
    text-align: center;
    font-size: 0.72rem;
    color: #6b7280;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 0.6rem;
}

/* ── Letter tiles ──────────────────────────────────────────── */
.letter-grid-container.shake { animation: shake 0.35s ease; }
.letter-grid-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 6px;
    justify-content: center;
    margin: 0.5rem auto 1rem;
    max-width: 500px;
    padding: 0 0.5rem;
}
.word-group {
    display: flex;
    gap: 4px;
}
/* dot separator between word groups */
.word-sep {
    font-size: 1.1rem;
    color: #4b5563;
    line-height: 1;
    user-select: none;
    padding: 0 2px;
}
.letter-tile {
    width: 34px;
    height: 40px;
    border: 2px solid var(--color-border);   /* #374151 — clearly visible on dark bg */
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 800;
    background: var(--color-surface-2);
    color: transparent;
    transition: background 0.3s, border-color 0.3s, color 0.25s, transform 0.2s;
    text-transform: uppercase;
    user-select: none;
}
/* semi-gap hint revealed */
.letter-tile.revealed {
    background: #1e3a5f;
    border-color: var(--color-accent);
    color: var(--color-accent);
    transform: scale(1.06);
}
/* solved: all tiles go green with a little celebratory pop */
.letter-tile.solved {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
    animation: tilePop 0.4s ease both;
}
/* staggered so the word "pops" left-to-right */
.letter-tile.solved:nth-child(1) { animation-delay: 0.00s; }
.letter-tile.solved:nth-child(2) { animation-delay: 0.05s; }
.letter-tile.solved:nth-child(3) { animation-delay: 0.10s; }
.letter-tile.solved:nth-child(4) { animation-delay: 0.15s; }
.letter-tile.solved:nth-child(5) { animation-delay: 0.20s; }
.letter-tile.solved:nth-child(6) { animation-delay: 0.25s; }
.letter-tile.solved:nth-child(n+7) { animation-delay: 0.30s; }

@keyframes tilePop {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.18) translateY(-4px); }
    100% { transform: scale(1) translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .letter-tile.solved { animation: none; }
}
/* digits / punctuation — no box, just the character */
.letter-tile.non-letter {
    border: none;
    background: transparent;
    color: #6b7280;
    font-family: var(--font-body);
    font-size: 0.95rem;
    width: 14px;
    min-width: 0;
    flex-shrink: 0;
}

/* ── Guess input row ───────────────────────────────────────── */
.guess-input-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: stretch;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 0.5rem;
}
.guess-input-row .guess-input { flex: 1; min-width: 0; }
.guess-submit-btn { padding: 0.6rem 1.2rem; font-size: 0.95rem; font-weight: 700; white-space: nowrap; }

/* ── Feedback ──────────────────────────────────────────────── */
.feedback-row {
    text-align: center;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.4rem 0;
}
.feedback-placeholder { min-height: 36px; }
.guess-feedback {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 99px;
    animation: fadeInUp 0.2s ease;
}
.feedback-ok    { color: var(--color-success); background: rgba(34,197,94,0.12); border: 1px solid rgba(34,197,94,0.3); }
.feedback-error { color: var(--color-danger);  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); }

/* ── Input helper text ─────────────────────────────────────── */
.input-hint-text {
    text-align: center;
    font-size: 0.68rem;
    color: #4b5563;
    margin-top: 0.4rem;
}
.input-hint-text kbd {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 0.65rem;
    font-family: var(--font-body);
}

/* ── Hint pills ────────────────────────────────────────────── */
.hint-pills {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.25rem;
    padding: 0 0.5rem;
}
.hint-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 9px;
    color: #9ca3af;
    padding: 5px 11px;
    min-width: 86px;
    font-family: var(--font-body);
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}
.hint-pill:hover:not(:disabled) {
    border-color: var(--color-accent);
    color: white;
    background: rgba(99,102,241,0.08);
}
.hint-pill.used {
    border-color: var(--color-accent);
    background: rgba(99,102,241,0.12);
    color: var(--color-accent);
}
.hint-pill:disabled { opacity: 0.3; cursor: not-allowed; }
.hint-pill-num   { font-size: 0.85rem; line-height: 1; }
.hint-pill-label { font-weight: 700; font-size: 0.7rem; }
.hint-pill-cost  { font-size: 0.58rem; color: #6b7280; }
.hint-pill.used .hint-pill-cost { color: rgba(99,102,241,0.55); }

/* ── Hint content cards ────────────────────────────────────── */
.hint-content {
    background: rgba(99,102,241,0.07);
    border: 1px solid rgba(99,102,241,0.22);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    margin: 0.6rem auto 0;
    font-size: 0.85rem;
    color: #d1d5db;
    max-width: 500px;
    text-align: left;
    animation: fadeInUp 0.25s ease;
}
.hint-content .hint-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent);
    margin-bottom: 0.4rem;
}
.hint-content .hint-text {
    font-family: monospace;
    font-size: 1.05rem;
    letter-spacing: 0.3em;
    color: white;
}

/* ── Shared animation ──────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Hidden Keyboard Input === */
.hidden-keyboard-input {
    position: absolute;
    left: -9999px;
    top: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
    border: none;
}

/* === Letter Tiles Enhanced === */
.letter-tile.filled {
    background: rgba(99, 102, 241, 0.18);
    border: 2px solid var(--color-accent);
    color: white;
    font-weight: 700;
}

/* Wrong-guess feedback: only the mismatched letters go red; the rest stay typed. */
.letter-tile.filled.wrong {
    background: rgba(239, 68, 68, 0.22);
    border-color: var(--color-danger);
    color: #fecaca;
}

.letter-tile.revealed {
    background: #1e3a5f;
    border: 2px solid var(--color-accent);
    color: white;
    font-weight: 700;
}

/* === Countdown Timer === */
.timer-display {
    font-family: var(--font-pixel);
    font-size: 1.35rem;
    text-align: center;
    margin: 0.3rem 0 0.7rem;
    color: var(--color-accent);
}

/* === Responsive Design === */
@media (max-width: 480px) {
    .letter-tile {
        width: 28px;
        height: 34px;
        font-size: 0.78rem;
        line-height: 1;
    }
    /* .game-image-wrapper handled by the dedicated @media block above — preserves natural aspect ratio. */
}

/* === Keyboard open on mobile ===
   With interactive-widget=resizes-content the layout viewport shrinks when the
   Android/iOS soft keyboard opens. A phone ~800-915px tall drops to ~480-595px,
   so 600px catches the keyboard-open state without firing when it's closed. === */
@media (max-height: 600px) {
    .page-content { padding: 0.4rem 0.75rem; }
    .daily-play { gap: 0.3rem; }
    /* image tracks the (shrunken) viewport so tiles + input rise above the keyboard */
    .daily-play-image .game-image { max-height: 32dvh; }
    /* header: drop the "Daily" word, keep date + score compact */
    .daily-playing .daily-title { display: none; }
    .daily-header {
        margin-bottom: 0.3rem;
        padding-bottom: 0.3rem;
    }
    .scoring-legend { display: none; }
    .daily-score-row { margin-top: 0; }
    .live-score-chip { padding: 3px 12px; font-size: 0.62rem; }
    .game-meta { margin-top: 2px; }
    .game-meta-chip { padding: 2px 9px; font-size: 0.62rem; }
    .guess-area { margin-top: 0.2rem; }
    .tile-caption { display: none; }          /* the tiles themselves convey word/letter count */
    .timer-display { font-size: 1.1rem; margin: 0.1rem 0 0.3rem; }
    .input-hint-text { display: none; }       /* save a line; keyboard is already open */
    .feedback-row, .feedback-placeholder { min-height: 20px; }
    /* free vertical space inside the image area so the cover can grow */
    .daily-play-image .blur-bar,
    .daily-play-image .blur-label { display: none; }
    /* hints: tighter single row */
    .hint-pills { margin-top: 0.3rem; gap: 6px; }
    .hint-pill { padding: 4px 10px; min-width: 84px; flex-direction: row; gap: 5px; }
}

/* Very short (small phones, keyboard open): shrink image further, trim hint chrome */
@media (max-height: 460px) {
    .daily-play-image .game-image { max-height: 24dvh; }
    .hint-pill-cost { display: none; }
    .game-meta { display: none; }
}

/* === Versus Lobby === */
.lobby-section {
    margin-bottom: 1.5rem;
}

.lobby-label {
    font-size: 0.85rem;
    color: #d1d5db;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.lobby-divider {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6b7280;
    margin: 1.25rem 0;
    font-size: 0.75rem;
}

.lobby-divider::before,
.lobby-divider::after {
    content: "";
    flex-grow: 1;
    border-top: 1px solid var(--color-border);
}

.room-code-chip {
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 4px;
    transition: background 0.2s;
}

.room-code-chip:hover {
    background: rgba(99, 102, 241, 0.2);
}

/* ─── Result card — enhanced ─── */
.result-cover {
    max-width: 180px;
    max-height: 220px;
    width: auto;
    height: auto;
    border-radius: 12px;
    margin: 0 auto 1.25rem;
    display: block;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.result-headline {
    font-family: var(--font-pixel);
    font-size: 1.4rem;
    text-align: center;
    margin: 0 0 1.5rem;
    letter-spacing: 0.06em;
}

.result-headline-ok { color: var(--color-success); }
.result-headline-ko { color: var(--color-danger); }

.result-answer-label {
    text-align: center;
    color: #9ca3af;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 0.4rem;
}

.result-answer-title {
    text-align: center;
    font-weight: 800;
    font-size: 1.85rem;
    line-height: 1.15;
    color: var(--color-gold);
    margin: 0 0 1.4rem;
    word-break: break-word;
}

.result-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0 0 1.2rem;
}

.result-stat {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    color: #e5e7eb;
}

/* ═══════════════════════════════════════════════════════════
   PWA install prompt
   ═══════════════════════════════════════════════════════════ */
.install-prompt { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.install-btn { font-size: 1rem; }
.install-text { color: #9ca3af; font-size: 0.85rem; max-width: 22rem; line-height: 1.5; }

/* ═══════════════════════════════════════════════════════════
   Share menu (ResultCard)
   ═══════════════════════════════════════════════════════════ */
.share-wrap { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.share-toggle { display: inline-flex; align-items: center; gap: 0.5rem; }
.share-caret { font-size: 0.7rem; opacity: 0.8; }
.share-menu {
    display: flex; flex-direction: column; gap: 0.5rem;
    width: 100%; max-width: 340px; margin-top: 0.25rem;
    animation: fadeInUp 0.2s ease;
}
.share-option {
    display: flex; align-items: center; gap: 0.85rem; text-align: left;
    background: var(--color-surface-2); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 0.7rem 1rem; color: #e5e7eb; cursor: pointer;
    transition: border-color 0.2s, transform 0.1s, background 0.2s;
}
.share-option:hover:not(:disabled) { border-color: var(--color-accent); background: rgba(99,102,241,0.08); }
.share-option:active { transform: scale(0.99); }
.share-option:disabled { opacity: 0.5; cursor: wait; }
.share-option-icon { font-size: 1.5rem; flex-shrink: 0; }
.share-option-title { display: block; font-weight: 700; font-size: 0.92rem; }
.share-option-sub { display: block; font-size: 0.75rem; color: #9ca3af; }
.share-feedback { font-size: 0.85rem; color: var(--color-success); min-height: 1.2em; }
.share-stats-btn { margin-top: 1rem; }

/* ═══════════════════════════════════════════════════════════
   Modal dialog
   ═══════════════════════════════════════════════════════════ */
.modal-backdrop {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(3, 7, 18, 0.75); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center; padding: 1rem;
    animation: fadeInUp 0.15s ease;
}
.modal-panel {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 18px; width: 100%; max-width: 440px;
    max-height: 90vh; overflow-y: auto; position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1.1rem 1.3rem 0.6rem; border-bottom: 1px solid var(--color-border);
}
.modal-title { font-family: var(--font-pixel); font-size: 0.95rem; color: var(--color-accent); }
.modal-close {
    background: transparent; border: none; color: #9ca3af; font-size: 1.1rem;
    cursor: pointer; padding: 0.2rem 0.5rem; border-radius: 6px; transition: color 0.2s, background 0.2s;
}
.modal-close:hover { color: white; background: var(--color-surface-2); }
.modal-close-float { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 1; }
.modal-body { padding: 1.3rem; }

/* ═══════════════════════════════════════════════════════════
   Stats panel
   ═══════════════════════════════════════════════════════════ */
.stats-grid {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin-bottom: 1.25rem;
}
.stat-box {
    background: var(--color-surface-2); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 0.7rem 0.4rem; text-align: center;
}
.stat-num { font-family: var(--font-pixel); font-size: 1.05rem; color: white; }
.stat-unit { font-size: 0.7rem; color: #9ca3af; }
.stat-label { font-size: 0.68rem; color: #9ca3af; margin-top: 0.3rem; }
.stats-dist-title { font-size: 0.78rem; color: #d1d5db; margin-bottom: 0.6rem; }
.dist-row { display: flex; align-items: center; gap: 0.6rem; margin-bottom: 0.35rem; }
.dist-lvl { font-size: 0.72rem; color: #9ca3af; width: 28px; text-align: right; }
.dist-bar-track { flex: 1; }
.dist-bar-fill {
    background: var(--color-accent); color: white; font-size: 0.72rem; font-weight: 700;
    border-radius: 5px; padding: 1px 6px; min-width: 1.4em; text-align: right; transition: width 0.4s ease;
}
.stats-next { text-align: center; font-size: 0.8rem; color: #9ca3af; margin-top: 1rem; }

/* ═══════════════════════════════════════════════════════════
   How to play / onboarding
   ═══════════════════════════════════════════════════════════ */
.nav-help {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    border: 1px solid var(--color-border); background: var(--color-surface-2);
    color: #9ca3af; font-weight: 700; cursor: pointer; padding: 0; line-height: 1;
}
.nav-help:hover { color: white; border-color: var(--color-accent); }
.howto-steps { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-direction: column; gap: 1rem; }
.howto-steps li { display: flex; gap: 0.85rem; align-items: flex-start; }
.howto-emoji { font-size: 1.6rem; flex-shrink: 0; }
.howto-steps strong { display: block; margin-bottom: 0.15rem; }
.howto-steps p { font-size: 0.85rem; color: #9ca3af; line-height: 1.45; }
.howto-steps kbd {
    background: var(--color-surface-2); border: 1px solid var(--color-border);
    border-radius: 4px; padding: 1px 5px; font-size: 0.75rem;
}
.sound-toggle {
    display: flex; align-items: center; gap: 0.5rem; cursor: pointer;
    font-size: 0.9rem; color: #d1d5db; margin-bottom: 1.2rem;
    background: var(--color-surface-2); border: 1px solid var(--color-border);
    border-radius: 10px; padding: 0.6rem 0.85rem;
}
.sound-toggle input { width: 1.1rem; height: 1.1rem; accent-color: var(--color-accent); }

/* ═══════════════════════════════════════════════════════════
   Ranking (Daily + All-time) — moved from inline <style>
   ═══════════════════════════════════════════════════════════ */
.ranking-container { max-width: 800px; margin: 2rem auto; padding: 0 1rem; }
/* Category chips must wrap — a single-row flex overflowed the viewport on mobile */
.ranking-category-tabs {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 0.5rem; margin-bottom: 1.25rem;
}
.ranking-category-search { display: flex; flex-direction: column; gap: 6px; margin-bottom: 1.25rem; }
.ranking-category-search .daily-hub-search { margin-bottom: 0.35rem; }
.ranking-search-item {
    display: flex; align-items: center; gap: 0.6rem; text-align: left;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 10px; color: #e5e7eb; padding: 0.55rem 0.8rem;
    cursor: pointer; font-family: inherit; font-size: 0.85rem;
}
.ranking-search-item:hover { border-color: var(--color-accent); }
.ranking-search-name { font-weight: 600; white-space: nowrap; }
.ranking-search-desc {
    font-size: 0.75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ranking-tabs {
    display: flex; gap: 0.5rem; justify-content: center; margin: 1rem 0 1.5rem;
}
.ranking-tab {
    background: var(--color-surface-2); border: 1px solid var(--color-border);
    color: #9ca3af; border-radius: 99px; padding: 0.45rem 1.3rem; font-size: 0.85rem;
    font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.ranking-tab:hover { color: white; border-color: var(--color-accent); }
.ranking-tab.active { background: var(--color-accent); color: white; border-color: var(--color-accent); }
.ranking-subtitle { text-align: center; font-size: 0.8rem; color: #9ca3af; margin-bottom: 1rem; }
.ranking-date-controls {
    display: flex; justify-content: center; align-items: center; gap: 1rem; margin-bottom: 1.5rem;
}
.ranking-date { font-size: 0.9rem; color: #e5e7eb; min-width: 140px; text-align: center; }
.ranking-table { display: flex; flex-direction: column; gap: 0.5rem; }
.ranking-row {
    display: grid; grid-template-columns: 50px 1fr 100px 120px 80px; gap: 1rem;
    align-items: center; padding: 1rem; background: var(--color-surface-2);
    border: 1px solid var(--color-border); border-radius: 0.5rem; font-size: 0.9rem;
}
.ranking-row.podium-1 { background: rgba(212,175,55,0.1); border-left: 4px solid var(--color-gold); }
.ranking-row.podium-2 { background: rgba(192,192,192,0.1); border-left: 4px solid #c0c0c0; }
.ranking-row.podium-3 { background: rgba(205,127,50,0.1); border-left: 4px solid #cd7f32; }
.ranking-rank { text-align: center; font-weight: 600; }
.medal { font-size: 1.2rem; }
.rank-number { font-size: 0.9rem; color: #9ca3af; }
.ranking-name { font-weight: 500; word-break: break-word; }
.ranking-score { text-align: right; font-weight: 600; color: var(--color-accent); }
.ranking-meta { text-align: right; font-size: 0.85rem; }
.ranking-hints { text-align: right; font-size: 0.85rem; }

@media (max-width: 600px) {
    .ranking-row { grid-template-columns: 40px 1fr 80px; gap: 0.8rem; padding: 0.8rem; }
    .ranking-meta, .ranking-hints { grid-column: 1 / -1; text-align: left; font-size: 0.8rem; margin-top: 0.3rem; }
}

/* ═══════════════════════════════════════════════════════════
   Today head-to-head (async friend challenge)
   ═══════════════════════════════════════════════════════════ */
.h2h-card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 14px; padding: 1.1rem 1.2rem; margin-top: 1.25rem;
}
.h2h-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 0.8rem; text-align: center; }
.h2h-list { display: flex; flex-direction: column; gap: 0.5rem; }
.h2h-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 0.7rem; background: var(--color-surface-2);
    border-radius: 8px; font-size: 0.88rem;
}
.h2h-name { font-weight: 600; }
.h2h-score { color: var(--color-accent); font-weight: 600; }
.h2h-fail { color: var(--color-danger); font-size: 0.82rem; }
.h2h-pending { color: #6b7280; font-size: 0.82rem; font-style: italic; }
.h2h-hint { text-align: center; font-size: 0.72rem; color: #6b7280; margin-top: 0.8rem; }

/* ═══════════════════════════════════════════════════════════
   Custom virtual keyboard styles
   ═══════════════════════════════════════════════════════════ */
.virtual-keyboard {
    margin: 1.25rem auto 0;
    max-width: 500px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 8px 12px;
    user-select: none;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
    width: 100%;
}

.keyboard-key {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: #f3f4f6;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.15rem;
    height: 48px;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.keyboard-key:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--color-accent);
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.25);
}

.keyboard-key:active:not(:disabled) {
    background: var(--color-accent-glow);
    transform: scale(0.92);
}

.keyboard-key.action-key {
    font-size: 0.82rem;
    flex: 2.2;
    font-weight: 800;
    text-transform: uppercase;
    color: #e5e7eb;
}

.keyboard-key.enter-key {
    color: var(--color-success);
    border-color: rgba(34, 197, 94, 0.3);
}
.keyboard-key.enter-key:hover:not(:disabled) {
    background: rgba(34, 197, 94, 0.1);
    border-color: var(--color-success);
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.25);
}

.keyboard-key.backspace-key {
    color: var(--color-danger);
    border-color: rgba(239, 68, 68, 0.3);
}
.keyboard-key.backspace-key:hover:not(:disabled) {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.25);
}

@media (max-width: 480px) {
    .virtual-keyboard {
        margin-top: 1rem;
        gap: 6px;
        padding-bottom: 36px;
    }
    .keyboard-row {
        gap: 4px;
    }
    .keyboard-key {
        height: 42px;
        font-size: 0.95rem;
        border-radius: 6px;
    }
    .keyboard-key.action-key {
        font-size: 0.72rem;
        flex: 2.2;
    }
}

@media (max-height: 680px) {
    .keyboard-key {
        height: 38px;
        font-size: 0.9rem;
    }
    .virtual-keyboard {
        margin-top: 0.5rem;
        gap: 5px;
        padding-bottom: 24px;
    }
}

/* ═══════════════════════════════════════════════════════════
   Responsive Menu & Navigation Upgrades (Premium Layout)
   ═══════════════════════════════════════════════════════════ */

/* Desktop vs Mobile display utilities */
.desktop-only {
    display: flex !important;
}
.mobile-only {
    display: none !important;
}

@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    .mobile-only {
        display: flex !important;
    }
    
    .nav {
        padding: 0 1rem !important;
        justify-content: space-between !important;
    }
    
    .nav-logo {
        font-size: 0.85rem !important;
    }
}

/* Bell Button styling */
.nav-bell-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    padding: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    transition: color 0.2s, transform 0.2s, background-color 0.2s;
    border-radius: 50%;
    outline: none;
    width: 38px;
    height: 38px;
}
.nav-bell-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
    transform: scale(1.05);
}
.nav-bell-btn:active {
    transform: scale(0.95);
}
.nav-bell-btn.subscribed {
    color: var(--color-gold);
}
.nav-bell-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    transition: fill 0.3s;
}

/* Bell Badge */
.bell-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    background-color: #f59e0b; /* warning/attention orange */
    border-radius: 50%;
    border: 2px solid var(--color-surface);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.6);
    animation: bell-pulse 2s infinite;
}

@keyframes bell-pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 6px rgba(245, 158, 11, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }
}

/* Hamburger Button */
.nav-hamburger-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    transition: background-color 0.2s;
    outline: none;
}
.nav-hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}
.hamburger-bar {
    width: 20px;
    height: 2px;
    background-color: #9ca3af;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}
.hamburger-bar:nth-child(2) {
    margin: 3px 0;
}
.hamburger-bar.open:nth-child(1) {
    transform: translateY(5px) rotate(45deg);
    background-color: white;
}
.hamburger-bar.open:nth-child(2) {
    opacity: 0;
}
.hamburger-bar.open:nth-child(3) {
    transform: translateY(-5px) rotate(-45deg);
    background-color: white;
}

/* Mobile Controls Row */
.nav-mobile-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Mobile Drawer Menu Overlay */
.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.mobile-drawer-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

/* Drawer panel */
.mobile-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 82%;
    max-width: 320px;
    background: rgba(11, 15, 26, 0.96);
    border-left: 1px solid var(--color-border);
    backdrop-filter: blur(20px);
    z-index: 1001;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.6);
}
.mobile-drawer.open {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--color-border);
}
.drawer-title {
    font-family: var(--font-pixel);
    font-size: 0.85rem;
    color: var(--color-accent);
    letter-spacing: 0.12em;
}
.drawer-close {
    background: transparent;
    border: none;
    color: #9ca3af;
    font-size: 1.35rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    outline: none;
    padding: 0 4px;
}
.drawer-close:hover {
    color: white;
}

.drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.drawer-link {
    display: flex;
    align-items: center;
    color: #d1d5db;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.75rem 1.1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    transition: all 0.2s ease;
    cursor: pointer;
}
.drawer-link:hover {
    color: white;
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--color-accent);
    transform: translateX(4px);
}

.text-left-btn {
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.drawer-divider {
    border: 0;
    height: 1px;
    background: var(--color-border);
    margin: 0.6rem 0;
    opacity: 0.8;
}

.drawer-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid var(--color-border);
    text-align: center;
}
.footer-version {
    font-size: 0.7rem;
    color: #4b5563;
    letter-spacing: 0.05em;
}

/* Category menu inside drawer */
.drawer-daily-wrap {
    display: flex;
    flex-direction: column;
}
.drawer-daily-toggle {
    justify-content: space-between;
}
.drawer-daily-menu {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 12px;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-top: 0.35rem;
    border: 1px solid rgba(255, 255, 255, 0.02);
    animation: fadeIn 0.2s ease;
}
.drawer-daily-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.75rem;
    color: #9ca3af;
    text-decoration: none;
    font-size: 0.85rem;
    border-radius: 8px;
    transition: all 0.2s;
}
.drawer-daily-item:hover {
    color: white;
    background: rgba(99, 102, 241, 0.08);
}

.nav-auth-in-drawer {
    background: var(--color-accent);
    color: white !important;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}
.nav-auth-in-drawer:hover {
    filter: brightness(1.1);
}

/* Notifications modal custom styles */
.notifications-modal-content {
    display: flex;
    flex-direction: column;
    color: #e5e7eb;
    gap: 1rem;
}
.welcome-banner {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: 14px;
    padding: 1.1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.08);
}
.welcome-banner h3 {
    margin: 0 0 0.4rem 0;
    font-size: 1.05rem;
    color: var(--color-gold);
    font-family: var(--font-pixel);
    letter-spacing: 0.03em;
}
.welcome-banner p {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.45;
    color: #d1d5db;
}

.card-style {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 1.2rem;
}
.section-title {
    margin: 0 0 0.6rem 0;
    font-family: var(--font-pixel);
    font-size: 0.78rem;
    color: var(--color-accent);
    letter-spacing: 0.08em;
}
.section-desc {
    font-size: 0.82rem;
    color: #9ca3af;
    line-height: 1.4;
    margin: 0 0 0.85rem 0;
}

.status-badge-container {
    display: block;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
}
.status-active {
    background: rgba(34, 197, 94, 0.08);
    color: var(--color-success);
    border: 1px solid rgba(34, 197, 94, 0.15);
}
.status-inactive {
    background: rgba(239, 68, 68, 0.08);
    color: var(--color-danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}
.status-unsupported {
    background: rgba(107, 114, 128, 0.08);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.15);
}
.status-installed {
    background: rgba(234, 179, 8, 0.08);
    color: var(--color-gold);
    border: 1px solid rgba(234, 179, 8, 0.15);
}

.ios-warning {
    background: rgba(245, 158, 11, 0.08);
    border-left: 3px solid #f59e0b;
    padding: 0.7rem 0.8rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 0.85rem;
}
.ios-warning p {
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #fbbf24;
}

.btn-glowing {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.35);
    animation: glow-pulse-button 2s infinite alternate;
}
@keyframes glow-pulse-button {
    0% {
        box-shadow: 0 0 5px rgba(99, 102, 241, 0.25);
    }
    100% {
        box-shadow: 0 0 15px rgba(99, 102, 241, 0.55);
    }
}

.ios-install-steps {
    background: rgba(0, 0, 0, 0.18);
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}
.ios-install-steps h5 {
    margin: 0 0 0.55rem 0;
    font-size: 0.8rem;
    color: #e5e7eb;
    font-weight: 700;
}
.ios-install-steps ol {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.78rem;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.ios-install-steps li {
    line-height: 1.4;
}
.share-icon-placeholder {
    display: inline-flex;
    background: rgba(255,255,255,0.08);
    padding: 1px 4px;
    border-radius: 4px;
    margin: 0 2px;
    font-weight: bold;
}

.install-manual-hint {
    text-align: center;
    font-size: 0.78rem;
    color: #6b7280;
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
}

.btn-text-only {
    background: transparent;
    border: none;
    color: #6b7280;
    font-size: 0.78rem;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
    padding: 4px;
    outline: none;
    text-align: center;
}
.btn-text-only:hover {
    color: #9ca3af;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Compact Header Bar === */
.compact-header-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 99px;
    max-width: 420px;
    margin: 0 auto;
    font-size: 0.8rem;
    color: #e5e7eb;
}

.compact-mode-title {
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: var(--color-accent);
}

.compact-date {
    font-weight: 700;
    color: #9ca3af;
}

.compact-divider {
    color: var(--color-border);
    user-select: none;
}

.compact-timer {
    font-family: var(--font-pixel);
    font-size: 0.65rem;
    color: var(--color-gold);
}

.daily-playing .daily-header {
    margin-bottom: 0.75rem;
}

/* === Compact Hints === */
.hint-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 0.75rem;
}

.hint-label-compact {
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
    letter-spacing: 0.05em;
}

.hint-icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--color-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.hint-icon-btn:hover:not(:disabled) {
    border-color: var(--color-accent);
    background: rgba(99, 102, 241, 0.1);
}

.hint-icon-btn.used {
    border-color: var(--color-accent);
    background: rgba(99, 102, 241, 0.2);
    box-shadow: 0 0 10px var(--color-accent-glow);
}

.hint-icon-btn:disabled:not(.used) {
    opacity: 0.25;
    cursor: not-allowed;
}

.hint-content-compact {
    background: rgba(99, 102, 241, 0.05);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    padding: 0.6rem 0.9rem;
    margin: 0.75rem auto 0;
    max-width: 420px;
    text-align: left;
    font-size: 0.85rem;
    color: #e5e7eb;
}

.hint-compact-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 2px;
}

.hint-compact-body {
    line-height: 1.35;
}

.letter-reveal-font {
    font-family: monospace;
    font-size: 0.95rem;
    letter-spacing: 0.2em;
    font-weight: 700;
}

/* === CholloLocura Deals === */
.deals-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.deal-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.deal-card:hover {
    transform: translateY(-4px);
    border-color: var(--color-accent);
    box-shadow: 0 8px 25px var(--color-accent-glow);
}

.deal-image-wrapper {
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    padding: 1rem;
    position: relative;
}

.deal-image {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.deal-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--color-danger);
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.deal-badge.fallback-badge {
    background: var(--color-accent);
}

.deal-info {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.5rem;
}

.deal-title {
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.4;
    color: #e5e7eb;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.deal-prices {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: auto;
}

.deal-price-current {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-gold);
}

.deal-price-old {
    font-size: 0.9rem;
    color: #6b7280;
    text-decoration: line-through;
}

.deal-discount {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-success);
    margin-left: auto;
}

.deal-btn {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--color-accent);
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.5rem;
    border-radius: 6px;
    margin-top: 0.5rem;
    transition: opacity 0.2s;
}

.deal-btn:hover {
    opacity: 0.9;
}

/* === Watermark Hint Tiles === */
.letter-tile.watermark {
    background: rgba(245, 158, 11, 0.05) !important;
    border: 2px dashed rgba(245, 158, 11, 0.5) !important;
    color: rgba(251, 191, 36, 0.55) !important;
    font-weight: 800;
}

/* === Revealing Image (Snake & Inside-out Modes) === */
.revealing-image-container {
    position: relative;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--color-border);
    box-shadow: 0 0 40px var(--color-accent-glow);
    background: #0b0b0f;
}
.revealing-image-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    transition: filter 0.5s ease;
    image-rendering: pixelated;
}
.revealing-image-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-rows: repeat(15, 1fr);
    grid-template-columns: repeat(15, 1fr);
    pointer-events: none;
}
.revealing-image-cell {
    background-color: var(--color-bg);
    opacity: 1;
    transition: opacity 0.3s ease-out;
}
.revealing-image-cell.revealed {
    opacity: 0;
}

@media (max-width: 520px) {
    .revealing-image-container {
        max-width: 100vw;
        width: 100vw;
        margin-left: calc(50% - 50vw);
        margin-right: calc(50% - 50vw);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}

/* ---- Party host: bigger clue + fit the stage to the viewport (no scroll) ---- */
.party-host-clue {
    text-align: center;
    font-style: italic;
    font-weight: 600;
    font-size: 1.15rem;
    line-height: 1.4;
    letter-spacing: 0.01em;
    color: #e5e7eb;
    margin: 0 auto 0.8rem;
    max-width: 90%;
}

/* Keep the whole host "Playing" stage within one screen: cap the cover so the
   round header, clue, timer and letter-mask all fit without scrolling. */
.party-host-stage .revealing-image-container {
    max-height: 46vh;
}
.party-host-stage .revealing-image-img {
    max-height: 46vh;
}

@media (min-width: 900px) {
    /* On the big shared screen, give the cover more room but still bounded. */
    .party-host-stage .revealing-image-container,
    .party-host-stage .revealing-image-img {
        max-height: 52vh;
    }
}

/* ---- Party guest (phone): roomier keyboard + tighter card chrome ---- */
@media (max-width: 540px) {
    .party-guest-card {
        padding: 1rem 0.5rem !important;
    }
    .party-guest-card .virtual-keyboard {
        max-width: 100%;
        padding: 0 2px;
        margin-top: 0.9rem;
        gap: 7px;
    }
    .party-guest-card .keyboard-row {
        gap: 5px;
    }
    .party-guest-card .keyboard-key {
        height: 52px;
        font-size: 1.1rem;
    }
    .party-guest-card .keyboard-key.action-key {
        font-size: 0.72rem;
    }
}

/* ---- Party end-of-match podium (Kahoot-style) ---- */
.podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 0.75rem;
    max-width: 560px;
    margin: 0 auto 2.5rem;
    min-height: 280px;
}

.podium-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 0;
    max-width: 160px;
}

.podium-medal {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.3rem;
}

.podium-name {
    font-weight: 800;
    color: #fff;
    font-size: 1rem;
    word-break: break-word;
    text-align: center;
    margin-bottom: 0.2rem;
}

.podium-score {
    color: var(--color-gold);
    font-size: 0.7rem;
    margin-bottom: 0.5rem;
}

.podium-block {
    width: 100%;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 0.6rem;
    box-shadow: inset 0 0 24px rgba(255, 255, 255, 0.12);
    transform-origin: bottom;
    animation: podium-rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.podium-rank {
    font-family: var(--font-pixel);
    font-size: 1.4rem;
    color: rgba(0, 0, 0, 0.45);
}

/* Heights + medal colours by place */
.podium-gold .podium-block {
    height: 180px;
    background: linear-gradient(180deg, #fde047, var(--color-gold));
    animation-delay: 0.3s;
}
.podium-silver .podium-block {
    height: 130px;
    background: linear-gradient(180deg, #f1f5f9, #94a3b8);
    animation-delay: 0.1s;
}
.podium-bronze .podium-block {
    height: 95px;
    background: linear-gradient(180deg, #fbbf24, #b45309);
    animation-delay: 0.2s;
}
.podium-gold .podium-name { font-size: 1.15rem; }

@keyframes podium-rise {
    from { transform: scaleY(0); opacity: 0; }
    to   { transform: scaleY(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .podium-block { animation: none; }
}

@media (max-width: 600px) {
    .podium { min-height: 220px; gap: 0.4rem; }
    .podium-gold .podium-block { height: 140px; }
    .podium-silver .podium-block { height: 100px; }
    .podium-bronze .podium-block { height: 72px; }
    .podium-name { font-size: 0.85rem; }
    .podium-medal { font-size: 1.5rem; }
}


/* === Daily nav submenu (categories + search) === */
.nav-daily-wrap { position: relative; display: inline-block; }
.nav-daily-toggle {
    background: none; border: none; cursor: pointer; font: inherit;
    color: inherit; padding: 0;
}
.nav-daily-caret { font-size: 0.6rem; vertical-align: middle; }
.nav-daily-menu {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 60;
    min-width: 230px; background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 10px; padding: 0.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.45);
    display: flex; flex-direction: column; gap: 4px;
}
.nav-daily-search {
    width: 100%; box-sizing: border-box; background: var(--color-surface-2);
    border: 1px solid var(--color-border); border-radius: 8px; color: #e5e7eb;
    padding: 0.4rem 0.6rem; font-size: 0.82rem; margin-bottom: 0.25rem;
}
.nav-daily-search:focus { outline: none; border-color: var(--color-accent); }
.nav-daily-item {
    display: flex; align-items: center; gap: 0.5rem; padding: 0.45rem 0.6rem;
    border-radius: 8px; color: #e5e7eb; text-decoration: none; font-size: 0.85rem;
    transition: background 0.15s;
}
.nav-daily-item:hover { background: rgba(99,102,241,0.12); }
.nav-daily-empty { color: #6b7280; font-size: 0.78rem; text-align: center; margin: 0.4rem 0; }

/* === Post-game login/alias nudge === */
.login-nudge {
    background: var(--color-surface); border: 1px solid var(--color-accent);
    border-radius: 12px; padding: 1.1rem; text-align: center; margin-top: 1.25rem;
}
.login-nudge p { margin: 0; }
.login-nudge-title { font-weight: 700; margin-bottom: 0.35rem; }
.login-nudge-text { color: #9ca3af; font-size: 0.85rem; margin-bottom: 0.8rem !important; }
.login-nudge-sub { color: #6b7280; font-size: 0.72rem; margin-top: 0.6rem !important; }

/* === "Another challenge?" cross-category card === */
.next-daily-card {
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 12px; padding: 1rem; margin-top: 1.25rem;
}
.next-daily-title { font-weight: 700; text-align: center; margin: 0 0 0.75rem; }
.next-daily-link {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.65rem 0.8rem;
    border: 1px solid var(--color-border); border-radius: 10px; margin-bottom: 6px;
    color: #e5e7eb; text-decoration: none; transition: border-color 0.15s, background 0.15s;
}
.next-daily-link:hover { border-color: var(--color-accent); background: rgba(99,102,241,0.08); }
.next-daily-link.started { border-color: var(--color-gold); }
.next-daily-icon { font-size: 1.3rem; }
.next-daily-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.next-daily-name { font-weight: 600; font-size: 0.9rem; }
.next-daily-sub { color: #9ca3af; font-size: 0.74rem; }
.next-daily-go { color: var(--color-accent); font-weight: 700; }

/* === Modern home sections === */
.home-section { margin-bottom: 2.2rem; }
.home-section-head {
    display: flex; align-items: baseline; justify-content: space-between;
    border-bottom: 1px solid var(--color-border); padding-bottom: 0.45rem; margin-bottom: 1rem;
}
.home-section-title {
    font-size: 0.95rem; font-weight: 700; color: var(--color-accent);
    text-transform: uppercase; letter-spacing: 0.04em; margin: 0;
}
.home-section-more { font-size: 0.8rem; color: var(--color-accent); text-decoration: none; }
.home-section-more:hover { text-decoration: underline; }

/* === Daily hub (/daily) & Party hub (/party) === */
.daily-hub { max-width: 560px; margin: 1.5rem auto; }
.daily-hub-search {
    width: 100%; box-sizing: border-box; background: var(--color-surface-2);
    border: 1px solid var(--color-border); border-radius: 10px; color: #e5e7eb;
    padding: 0.65rem 0.9rem; font-size: 0.9rem; margin-bottom: 1rem;
}
.daily-hub-search:focus { outline: none; border-color: var(--color-accent); }
.daily-hub-list { display: flex; flex-direction: column; gap: 10px; }
.daily-hub-card {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.9rem 1rem;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 12px; color: #e5e7eb; text-decoration: none;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.daily-hub-card:hover { border-color: var(--color-accent); transform: translateY(-2px); }
.daily-hub-card-fav {
    border-color: rgba(234, 179, 8, 0.35);
    background: radial-gradient(circle at left, rgba(234, 179, 8, 0.02) 0%, var(--color-surface) 60%);
}
.daily-hub-card-fav:hover {
    border-color: var(--color-gold);
}
.daily-hub-card.played { opacity: 0.75; }
.daily-hub-icon { font-size: 1.7rem; }
.daily-hub-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.daily-hub-name { font-weight: 700; font-size: 0.95rem; }
.daily-hub-desc { color: #9ca3af; font-size: 0.78rem; }
.daily-hub-status { flex-shrink: 0; font-size: 0.74rem; font-weight: 700; }
.daily-hub-done { color: var(--color-success); }
.daily-hub-pending { color: var(--color-gold); }
.nav-daily-all { border-top: 1px solid var(--color-border); margin-top: 2px; padding-top: 0.55rem; color: var(--color-accent); }

/* ═══════════════════════════════════════════════════════════
   Collaborators / sponsors (post-Daily badge + /colaboradores)
   ═══════════════════════════════════════════════════════════ */
.collab-badge {
    margin-top: 1.25rem; padding: 1rem; text-align: center;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 12px;
}
.collab-badge-kicker {
    margin: 0 0 0.6rem; font-size: 0.75rem; font-weight: 700;
    letter-spacing: 0.08em; text-transform: uppercase; color: #9ca3af;
}
.collab-badge-card {
    display: flex; align-items: center; gap: 0.9rem; text-align: left;
    padding: 0.6rem 0.8rem; border-radius: 10px; text-decoration: none;
    color: #e5e7eb; transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
}
.collab-badge-card:hover { background: var(--color-surface-2); border-color: var(--color-accent); }
.collab-badge-logo { width: 84px; height: auto; flex-shrink: 0; }
.collab-badge-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.collab-badge-name { font-weight: 700; font-size: 0.95rem; }
.collab-badge-tagline { font-size: 0.78rem; color: #9ca3af; }
.collab-badge-link { font-size: 0.78rem; color: var(--color-accent); font-weight: 600; }
.collab-badge-all {
    display: inline-block; margin-top: 0.5rem; font-size: 0.75rem;
    color: #9ca3af; text-decoration: none;
}
.collab-badge-all:hover { color: var(--color-accent); }

.collab-page { max-width: 700px; margin: 2rem auto; padding: 0 1rem; }
.collab-card {
    display: flex; align-items: center; gap: 1.2rem; padding: 1.2rem;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: 14px; margin-bottom: 1rem;
}
.collab-card-logo { width: 140px; height: auto; flex-shrink: 0; }
.collab-card-body { min-width: 0; }
.collab-card-name { margin: 0 0 0.3rem; font-size: 1.05rem; color: #e5e7eb; }
.collab-card-tagline { margin: 0 0 0.5rem; font-size: 0.85rem; color: #9ca3af; }
.collab-card-cats { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.collab-card-cat {
    font-size: 0.75rem; padding: 0.25rem 0.6rem; border-radius: 99px;
    background: var(--color-surface-2); border: 1px solid var(--color-border);
    color: #e5e7eb; text-decoration: none;
}
.collab-card-cat:hover { border-color: var(--color-accent); }
@media (max-width: 480px) {
    .collab-card { flex-direction: column; text-align: center; }
    .collab-card-cats { justify-content: center; }
}

.collab-home-strip { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; }
.collab-home-card {
    display: flex; flex-direction: column; align-items: center; gap: 0.4rem;
    padding: 0.8rem 1.2rem; background: var(--color-surface);
    border: 1px solid var(--color-border); border-radius: 12px;
    color: #e5e7eb; text-decoration: none; font-size: 0.8rem; font-weight: 600;
    transition: border-color 0.15s, transform 0.15s;
}
.collab-home-card:hover { border-color: var(--color-accent); transform: translateY(-2px); }
.collab-home-card img { width: 110px; height: auto; }

/* Pixel Editor Styles */
.editor-modal-wrapper .modal-panel {
    max-width: 750px !important;
    width: 95% !important;
}

.editor-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.editor-sliders-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}

@media (min-width: 640px) {
    .editor-sliders-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.pixelated-editor-canvas {
    image-rendering: pixelated;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.editor-sliders-grid input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--color-surface-2);
    outline: none;
    transition: background 0.2s;
}

.editor-sliders-grid input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--color-accent);
    transition: transform 0.1s;
}

.editor-sliders-grid input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.editor-sliders-grid input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--color-accent);
    cursor: pointer;
    box-shadow: 0 0 8px var(--color-accent);
    border: none;
    transition: transform 0.1s;
}

.editor-sliders-grid input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.15);
}

/* === Responsive horizontal scroll for categories/groups on mobile === */
@media (max-width: 767px) {
    .category-scroll-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        scroll-snap-type: x mandatory;
        padding: 0.5rem 0.25rem 1rem 0.25rem;
        gap: 1rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .category-scroll-grid::-webkit-scrollbar {
        display: none; /* Chrome/Safari/Webkit */
    }
    .category-scroll-grid .mode-card {
        flex: 0 0 78% !important; /* Make sure the next card is partially visible (22%) */
        scroll-snap-align: start;
        box-sizing: border-box;
        margin: 0;
    }
    .category-scroll-grid .explore-more-card {
        flex: 0 0 60% !important;
        scroll-snap-align: start;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        text-align: center;
        background: rgba(99, 102, 241, 0.15) !important;
        border: 2px dashed var(--color-accent) !important;
    }
}
