/* ══════════════════════════════════════════
   Semanticesc — Refonte DA + Audit UX/UI
   Style : flat cartoon / Costanza Prinetti
   ══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Serif+Display&family=Playfair+Display:ital,wght@0,700;1,700&family=Space+Mono:wght@400;700&display=swap');

:root {
    /* Palette */
    --bg: #FFFDF5;
    --accent: #E8453C;
    --accent-hover: #d13a32;
    --accent-glow: rgba(232, 69, 60, 0.15);
    --accent-secondary: #F5A623;
    --success: #2ECC71;
    --text: #1A1A2E;
    --text-secondary: #4a4a5e;
    --text-muted: #8a8a9e;
    --surface: #FFFFFF;
    --surface-warm: #F5F0E0;
    --border: #e0dbd2;
    --cold: #A8C5DA;
    --warm: #F5A623;
    --hot: #FF8C00;
    --burning: #E8453C;

    /* Spacing system */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-xxl: 64px;

    /* Sizing */
    --max-width: 780px;
    --radius: 12px;
    --radius-sm: 8px;

    /* Shadows */
    --shadow-card: 0 2px 12px rgba(26, 26, 46, 0.06);
    --shadow-hover: 0 4px 20px rgba(26, 26, 46, 0.1);
    --shadow-focus: 0 0 0 3px rgba(232, 69, 60, 0.12);

    /* Typography scale */
    --font-hero: 2.5rem;
    --font-h1: 1.6rem;
    --font-h2: 1.3rem;
    --font-h3: 1rem;
    --font-body: 0.95rem;
    --font-small: 0.85rem;
    --font-xs: 0.75rem;
}

[data-theme="dark"] {
    --bg: #1a1a2e;
    --text: #e8e8e8;
    --text-secondary: #b0b0c0;
    --text-muted: #6a6a7a;
    --surface: #222240;
    --surface-warm: #2a2a4a;
    --border: #3a3a5a;
    --accent-glow: rgba(232, 69, 60, 0.25);
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-focus: 0 0 0 3px rgba(232, 69, 60, 0.3);
}


body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    transition: background 0.3s, color 0.3s;
    font-size: var(--font-body);
    line-height: 1.5;
}

/* ══════════════════════════════════════════
   HEADER
   ══════════════════════════════════════════ */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-lg);
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    gap: var(--space-sm);
    box-shadow: var(--shadow-card);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-left {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-width: 44px;
}

.header-center {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.logo {
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-weight: 700;
    font-size: var(--font-h1);
    color: var(--accent);
    letter-spacing: -0.5px;
}

.logo-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-xs);
    color: var(--text-muted);
    font-weight: 400;
    display: none;
}

@media (min-width: 600px) {
    .logo-tagline { display: block; }
}

.logo-mascot {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

/* Sidebar toggle */
.sidebar-toggle svg {
    width: 20px;
    height: 20px;
}

/* ── Sidebar ── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    transition: opacity 0.3s;
}
.sidebar-overlay.hidden {
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--surface);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
    z-index: 100;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border);
}
.sidebar-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: var(--font-h3);
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.sidebar-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
    padding: 0;
}
.sidebar-close:hover {
    color: var(--accent);
}

.sidebar-nav {
    list-style: none;
    padding: var(--space-md) 0;
}
.sidebar-nav li {
    padding: 0 var(--space-md);
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    padding: var(--space-md) var(--space-lg);
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}
.sidebar-item:hover {
    background: rgba(232, 69, 60, 0.06);
    color: var(--accent);
}
.sidebar-item.active {
    background: rgba(232, 69, 60, 0.1);
    color: var(--accent);
    font-weight: 600;
}
.sidebar-item svg {
    flex-shrink: 0;
}

/* Sidebar footer — player name change */
.sidebar-footer {
    margin-top: auto;
    padding: var(--space-md) var(--space-lg);
    border-top: 1px solid var(--border);
}
.sidebar-player-info {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-small);
    color: var(--text-secondary);
    flex-wrap: wrap;
}
.sidebar-player-info strong {
    color: var(--text);
}
.sidebar-player-info .sidebar-rename-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-xs);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
}
.sidebar-player-info .sidebar-rename-btn:hover {
    color: var(--accent);
}
.sidebar-rename-input {
    flex: 1;
    min-width: 120px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: var(--font-small);
    font-family: 'DM Sans', sans-serif;
}

.header-right {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Icon buttons — min 44px touch target */
.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: var(--text);
    position: relative;
}

.icon-btn:hover {
    border-color: var(--accent);
    background: rgba(232, 69, 60, 0.05);
    transform: scale(1.05);
}

.icon-btn svg {
    width: 18px;
    height: 18px;
}

/* ── Player identity bar ── */
.player-name-bar {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xs) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-small);
    color: var(--text-muted);
}

.player-name-bar.hidden { display: none; }

.player-greeting strong {
    color: var(--text);
    font-weight: 600;
}

.player-change-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-xs);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
}

.player-change-btn:hover { color: var(--accent); }

.player-rename-input {
    flex: 1;
    max-width: 200px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: var(--font-small);
    font-family: 'DM Sans', sans-serif;
}

.player-rename-ok, .player-rename-cancel {
    font-size: var(--font-xs) !important;
    padding: 4px 10px !important;
}

/* ══════════════════════════════════════════
   SECTIONS
   ══════════════════════════════════════════ */
.section {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

.section.hidden {
    display: none;
}

/* ══════════════════════════════════════════
   OVERLAY
   ══════════════════════════════════════════ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(26, 26, 46, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(6px);
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: var(--surface);
    border-radius: 16px;
    padding: var(--space-xl);
    max-width: 450px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(26, 26, 46, 0.2);
    border: 2px solid var(--border);
}

.overlay-content h2 {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text);
    font-size: var(--font-h2);
}

.overlay-content p {
    margin-bottom: var(--space-md);
    color: var(--text-secondary);
}

.overlay-content ul {
    text-align: left;
    margin: var(--space-md) 0;
    padding-left: var(--space-lg);
}

.overlay-content li {
    margin: var(--space-sm) 0;
    color: var(--text-secondary);
    line-height: 1.5;
}

.overlay-content input {
    width: 100%;
    padding: 14px var(--space-md);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    margin-bottom: var(--space-md);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.overlay-content input:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* ══════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════ */
.btn {
    padding: var(--space-md) var(--space-lg);
    border: none;
    border-radius: var(--radius);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.btn-primary {
    background: var(--accent);
    color: white;
    box-shadow: 0 2px 8px rgba(232, 69, 60, 0.25);
    min-height: 52px;
    padding: var(--space-md) 32px;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 20px rgba(232, 69, 60, 0.3);
}

.btn-primary:active {
    transform: scale(0.97);
    box-shadow: 0 1px 4px rgba(232, 69, 60, 0.2);
}

/* Loading spinner state */
.btn-primary.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

}

.btn-secondary {
    background: var(--surface-warm);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--accent);
    background: var(--surface);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    opacity: 0.9;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* ══════════════════════════════════════════
   GAME ZONE
   ══════════════════════════════════════════ */
.game-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Mode badge */
/* Guess count in stats bar */
.stat-guess-count {
    font-weight: 700;
    color: var(--text);
}

/* ══════════════════════════════════════════
   EMPTY STATE — Before first guess
   ══════════════════════════════════════════ */
.empty-state {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
}

.empty-state-mascot {
    width: 100px;
    height: 120px;
    margin: 0 auto var(--space-lg);
    animation: float 3s ease-in-out infinite;
}

.empty-state-title {
    font-family: 'DM Sans', sans-serif;
    font-weight: 700;
    font-size: var(--font-h2);
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.empty-state-subtitle {
    color: var(--text-muted);
    font-size: var(--font-body);
    margin-bottom: var(--space-md);
}

.empty-state-hint {
    display: inline-block;
    background: var(--surface-warm);
    color: var(--accent);
    font-size: var(--font-small);
    font-weight: 600;
    padding: var(--space-xs) var(--space-md);
    border-radius: 20px;
    border: 1px dashed var(--accent);
    opacity: 0.8;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
}

/* ── Input area ── */
.input-area {
    display: flex;
    gap: var(--space-sm);
    align-items: stretch;
    position: relative;
}

.input-area input {
    flex: 1;
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 2px solid var(--text);
    background: var(--surface);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 1.1rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.input-area input::placeholder {
    font-style: italic;
    color: var(--text-muted);
    transition: opacity 0.3s;
}

.input-area input:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
    transform: scale(1.01);
}

/* Green glow when score > 80 */
.input-area input.glow-hot {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(46, 204, 113, 0.2), 0 0 20px rgba(46, 204, 113, 0.1);
}

.input-area .btn {
    white-space: nowrap;
}

/* ── Diacritics bar — compact pills ── */
.diacritics-bar {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 6px;
    margin-bottom: 0;
}

.diac-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1.5px solid var(--border);
    border-radius: 99px;
    background: var(--surface);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 80ms ease;
    box-shadow: 0 1px 0 var(--border);
    position: relative;
    top: 0;
}

.diac-btn:hover {
    background: var(--text);
    color: var(--bg);
    border-color: var(--text);
    top: 0;
    box-shadow: 0 1px 0 var(--border);
}

.diac-btn:active {
    transform: translateY(1px);
    box-shadow: none;
}


/* ══════════════════════════════════════════
   RESULT CARD — Last guess
   ══════════════════════════════════════════ */
.card-dernier-cuvant {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-md) var(--space-lg);
    margin-top: var(--space-sm);
    text-align: center;
    animation: fadeIn 0.2s ease-out;
}

.card-dernier-mot {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: var(--space-sm);
}

.card-dernier-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-xs);
}

.card-dernier-nr {
    font-family: 'Space Mono', monospace;
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
}

.card-dernier-feedback {
    font-size: var(--font-small);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.card-dernier-rang {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.card-dernier-bara {
    height: 6px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    margin-top: var(--space-sm);
}

.card-dernier-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 600ms ease;
}

/* ══════════════════════════════════════════
   VICTORY — Magazine Cover Style
   ══════════════════════════════════════════ */
.victory-card {
    background: var(--surface);
    border-radius: 16px;
    padding: var(--space-xl) 32px;
    text-align: center;
    color: var(--text);
    box-shadow: 0 8px 40px rgba(232, 69, 60, 0.15);
    border: 3px solid var(--accent);
    animation: pulse 0.5s ease-out;
    position: relative;
    overflow: hidden;
}

.victory-card.hidden {
    display: none;
}

.victory-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(232, 69, 60, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.victory-mascot {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--space-md);
}

.victory-card h2 {
    font-family: 'Playfair Display', serif;
    font-size: var(--font-hero);
    color: var(--accent);
    margin-bottom: var(--space-sm);
    position: relative;
}

.victory-card p {
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
    color: var(--text-secondary);
}

/* ── Share buttons ── */
.share-buttons {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-sm);
    margin: var(--space-lg) 0 var(--space-sm);
}

.share-btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-small);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.share-btn-social:hover {
    border-color: var(--accent);
    background: rgba(232, 69, 60, 0.05);
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.share-btn-social:active {
    transform: translateY(0);
}

.share-btn-social svg {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .share-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    .share-btn-social {
        padding: var(--space-sm);
        font-size: 0.8rem;
    }
}

/* ── Error ── */
.error-msg {
    background: rgba(232, 69, 60, 0.08);
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    padding: var(--space-md);
    text-align: center;
    color: var(--accent);
    font-size: var(--font-small);
    font-weight: 500;
}

.error-msg.hidden {
    display: none;
}

/* Suggestion banner */
.suggestion-banner {
    background: rgba(245, 166, 35, 0.1);
    border: 2px solid var(--accent-secondary);
    border-radius: var(--radius);
    padding: var(--space-md);
    text-align: center;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    animation: slideDown 0.3s ease-out;
}

.suggestion-banner.hidden {
    display: none;
}

.suggestion-text {
    font-size: var(--font-body);
    color: var(--text);
}

.suggestion-text strong {
    color: var(--accent-secondary);
    font-family: 'Space Mono', monospace;
}

.suggestion-accept {
    font-size: var(--font-small) !important;
    padding: var(--space-xs) var(--space-md) !important;
}

.suggestion-dismiss {
    font-size: var(--font-small) !important;
    padding: var(--space-xs) var(--space-sm) !important;
    background: transparent !important;
    border: 1px solid var(--border) !important;
    color: var(--text-muted) !important;
}

    to { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════
   DAILY STATS BAR
   ══════════════════════════════════════════ */
.daily-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    font-size: var(--font-small);
    color: var(--text-secondary);
    padding: var(--space-sm) var(--space-md);
    background: var(--surface-warm);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.daily-stats .stat-icon {
    display: inline-flex;
    vertical-align: middle;
    margin-right: var(--space-xs);
}

.daily-stats .stat-icon svg {
    width: 16px;
    height: 16px;
}

.stats-sep {
    color: var(--border);
    font-weight: 700;
}

/* ══════════════════════════════════════════
   GUESS HISTORY — Card rows with left border
   ══════════════════════════════════════════ */
.history-container {
    margin-top: var(--space-xs);
}

/* Hidden until first guess */
.history-container.is-empty {
    display: none;
}

/* Header bar: count + sort label */
.esais-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-sm);
}
.esais-count {
    font-size: 12px;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
}
.esais-sort-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    font-family: 'DM Sans', sans-serif;
}

.history-header {
    display: grid;
    grid-template-columns: 36px 1fr 60px 28px minmax(0, 160px);
    gap: var(--space-sm);
    padding: 6px 14px;
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 6px;
}

.hh-order { text-align: center; }
.hh-score { text-align: right; }
.hh-thermo { text-align: center; }
.hh-permille { text-align: left; }

.history-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-height: 480px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    padding: var(--space-lg);
    font-style: italic;
}

/* Each guess row */
.history-item {
    display: grid;
    grid-template-columns: 36px 1fr 60px 28px minmax(0, 160px);
    gap: var(--space-sm);
    align-items: center;
    padding: var(--space-sm) 14px;
    background: var(--surface);
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--border);
    box-shadow: var(--shadow-card);
    font-size: var(--font-body);
    min-height: 48px;
    transition: background 200ms, box-shadow 200ms;
}

.history-item:hover {
    box-shadow: var(--shadow-hover);
    background: color-mix(in srgb, var(--surface) 95%, var(--accent));
}


/* Border-left color set dynamically via inline style */

.history-item .order {
    width: 28px;
    height: 28px;
    background: var(--text);
    color: var(--bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: var(--font-xs);
    font-weight: 700;
    flex-shrink: 0;
}

.history-item .word-col {
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

.history-item .word {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}

.history-item .score-col {
    text-align: right;
    white-space: nowrap;
}

.history-item .score {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: var(--font-body);
    color: var(--text);
}

.history-item .thermo-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item .thermo-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    vertical-align: middle;
}

.history-item .thermo-icon svg {
    width: 20px;
    height: 20px;
}

.history-item .emoji-inline {
    display: none;
}

/* Permille column with temperature bar */
.history-item .permille-col {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.history-item .permille-val {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    font-size: var(--font-xs);
    min-width: 28px;
    text-align: right;
    color: var(--text-secondary);
}

.history-item .heat-bar {
    display: block;
    flex: 1;
    height: 8px;
    background: var(--surface-warm);
    border-radius: 4px;
    overflow: hidden;
    min-width: 40px;
}

.history-item .heat-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(to right, #F5C623, #E67E22, #E8453C);
    transition: width 0.6s ease-out;
}

/* Temperature / proximity bar */
.temperatura-bar {
    width: 52px;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    flex-shrink: 0;
}
.temperatura-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 500ms ease;
}

/* Last guess highlight — subtle tinted background */
.history-item.esai-dernier {
    background: rgba(0, 0, 0, 0.03);
}
[data-theme="dark"] .history-item.esai-dernier {
    background: rgba(255, 255, 255, 0.04);
}

/* Score colors */
.score-freezing { color: #E8C34A !important; }
.score-cold { color: #D4A429 !important; }
.score-cool { color: var(--success) !important; }
.score-warm { color: var(--warm) !important; }
.score-hot { color: var(--hot) !important; }
.score-found { color: var(--accent) !important; }

/* ══════════════════════════════════════════
   FEEDBACK CALD/RECE — under input
   ══════════════════════════════════════════ */
.feedback-zona {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    min-height: 28px;
    margin-top: var(--space-xs);
    padding: 0 var(--space-sm);
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 250ms ease, transform 250ms ease;
}
.feedback-zona.feedback-visible {
    opacity: 1;
    transform: translateY(0);
}

.feedback-principal {
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.feedback-progresie {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--text-secondary);
}

.feedback-principal.fierbinte   { color: #C0392B; }
.feedback-principal.foarte-cald { color: #E8453C; }
.feedback-principal.cald        { color: #E67E22; }
.feedback-principal.mai-cald    { color: #F5A623; }
.feedback-principal.rece        { color: #D4A429; }
.feedback-principal.foarte-rece { color: #C4943A; }
.feedback-principal.inghetat   { color: #D4722A; }
.feedback-principal.polar      { color: #B04A18; }

.feedback-progresie.incalzire { color: #E67E22; }
.feedback-progresie.neutru    { color: var(--text-secondary); }
.feedback-progresie.racire    { color: #5B9BD5; }

/* Top 1000 wrapper in history rows */
.top1000-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}
.top1000-label {
    font-family: 'Space Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    min-width: 36px;
    text-align: right;
}

@media (max-width: 480px) {
    .top1000-label { display: none; }
}

/* ══════════════════════════════════════════
   YESTERDAY PAGE
   ══════════════════════════════════════════ */
.yesterday-page {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-xl);
}

.yesterday-mode-block {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-lg);
    box-shadow: var(--shadow-card);
}

.yesterday-mode-block h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-h2);
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.yesterday-hero {
    text-align: center;
    margin-bottom: var(--space-lg);
}

.yesterday-hero-word {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.yesterday-hero-stats {
    font-size: var(--font-small);
    color: var(--text-muted);
    margin-top: var(--space-xs);
}

.yesterday-podiums {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

@media (max-width: 600px) {
    .yesterday-podiums {
        grid-template-columns: 1fr;
    }
}

.yesterday-podium h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-small);
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.podium-list {
    font-size: var(--font-small);
}

.podium-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
}

.podium-row:nth-child(1) { background: rgba(255, 215, 0, 0.08); }
.podium-row:nth-child(2) { background: rgba(192, 192, 192, 0.08); }
.podium-row:nth-child(3) { background: rgba(205, 127, 50, 0.08); }

.podium-medal {
    font-size: 1.2rem;
    width: 28px;
    text-align: center;
}

.podium-name {
    flex: 1;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.podium-detail {
    font-family: 'Space Mono', monospace;
    font-size: var(--font-xs);
    color: var(--text-muted);
}

.podium-score {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: var(--accent);
}

.yesterday-top100-details {
    margin-top: var(--space-sm);
}

.yesterday-top100-details summary {
    cursor: pointer;
    font-size: var(--font-small);
    font-weight: 600;
    color: var(--text-secondary);
    padding: var(--space-sm) 0;
}

.yesterday-top100-details .top100-list {
    max-height: 400px;
    overflow-y: auto;
}

.yesterday-word {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: var(--space-xs);
}

.yesterday-stats {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ── Top 100 ── */
.top100-details {
    margin-top: var(--space-md);
    text-align: left;
}

.top100-details summary {
    cursor: pointer;
    font-size: var(--font-body);
    padding: var(--space-sm) 0;
    font-weight: 600;
    color: var(--text-secondary);
}

.top100-list {
    max-height: 300px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2px;
    font-size: 0.8rem;
    margin-top: var(--space-sm);
}

.top100-item {
    display: flex;
    justify-content: space-between;
    padding: var(--space-xs) var(--space-sm);
    border-radius: 4px;
    background: var(--surface-warm);
}

.top100-item .t100-rank {
    color: var(--text-muted);
    min-width: 28px;
    font-family: 'Space Mono', monospace;
    font-size: var(--font-xs);
}

.top100-item .t100-word {
    flex: 1;
    font-weight: 500;
}

.top100-item .t100-score {
    color: var(--text-secondary);
    font-family: 'Space Mono', monospace;
    font-size: var(--font-xs);
}

/* ══════════════════════════════════════════
   TEAM SECTION — Improved form & invite
   ══════════════════════════════════════════ */
.team-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.team-container h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-h2);
    font-weight: 700;
}

.team-container > div > p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.team-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
}

@media (max-width: 600px) {
    .team-actions {
        grid-template-columns: 1fr;
    }
}

.team-create, .team-join {
    background: var(--surface);
    padding: var(--space-lg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
}

.team-create h3, .team-join h3 {
    font-family: 'DM Sans', sans-serif;
    margin-bottom: var(--space-md);
    color: var(--text);
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.team-create input, .team-join input {
    width: 100%;
    padding: 14px var(--space-md);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: 1rem;
    margin-bottom: var(--space-md);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 48px;
}

.team-create input:focus, .team-join input:focus {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* Team invitation — improved code display */
.team-invite {
    margin: var(--space-lg) 0;
}

.invite-code-card {
    background: var(--surface-warm);
    border-radius: var(--radius);
    padding: var(--space-lg);
    text-align: center;
    border: 2px dashed var(--accent);
    margin-bottom: var(--space-md);
}

.invite-code-label {
    font-size: var(--font-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: var(--space-sm);
    font-weight: 600;
}

.invite-code-value {
    font-family: 'Space Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 8px;
    color: var(--accent);
    margin-bottom: var(--space-md);
    user-select: all;
    cursor: pointer;
}

.invite-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--font-small);
    min-height: 44px;
}

/* Feedback after copy */
.invite-copy-btn.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.invite-share-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
}

.invite-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-md) var(--space-sm);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: var(--font-xs);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.invite-btn:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.invite-btn-sms {
    display: none;
}

@media (max-width: 768px) {
    .invite-btn-sms { display: flex; }
}

@media (max-width: 480px) {
    .invite-share-btns { grid-template-columns: repeat(2, 1fr); }
    .invite-code-value { font-size: 2rem; letter-spacing: 6px; }
}

#team-info h2 {
    font-family: 'Playfair Display', serif;
    font-size: var(--font-h1);
    font-weight: 700;
    margin-bottom: var(--space-sm);
}

#team-info h3 {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin: var(--space-lg) 0 var(--space-sm);
}

#team-info ul {
    list-style: none;
    padding: 0;
}

#team-info li {
    padding: var(--space-sm) var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-xs);
    border: 1px solid var(--border);
}

/* ══════════════════════════════════════════
   LEADERBOARD
   ══════════════════════════════════════════ */
.leaderboard-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.leaderboard-container h2 {
    font-family: 'DM Sans', sans-serif;
    text-align: center;
    font-size: var(--font-h2);
    font-weight: 700;
}

.leaderboard-tabs, .leaderboard-period {
    display: flex;
    gap: var(--space-xs);
    justify-content: center;
}

.lb-tab, .period-btn {
    padding: var(--space-sm) var(--space-md);
    border: 2px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: var(--font-small);
    font-weight: 500;
    transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-tab:hover, .period-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.lb-tab.active {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

[data-theme="dark"] .lb-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.period-btn.active {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
    color: var(--text);
    font-weight: 600;
}

.leaderboard-table {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.lb-row {
    display: grid;
    grid-template-columns: 40px 1fr 70px 55px 55px;
    gap: var(--space-md);
    align-items: center;
    padding: 14px var(--space-md);
    background: var(--surface);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-card);
}

.lb-row.podium-1 { border-left: 4px solid #FFD700; background: rgba(255, 215, 0, 0.05); }
.lb-row.podium-2 { border-left: 4px solid #C0C0C0; background: rgba(192, 192, 192, 0.05); }
.lb-row.podium-3 { border-left: 4px solid #CD7F32; background: rgba(205, 127, 50, 0.05); }

.lb-rank {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    text-align: center;
    font-size: 1.1rem;
}

.lb-row.podium-1 .lb-rank { color: #FFD700; }
.lb-row.podium-2 .lb-rank { color: #C0C0C0; }
.lb-row.podium-3 .lb-rank { color: #CD7F32; }

.lb-name { font-weight: 600; }
.lb-score { font-family: 'Space Mono', monospace; color: var(--text-secondary); }
.lb-guesses { font-family: 'Space Mono', monospace; font-size: 0.85rem; color: var(--text-secondary); }
.lb-time { font-family: 'Space Mono', monospace; font-size: 0.85rem; color: var(--text-secondary); }

/* 5-column layout for daily individual leaderboard */
.lb-header {
    display: grid;
    grid-template-columns: 40px 1fr 70px 55px 55px;
    gap: var(--space-md);
    padding: 6px var(--space-md);
    font-size: var(--font-xs);
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--border);
    margin-bottom: 6px;
}

.lb-header-5col, .lb-row-5col {
    grid-template-columns: 40px 1fr 70px 55px 55px;
}
.lb-header-4col, .lb-row-4col {
    grid-template-columns: 40px 1fr 80px 70px;
}
.lb-header-3col, .lb-row-3col {
    grid-template-columns: 40px 1fr auto;
}

/* ══════════════════════════════════════════
   ANIMATIONS
   ══════════════════════════════════════════ */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

    to { opacity: 1; }
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

@keyframes scoreReveal {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.score-reveal { animation: scoreReveal 0.4s ease-out; }

@keyframes mascotShake {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(-3px) rotate(-5deg); }
    75% { transform: translateX(3px) rotate(5deg); }
}

@keyframes mascotShiver {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

@keyframes mascotJump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes diacBounce {
    0% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0); }
}

.diac-bounce { animation: diacBounce 0.15s ease-out; }

.diac-pulse {
    animation: diacPulse 0.5s ease-in-out 3;
    box-shadow: 0 0 8px var(--accent-secondary);
}

@keyframes diacPulse {
    0%, 100% { transform: scale(1); background: var(--surface); }
    50% { transform: scale(1.15); background: rgba(245, 166, 35, 0.25); }
}

/* Confetti */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 200;
}

.confetti-piece {
    position: absolute;
    top: -10px;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
}

@keyframes confettiFall {
    0% { transform: translateY(0) rotate(0deg) scale(1); opacity: 1; }
    100% { transform: translateY(100vh) rotate(720deg) scale(0.5); opacity: 0; }
}

/* Shake input */
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.4s ease-out;
    border-color: var(--accent) !important;
}

/* New item highlight */
.new-item {
    animation: slideInLeft 0.2s ease-out, fadeIn 0.2s ease-out;
}

.result-animate { animation: slideInLeft 0.2s ease-out; }

/* Hourglass animation */
@keyframes hourglassRotate {
    0% { transform: rotate(0deg); }
    50% { transform: rotate(180deg); }
    100% { transform: rotate(360deg); }
}

.hourglass-animated svg { animation: hourglassRotate 3s ease-in-out infinite; }

/* Audio button */
.audio-btn.playing::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

.audio-tooltip {
    display: none;
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text);
    color: var(--bg);
    font-size: var(--font-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: 4px;
    white-space: nowrap;
}

.audio-btn:hover .audio-tooltip { display: block; }

/* Yesterday top100 */
.yesterday-top100 { margin-top: var(--space-md); }
.yesterday-top100 summary { cursor: pointer; font-size: var(--font-small); padding: 6px 0; font-weight: 600; color: var(--text-secondary); }
.yesterday-top100 .top100-list { max-height: 250px; }
.yesterday-top100 .top100-item { background: var(--surface-warm); }

/* Scrollbar */
.history-list::-webkit-scrollbar { width: 6px; }
.history-list::-webkit-scrollbar-track { background: transparent; }
.history-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ══════════════════════════════════════════
   DARK MODE — SVG mascotte fixes
   ══════════════════════════════════════════ */
[data-theme="dark"] .logo-mascot,
[data-theme="dark"] .mascot-container svg,
[data-theme="dark"] .empty-state-mascot,
[data-theme="dark"] .victory-mascot {
    filter: drop-shadow(0 0 2px rgba(255, 255, 255, 0.15));
}

/* Add white outline to mascot body parts in dark mode */
[data-theme="dark"] svg use[href*="mascot"] {
    filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.2));
}

/* ══════════════════════════════════════════
   AUTH MODAL
   ══════════════════════════════════════════ */
.modal-auth {
    max-width: 420px;
}
.modal-auth h2 {
    font-family: 'DM Sans', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--space-lg);
    text-align: center;
    color: var(--text);
}

.auth-optiuni {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.auth-opt {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    width: 100%;
    font-family: 'DM Sans', sans-serif;
}
.auth-opt:hover {
    border-color: var(--accent);
    background: rgba(232, 69, 60, 0.04);
    transform: translateY(-1px);
}
.auth-opt-icon { font-size: 28px; flex-shrink: 0; }
.auth-opt-text strong {
    display: block;
    font-size: var(--font-body);
    font-weight: 700;
    color: var(--text);
}
.auth-opt-text small {
    font-size: var(--font-xs);
    color: var(--text-muted);
}
.auth-opt-pin:hover   { border-color: #2E86AB; }
.auth-opt-liber:hover { border-color: #F5A623; }
.auth-opt-anonim:hover { border-color: #6B7280; }

.auth-back {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: var(--font-small);
    padding: 0;
    margin-bottom: var(--space-md);
    font-family: 'DM Sans', sans-serif;
}
.auth-back:hover { color: var(--accent); }

.auth-desc {
    font-size: var(--font-small);
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
    text-align: center;
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.form-group label {
    font-size: var(--font-small);
    font-weight: 600;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
}
.form-group input {
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 16px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s;
    font-family: 'DM Sans', sans-serif;
}
.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}
.pin-hint {
    font-size: 11px;
    color: #F5A623;
    font-weight: 500;
}
.auth-error {
    color: var(--accent);
    font-size: var(--font-small);
    font-weight: 600;
    text-align: center;
    padding: var(--space-sm);
    background: rgba(232, 69, 60, 0.08);
    border-radius: 6px;
}
.auth-submit {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

.auth-welcome {
    text-align: center;
    margin-bottom: var(--space-lg);
}
.welcome-icon { font-size: 48px; display: block; margin-bottom: var(--space-sm); }
.stats-rapide {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin: var(--space-md) 0;
    padding: var(--space-md);
    background: var(--surface-warm);
    border-radius: var(--radius);
}
.stat-item { text-align: center; }
.stat-val {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    font-family: 'Space Mono', monospace;
    color: var(--accent);
}
.stat-lbl {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.streak-item .stat-val { color: #FF6B35; }

.calendar-mini {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: var(--space-md) 0;
}
.cal-day {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    background: var(--surface-warm);
}
.cal-day.gasit   { background: rgba(46, 204, 113, 0.2); }
.cal-day.negasit { background: rgba(232, 69, 60, 0.15); }
.cal-day.nejocat { background: var(--surface-warm); opacity: 0.4; }

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Phone */
@media (max-width: 480px) {
    :root {
        --font-hero: 2rem;
        --font-h1: 1.4rem;
        --font-h2: 1.1rem;
    }

    .header {
        flex-wrap: wrap;
        gap: var(--space-sm);
        padding: var(--space-md) 14px;
    }

    .header-left {
        flex: 1;
        min-width: 0;
    }

    .header-right {
        flex-shrink: 0;
    }

    .tabs {
        width: 100%;
        order: 3;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        justify-content: center;
    }

    .tabs::-webkit-scrollbar { display: none; }

    .tab {
        font-size: 0.8rem;
        padding: 6px var(--space-md);
        flex-shrink: 0;
    }

    .input-area input { font-size: 16px; }

    .input-area {
        flex-direction: column;
    }

    .input-area .btn {
        width: 100%;
        padding: 14px var(--space-md);
    }

    .diacritics-bar { flex-wrap: wrap; }

    .diac-btn {
        min-width: 36px;
        height: 36px;
        font-size: 14px;
    }


    .history-item {
        grid-template-columns: 28px 1fr 50px 24px minmax(0, 90px);
        gap: var(--space-xs);
        padding: 10px var(--space-sm);
        min-height: 48px;
    }

    .history-item .order { width: 24px; height: 24px; font-size: 0.65rem; }
    .history-item .permille-val { font-size: 0.65rem; min-width: 22px; }
    .history-item .heat-bar { height: 8px; }
    .temperatura-bar { width: 36px; }

    .history-header {
        font-size: 0.6rem;
        padding: var(--space-xs) var(--space-sm);
        grid-template-columns: 28px 1fr 50px 24px minmax(0, 90px);
    }

    .esais-sort-label { font-size: 9px; letter-spacing: 1px; }


    .winners-header, .winner-row {
        grid-template-columns: 28px 1fr 55px 50px 50px;
        gap: var(--space-xs);
        font-size: 0.8rem;
    }

    .overlay-content { width: 95%; padding: var(--space-lg) var(--space-md); }
    .overlay-content input { font-size: 16px; }
    .victory-card { padding: var(--space-lg) var(--space-md); }
    .top100-list { grid-template-columns: 1fr; }
    .team-create input, .team-join input { font-size: 16px; }
    .defi-share-buttons { flex-direction: column; }
    .footer-share-buttons { gap: 6px; }
}

/* ══════════════════════════════════════════
   VICTORY OVERLAY — Wordle-style grid + new share
   ══════════════════════════════════════════ */
.victorie-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
    margin: var(--space-md) 0;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.victorie-grid .patrat {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    display: inline-block;
}

.btn-copie-rezultat {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-small);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: var(--space-sm) auto;
}

.btn-copie-rezultat:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

.btn-copie-rezultat.copied {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.share-label {
    font-size: var(--font-small);
    color: var(--text-muted);
    margin: var(--space-md) 0 var(--space-sm);
    text-align: center;
}

/* Share buttons row — victory (sober unified style) */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.share-btn-social {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: var(--font-small);
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.share-btn-social svg {
    color: var(--text-muted);
}

.share-btn-social:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.share-btn-social:hover svg {
    color: var(--accent);
}

.share-email { text-decoration: none; }

/* Challenge button */
.btn-defi {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-lg);
    border-radius: var(--radius);
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    font-family: 'DM Sans', sans-serif;
    font-size: var(--font-body);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: var(--space-sm) auto;
}

.btn-defi:hover {
    background: var(--accent);
    color: white;
}

/* Countdown label */
.countdown-label {
    font-size: var(--font-small);
    color: var(--text-muted);
    margin-top: var(--space-md);
    text-align: center;
}

.countdown-label .countdown {
    font-family: 'Space Mono', monospace;
    font-weight: 700;
    color: var(--text);
}

/* ══════════════════════════════════════════
   CHALLENGE OVERLAY
   ══════════════════════════════════════════ */
.overlay-defi {
    text-align: center;
}

.overlay-defi h3 {
    font-size: var(--font-h2);
    margin-bottom: var(--space-sm);
}

.overlay-close {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--surface-warm);
    color: var(--text);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.overlay-close:hover {
    background: var(--accent);
    color: white;
}

.defi-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--surface-warm);
    border-radius: var(--radius);
    margin: var(--space-md) 0;
    border: 1px solid var(--border);
}

.defi-link span {
    font-family: 'Space Mono', monospace;
    font-weight: 600;
    color: var(--accent);
}

.defi-text-preview {
    font-size: var(--font-small);
    color: var(--text-secondary);
    background: var(--surface-warm);
    border-radius: var(--radius-sm);
    padding: var(--space-md);
    margin: var(--space-md) 0;
    font-style: italic;
    line-height: 1.6;
    white-space: pre-line;
}

.defi-share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.share-btn-defi {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: var(--font-small);
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    min-height: 44px;
}

.share-btn-defi svg {
    color: var(--text-muted);
}

.share-btn-defi:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.share-btn-defi:hover svg {
    color: var(--accent);
}

/* ══════════════════════════════════════════
   FOOTER
   ══════════════════════════════════════════ */
/* ── Footer ── */
.site-footer {
    margin-top: var(--space-xxl);
    padding: var(--space-xl) var(--space-lg) var(--space-lg);
    border-top: 1px solid var(--border);
}

.footer-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-xl);
    margin-bottom: var(--space-xl);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--accent);
}

.footer-tagline {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: var(--text-muted);
}

.footer-desc {
    margin-top: var(--space-sm);
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.footer-section-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
}

.footer-joc-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: background 0.2s;
    margin-bottom: 4px;
}

.footer-joc-link:hover {
    background: var(--surface-warm);
}

.footer-joc-active {
    background: var(--surface-warm);
    font-weight: 600;
}

.footer-joc-emoji {
    font-size: 24px;
    line-height: 1;
}

.footer-joc-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.footer-joc-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

.footer-joc-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-badge-nou {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    background: var(--accent);
    color: #fff;
    vertical-align: middle;
    margin-left: 4px;
}

/* Share row */
.footer-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: var(--space-lg);
}

.footer-share-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}

.footer-share-buttons {
    display: flex;
    gap: var(--space-sm);
}

.footer-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--text-secondary);
    text-decoration: none;
    border: 2px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
    font-size: 0;
}

.footer-share-btn svg {
    color: var(--text-muted);
    transition: color 0.2s;
}

.footer-share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.footer-share-btn.share-wa:hover { border-color: #25D366; background: #25D366; }
.footer-share-btn.share-wa:hover svg { color: #fff; }
.footer-share-btn.share-tg:hover { border-color: #0088cc; background: #0088cc; }
.footer-share-btn.share-tg:hover svg { color: #fff; }
.footer-share-btn.share-fb:hover { border-color: #1877F2; background: #1877F2; }
.footer-share-btn.share-fb:hover svg { color: #fff; }
.footer-share-btn.share-copy:hover { border-color: var(--accent); color: var(--accent); }
.footer-share-btn.share-copy:hover svg { color: var(--accent); stroke: var(--accent); }

.footer-share-btn.copied {
    border-color: var(--success);
    background: var(--success);
}
.footer-share-btn.copied svg { color: #fff; stroke: #fff; }

/* Bottom */
.footer-bottom {
    text-align: center;
}

.footer-inspiration {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.footer-inspiration a {
    color: var(--accent);
    text-decoration: none;
}

.footer-inspiration a:hover {
    text-decoration: underline;
}

.footer-copy {
    font-size: 12px;
    color: var(--text-muted);
}

.footer-copy a {
    color: var(--text-muted);
    text-decoration: underline;
}

/* Footer mobile */
@media (max-width: 540px) {
    .footer-top {
        grid-template-columns: 1fr;
        gap: var(--space-lg);
    }
    .footer-share {
        flex-direction: column;
        gap: var(--space-sm);
    }
}
