@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
    --app-font-sans: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-family: var(--app-font-sans);
    font-size: 80%;
    --bs-font-sans-serif: var(--app-font-sans);
    --bs-body-font-family: var(--app-font-sans);

    /* Light Mode Variables */
    --bg-body-start: #f9fafb;
    --bg-body-end: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-surface-secondary: #f9fafb;
    --bg-surface-tertiary: #f3f4f6;
    --text-primary: #1f2933;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #d1d5db;
    --border-color-light: #e5e7eb;
    --primary-color: #0f172a;
    --primary-text-inverse: #f8fafc;
    --accent-color: #2563eb;
    --shadow-color: rgba(15, 23, 42, 0.15);
    --input-bg: #ffffff;
    --keyboard-key-bg: #e2e8f0;
    --keyboard-key-text: #1e293b;
    --keyboard-key-active-bg: #cbd5e1;
    --bg-active: #e0e7ff;
    --border-active: #a5b4fc;
}

body.dark-mode {
    /* Dark Mode Variables */
    --bg-body-start: #0f172a;
    --bg-body-end: #1e293b;
    --bg-surface: #1e293b;
    --bg-surface-secondary: #334155;
    --bg-surface-tertiary: #0f172a;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --border-color: #334155;
    --border-color-light: #475569;
    --primary-color: #f8fafc;
    --primary-text-inverse: #0f172a;
    --accent-color: #60a5fa;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --input-bg: #1e293b;
    --keyboard-key-bg: #334155;
    --keyboard-key-text: #f1f5f9;
    --keyboard-key-active-bg: #475569;
    --bg-active: #1e3a8a;
    --border-active: #3b82f6;
}

body,
input,
button,
select,
textarea {
    font-family: var(--app-font-sans);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body.bg-night {
    min-height: 100vh;
    margin: 0;
    background: linear-gradient(135deg, var(--bg-body-start) 0%, var(--bg-body-end) 100%);
    color: var(--text-primary);
    overscroll-behavior-y: none;
}

.site-nav {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(280px, 1fr) auto;
    align-items: center;
    padding: 0.75rem 2rem;
    border-bottom: 1px solid var(--border-color);
    width: 100%;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-surface);
}

.site-nav.flip-active {
    background: #d9f99d;
    border-bottom-color: #bbf7d0;
}

.site-nav.flip-active .menu-toggle span {
    background: #14532d;
}

body.dark-mode .site-nav.flip-active {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-bottom-color: #065f46;
}

body.dark-mode .site-nav.flip-active .menu-toggle span {
    background: var(--text-primary);
}

.site-nav .menu-toggle {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    padding: 0;
}

.site-nav .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
}

.primary-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.puzzle-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    min-width: 0;
}

.puzzle-selector-details {
    flex: 1;
    text-align: center;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    align-items: center;
}

.puzzle-selector-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    line-height: 1.1;
    margin: 0;
}

.puzzle-selector-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 1rem;
    margin: 0;
}

.primary-menu-panel {
    position: absolute;
    top: 110%;
    left: 0;
    width: min(320px, 85vw);
    background: var(--bg-surface);
    border-radius: 1.25rem;
    padding: 1.1rem;
    color: var(--text-primary);
    box-shadow: 0 20px 45px var(--shadow-color);
    border: 1px solid var(--border-color-light);
    display: none;
    z-index: 25;
}

.menu-quick-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-action {
    position: relative;
}

.menu-action-button {
    width: 100%;
    border-radius: 1rem;
    border: 1px solid var(--border-color-light);
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.menu-action-button img {
    width: 22px;
    height: 22px;
}

.menu-action-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
}

.menu-action-button:hover,
.menu-action-button:focus-visible {
    background: var(--bg-surface-tertiary);
    border-color: var(--accent-color);
    color: var(--text-primary);
}

.primary-menu-panel.show {
    display: block;
}

.menu-eyebrow {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: 0.75rem;
}

.menu-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.menu-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    border-radius: 1rem;
    border: 1px solid var(--border-color-light);
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
    padding: 0.75rem 1rem;
    text-align: left;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, color 150ms ease;
}

.menu-option:hover,
.menu-option:focus-visible {
    border-color: var(--accent-color);
    background: var(--bg-surface-tertiary);
    color: var(--text-primary);
    transform: translateY(-2px);
    outline: none;
}

.menu-option.active {
    border-color: var(--border-active);
    background: var(--bg-active);
}

.menu-option img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 0.75rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color-light);
    padding: 0.25rem;
}

.menu-option-text {
    flex: 1;
}

.menu-option-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
}

.menu-option-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.menu-option-badge {
    font-size: 0.65rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    padding: 0.15rem 0.6rem;
    color: var(--text-primary);
}

.menu-option-badge.badge-soon {
    color: #b45309;
    border-color: #fcd34d;
}

.hero-copy {
    color: var(--text-primary);
    text-align: center;
    border-bottom: 2px solid #111827;
    padding: 1.25rem 0;
    margin-bottom: 1.75rem;
}

.hero-copy .tagline {
    letter-spacing: 0.3em;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.hero-copy .lead {
    font-size: 1rem;
    color: var(--text-secondary);
}

.game-card {
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    box-shadow: none;
    background: var(--bg-surface);
}

.puzzle-today {
    font-size: 0.65rem;
    color: #10b981;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.puzzle-today img {
    width: 14px;
    height: 14px;
}

.puzzle-nav-button {
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-surface-secondary);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 150ms ease, color 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.puzzle-nav-button:hover,
.puzzle-nav-button:focus-visible {
    background: var(--primary-color);
    color: var(--primary-text-inverse);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    outline: none;
}

.puzzle-nav-button:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

footer.site-footer {
    text-align: center;
    padding: 1rem 2rem;
    border-top: 1px solid var(--border-color);
    width: 100%;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

footer.site-footer img {
    width: 18px;
    height: 18px;
    vertical-align: middle;
}

.completion-extras {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.random-fact {
    display: block;
    font-style: italic;
    color: #065f46;
    text-align: center;
    max-width: 420px;
}

.random-image {
    display: block;
    width: min(320px, 100%);
    height: auto;
    max-height: 240px;
    margin: 0 auto;
    border-radius: 0.5rem;
    object-fit: contain;
}

.flip-progress {
    margin-top: 1rem;
}

.flip-progress-header {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.flip-progress-title {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.8rem;
    color: #475569;
}

.flip-progress-meta {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    font-weight: 600;
}

.flip-progress-count {
    font-size: 1rem;
    color: #0f172a;
}

.flip-progress-points {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: #065f46;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    position: relative;
}

.flip-progress-points.reducing {
    animation: pointsPulse 600ms ease;
}

.flip-progress-points.reducing img {
    animation: coinDip 600ms ease;
}

.flip-progress-points.gaining {
    animation: pointsGain 600ms ease;
}

.flip-progress-points.gaining img {
    animation: coinLift 600ms ease;
}

.flip-progress-points .points-delta {
    position: absolute;
    right: -12px;
    top: 50%;
    transform: translate(0, -50%);
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
}

.flip-progress-points .points-delta.decrease {
    color: #991b1b;
}

.flip-progress-points .points-delta.increase {
    color: #15803d;
}

.flip-progress-points .points-delta.show.decrease {
    animation: deltaDrop 700ms ease;
}

.flip-progress-points .points-delta.show.increase {
    animation: deltaRise 700ms ease;
}

.flip-progress-points img {
    width: 20px;
    height: 20px;
}

.flip-progress-points-value {
    font-weight: 700;
}

.buy-clue-chip {
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.9rem;
    border-radius: 999px;
    background: #c084fc;
    color: #2e1065;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}



.buy-clue-chip img {
    width: 18px;
    height: 18px;
}

@keyframes pointsPulse {
    0% {
        transform: scale(1);
        background: #ef4444;
        /* Red-500 */
        color: white;
    }

    40% {
        transform: scale(0.92);
        background: #dc2626;
        /* Red-600 */
        color: white;
    }

    100% {
        transform: scale(1);
        background: rgba(15, 118, 110, 0.1);
        color: #065f46;
    }
}

@keyframes coinDip {
    0% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(3px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes coinLift {
    0% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-4px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes pointsGain {
    0% {
        transform: scale(1);
        background: rgba(16, 185, 129, 0.25);
    }

    40% {
        transform: scale(1.08);
        background: rgba(16, 185, 129, 0.45);
    }

    100% {
        transform: scale(1);
        background: rgba(15, 118, 110, 0.1);
    }
}

@keyframes deltaRise {
    0% {
        opacity: 0;
        transform: translate(8px, 8px);
    }

    30% {
        opacity: 1;
        transform: translate(0, 0);
    }

    100% {
        opacity: 0;
        transform: translate(-4px, -12px);
    }
}

@keyframes deltaDrop {
    0% {
        opacity: 0;
        transform: translate(-4px, -12px);
    }

    30% {
        opacity: 1;
        transform: translate(0, -4px);
    }

    100% {
        opacity: 0;
        transform: translate(4px, 10px);
    }
}

.flip-progress-track {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(203, 213, 225, 0.85);
    border-radius: 999px;
    margin-top: 1.1rem;
    box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.08);
}

.flip-progress-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    /* Default Blue */
    border-radius: 999px;
    transition: width 200ms ease, background 300ms ease;
}

.flip-progress-fill.tier-1 {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

/* Blue */
.flip-progress-fill.tier-2 {
    background: linear-gradient(90deg, #10b981, #34d399);
}

/* Green */
.flip-progress-fill.tier-3 {
    background: linear-gradient(90deg, #eab308, #facc15);
}

/* Yellow */
.flip-progress-fill.tier-4 {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

/* Orange */
.flip-progress-fill.tier-5 {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

/* Red */

@keyframes checkpointPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
        transform: scale(1.02);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
        transform: scale(1);
    }
}

.checkpoint-reached {
    animation: checkpointPulse 0.8s ease-out;
}

.flip-progress-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #0f172a;
    color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.25);
    transition: left 200ms ease;
}

.flip-progress-checkpoints {
    position: relative;
    width: 100%;
    height: 34px;
    margin-top: 0.45rem;
    pointer-events: none;
}

.flip-checkpoint {
    position: absolute;
    bottom: 0;
    transform: translateX(-50%);
    text-align: center;
    font-size: 0.7rem;
    color: #94a3b8;
    min-width: 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
}

.flip-checkpoint-dot {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #cbd5f5;
    margin: 0 auto 0.25rem;
}

.flip-checkpoint-label {
    display: block;
    line-height: 1.2;
}

.flip-checkpoint.completed .flip-checkpoint-dot {
    background: #0f172a;
}

.flip-checkpoint.completed {
    color: #0f172a;
    font-weight: 600;
}

.puzzle-check {
    display: inline-block;
    width: 20px;
    height: 20px;
    vertical-align: middle;
    background: url("/static/check.png") no-repeat center/contain;
}

.status-bar {
    padding-top: 0.5rem;
}

#status {
    border: 1px solid #111827;
    color: #111827;
    background: #fefefe;
}

#status.status-success {
    background: #dcfce7;
    color: #065f46;
    border-color: #16a34a;
    animation: statusSuccessPulse 0.6s ease;
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
}

#status.status-reward {
    background: #ecfccb;
    color: #065f46;
    border-color: #bbf7d0;
}

#status.status-clue {
    background: #c084fc;
    color: #2e1065;
    border-color: #a855f7;
}

#status.status-bonus {
    animation: bonusGlow 1s ease;
}

@keyframes statusSuccessPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.6);
        transform: scale(0.98);
    }

    60% {
        box-shadow: 0 0 0 10px rgba(74, 222, 128, 0);
        transform: scale(1.02);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
        transform: scale(1);
    }
}

@keyframes bonusGlow {
    0% {
        box-shadow: 0 0 0 0 rgba(160, 133, 247, 0.4);
    }

    70% {
        box-shadow: 0 0 15px 4px rgba(160, 133, 247, 0.6);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(160, 133, 247, 0.0);
    }
}

.guess-thermometer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.25rem;
}

.flip-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.6rem 1.2rem;
    border-radius: 1.25rem;
    border: 1px solid #bbf7d0;
    background: linear-gradient(120deg, #ecfccb, #dcfce7);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.1);
}

.flip-banner .flip-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.flip-banner .flip-info-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.flip-word {
    font-size: 1.75rem;
    letter-spacing: 0.08em;
    color: #065f46;
}

.flip-subtitle {
    color: #166534;
    margin-bottom: 0.35rem;
}

.flip-status {
    font-size: 0.9rem;
    color: #064e3b;
}

.flip-board {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.25rem;
    align-items: flex-start;
}

.flip-grid-wrapper {
    position: relative;
    flex: 1 1 420px;
    width: 100%;
}

.flip-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.5rem;
    width: 100%;
    max-width: 650px;
    margin: 0 auto;
}

.flip-side-panel {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.buy-clue-button {
    align-items: center;
    gap: 0.4rem;
    border-radius: 999px;
    border: 1px solid #0ea5e9;
    background: #e0f2fe;
    color: #075985;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
}

.buy-clue-button img {
    width: 18px;
    height: 18px;
}

.flip-card {
    perspective: 800px;
    min-height: 0;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    padding-top: 70%;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

.flip-card.revealed .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card.flip-hinted .flip-card-front {
    background: #fbbf24;
    color: #78350f;
    border-color: #f59e0b;
    font-size: 0.95rem;
    letter-spacing: 0.1em;
}

.flip-card.flip-clued .flip-card-front {
    background: #c084fc;
    color: #2e1065;
    border-color: #a855f7;
    font-size: 0.95rem;
    letter-spacing: 0.08em;
}

.flip-card.flip-clued.flip-clue-highlight .flip-card-front {
    border-color: #fde047;
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.55), 0 0 18px rgba(253, 224, 71, 0.85);
    animation: flip-clue-glow 1.8s ease-in-out infinite;
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.2rem;
}

.flip-card-front {
    background: #1e293b;
    color: #f8fafc;
    border: 2px solid rgba(248, 250, 252, 0.25);
    text-align: center;
    gap: 0.15rem;
}

.flip-card-back {
    background: linear-gradient(140deg, #a7f3d0, #6ee7b7);
    color: #065f46;
    transform: rotateY(180deg);
    border: 2px solid #34d399;
    text-align: center;
    padding: 0.5rem;
}

.flip-letter-count {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 0.25rem;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.flip-card.flip-clued .flip-letter-count {
    color: #2e1065;
}

.flip-card.flip-clued.flip-clue-highlight .flip-letter-count {
    color: #92400e;
}

.flip-card.flip-hinted .flip-letter-count {
    color: #92400e;
}

.flip-front-text {
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.flip-miss-log {
    flex: 1 1 220px;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    padding: 1rem;
    background: #f8fafc;
    min-width: 180px;
}

.flip-miss-log h4 {
    font-size: 0.85rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.flip-miss-list {
    font-size: 0.85rem;
    color: #1f2937;
    white-space: pre-wrap;
}

@keyframes flip-clue-glow {
    0% {
        box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.5), 0 0 10px rgba(253, 224, 71, 0.4);
    }

    50% {
        box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.9), 0 0 26px rgba(253, 224, 71, 0.9);
    }

    100% {
        box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.5), 0 0 10px rgba(253, 224, 71, 0.4);
    }
}

.reward-notice {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border: 1px solid #fde68a;
    background: #fffbeb;
    color: #92400e;
    border-radius: 999px;
    padding: 0.25rem 0.4rem;
    font-size: 0.8rem;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.5);
}

.reward-notice img {
    width: 14px;
    height: 14px;
}

.thermometer-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.thermometer-track {
    position: relative;
    flex: 1;
    height: 14px;
    border-radius: 999px;
    background: linear-gradient(90deg,
            #0ea5e9 0%,
            #22d3ee 25%,
            #facc15 50%,
            #f97316 75%,
            #dc2626 100%);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(255, 255, 255, 0.5);
    border: 1px solid rgba(0, 0, 0, 0.05);
    overflow: visible;
    transition: box-shadow 300ms ease;
}

.thermometer-track.burning {
    animation: trackBurn 1.5s ease-in-out infinite;
}

.thermometer-marker {
    position: absolute;
    top: -36px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: left 200ms cubic-bezier(0.4, 0, 0.2, 1), opacity 150ms ease;
    pointer-events: none;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.15));
}

.thermometer-marker.hidden {
    opacity: 0;
    visibility: hidden;
}

.thermometer-bubble {
    background: #1e293b;
    color: #f8fafc;
    border-radius: 8px;
    padding: 0.25rem 0.65rem;
    white-space: nowrap;
    font-weight: 700;
}

.thermometer-rank {
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    color: #f8fafc;
    font-weight: 600;
}

.thermometer-arrow {
    width: 0;
    height: 0;
    margin-top: -1px;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 7px solid #1e293b;
}

.thermometer-icon.flame-glow {
    animation: flamePulse 1.2s ease-in-out infinite;
}

@keyframes flamePulse {
    0% {
        filter: drop-shadow(0 0 2px rgba(251, 146, 60, 0.35));
        transform: scale(1);
    }

    50% {
        filter: drop-shadow(0 0 18px rgba(249, 115, 22, 0.85));
        transform: scale(1.05);
    }

    100% {
        filter: drop-shadow(0 0 2px rgba(251, 146, 60, 0.35));
        transform: scale(1);
    }
}

@keyframes trackBurn {
    0% {
        box-shadow: 0 0 8px rgba(249, 115, 22, 0.4), 0 0 16px rgba(220, 38, 38, 0.2);
    }

    50% {
        box-shadow: 0 0 20px rgba(249, 115, 22, 0.8), 0 0 32px rgba(220, 38, 38, 0.5);
    }

    100% {
        box-shadow: 0 0 8px rgba(249, 115, 22, 0.4), 0 0 16px rgba(220, 38, 38, 0.2);
    }
}

/* Heartbeat Animation */
.thermometer-marker.heartbeat .thermometer-bubble {
    background: #ef4444;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.thermometer-marker.heartbeat .thermometer-arrow {
    border-top-color: #ef4444;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    15% {
        transform: scale(1.15);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    30% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }

    45% {
        transform: scale(1.15);
        box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
    }

    60% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.guess-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.75rem;
    padding: 1.1rem 1.5rem;
    border-radius: 1rem;
    border: 1px solid #cbd5f5;
    background: linear-gradient(125deg, #eef2ff, #e0f2fe);
}

.guess-summary .summary-block {
    flex: 1;
    text-align: center;
}

.guess-summary .summary-label {
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #475569;
    margin-bottom: 0.2rem;
}

.guess-summary .summary-value {
    font-size: 1.65rem;
    font-weight: 700;
    color: #0f172a;
}

.guess-summary .summary-divider {
    width: 1px;
    height: 42px;
    background: rgba(15, 23, 42, 0.12);
}

@media (max-width: 768px) {
    .site-nav {
        grid-template-columns: auto 1fr auto;
        padding: 0.5rem 1rem;
        gap: 0.5rem;
    }

    .puzzle-selector {
        gap: 0.4rem;
    }

    .puzzle-selector-title {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .puzzle-selector-meta {
        font-size: 0.7rem;
    }

    .card-body {
        padding: 1.5rem !important;
    }

    #guess-form {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    #guess-form .col-lg-8 {
        flex: 1 1 260px;
        width: auto;
    }

    #guess-form .col-lg-2 {
        flex: 0 1 150px;
        width: auto;
    }

    #guess-form .d-grid {
        width: auto;
    }

    .guess-thermometer,
    .guess-summary {
        flex-direction: row;
        flex-wrap: wrap;
        text-align: left;
        justify-content: center;
        gap: 0.75rem;
    }

    .guess-summary .summary-divider {
        display: none;
    }

    .status-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center !important;
        gap: 0.75rem;
    }

    #status {
        font-size: 0.95rem;
    }



    .user-menu {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: flex-end;
        gap: 0.75rem;
    }
}

.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.user-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color-light);
    background: var(--bg-surface);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    box-shadow: 0 8px 20px var(--shadow-color);
}

.user-button:focus-visible {
    outline: 3px solid rgba(37, 99, 235, 0.35);
}

.user-dropdown {
    position: absolute;
    top: 110%;
    right: 0;
    width: min(320px, 80vw);
    background: var(--bg-surface);
    backdrop-filter: none;
    border-radius: 1.25rem;
    padding: 1.25rem;
    color: var(--text-primary);
    box-shadow: 0 20px 45px var(--shadow-color);
    border: 1px solid var(--border-color-light);
    display: none;
    z-index: 10;
}

.user-dropdown.show {
    display: block;
}

.user-dropdown label {
    color: #4b5563;
    font-size: 0.8rem;
}

.user-dropdown input {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.user-dropdown input:focus {
    background: var(--input-bg);
    color: var(--text-primary);
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.user-dropdown .btn {
    font-weight: 600;
    box-shadow: none;
}

.user-dropdown .auth-status {
    display: none;
    font-size: 0.85rem;
    border-radius: 0.85rem;
    padding: 0.65rem 0.9rem;
    border: 1px solid transparent;
    margin-bottom: 1rem;
    background: #f9fafb;
    color: #0f172a;
}

.user-dropdown .auth-status.auth-status-visible {
    display: block;
}

.user-dropdown .auth-status.auth-status-info {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.user-dropdown .auth-status.auth-status-success {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.user-dropdown .auth-status.auth-status-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #b91c1c;
}

.user-dropdown .auth-section {
    border: 1px solid var(--border-color-light);
    border-radius: 1rem;
    padding: 1rem;
    background: var(--bg-surface-secondary);
    margin-bottom: 1rem;
}

.user-dropdown .auth-section:last-child {
    margin-bottom: 0;
}

.user-dropdown .auth-eyebrow {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--text-tertiary);
}

.user-dropdown .auth-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.user-dropdown .auth-tabs {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-tablist {
    display: flex;
    gap: 0.5rem;
    border: 1px solid var(--border-color-light);
    border-radius: 999px;
    padding: 0.2rem;
    background: var(--bg-surface-secondary);
}

.auth-tab {
    flex: 1;
    border: none;
    border-radius: 999px;
    background: transparent;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.45rem 0.75rem;
    cursor: pointer;
    transition: background 150ms ease, color 150ms ease;
}

.auth-tab.active {
    background: var(--primary-color);
    color: var(--primary-text-inverse);
}

.auth-panels {
    position: relative;
}

.user-dropdown .streak-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.user-profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 1rem;
}

.user-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4338ca;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.user-dropdown .streak-card {
    border-radius: 0.85rem;
    border: 1px solid var(--border-color-light);
    background: var(--bg-surface-secondary);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
}

.user-dropdown .streak-card.classic-streak {
    background: #fff7ed;
    border-color: #ffedd5;
}

.user-dropdown .streak-card.flip-streak {
    background: #f0fdf4;
    border-color: #dcfce7;
}

.streak-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.user-dropdown .streak-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #64748b;
    margin: 0;
}

.user-dropdown .streak-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.2rem;
    margin: 0;
}

.user-dropdown .streak-unit {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: lowercase;
}



#howItWorksModal .modal-content {
    border-radius: 1.25rem;
    border: 1px solid var(--border-color-light);
    box-shadow: 0 25px 60px var(--shadow-color);
    background: var(--bg-surface);
}

#howItWorksModal .modal-body {
    padding: 2rem;
    color: var(--text-primary);
}

.how-it-works-panel ul {
    padding-left: 1.2rem;
    margin-bottom: 0;
}

.how-it-works-step {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    align-items: center;
}

.how-it-works-step h4 {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

.how-it-works-image {
    width: 96px;
    height: 96px;
    border-radius: 0.75rem;
    background: repeating-linear-gradient(45deg, #e5e7eb, #e5e7eb 8px, #f5f5f5 8px, #f5f5f5 16px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-align: center;
    text-transform: uppercase;
    padding: 0.5rem;
}

img.how-it-works-image {
    padding: 0;
    background: none;
    object-fit: contain;
}

#how-it-works-classic .how-it-works-step {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
}

#how-it-works-classic .how-it-works-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    margin-top: 0.25rem;
    border: 1px solid var(--border-color-light);
}

#how-it-works-classic .how-it-works-step h4 {
    margin-top: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.guess-form {
    width: 100%;
}

.guess-input-wrapper {
    display: flex;
    align-items: stretch;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    box-shadow: 0 12px 30px var(--shadow-color);
    overflow: hidden;
}

.guess-input {
    flex: 1;
    border: none;
    padding: 0.9rem 1.5rem;
    font-size: 1.1rem;
    outline: none;
}

.guess-input::placeholder {
    color: var(--text-tertiary);
}

.guess-submit {
    border: none;
    background: linear-gradient(120deg, #7c3aed, #6366f1);
    color: #fff;
    font-weight: 600;
    padding: 0 1.75rem;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 150ms ease;
    white-space: nowrap;
}

.guess-submit:hover,
.guess-submit:focus-visible {
    opacity: 0.85;
    outline: none;
}

.status-bar #status {
    border-radius: 1rem;
    background: #eef2ff;
    color: #312e81;
    border: none;
}

.status-bar #status.status-success {
    background: #dcfce7;
    color: #065f46;
    border: 1px solid #86efac;
}

.status-bar #status.status-reward {
    background: #ecfccb;
    color: #065f46;
    border: 1px solid #bbf7d0;
}

.status-bar #status.status-clue {
    background: #c084fc;
    color: #2e1065;
    border: 1px solid #a855f7;
}

.status-bar #status.status-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

#status.status-heat-icecold,
.status-bar #status.status-heat-icecold {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

#status.status-heat-cold,
.status-bar #status.status-heat-cold {
    background: #bfdbfe;
    color: #1e3a8a;
    border: 1px solid #93c5fd;
}

#status.status-heat-lukewarm,
.status-bar #status.status-heat-lukewarm {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fcd34d;
}

#status.status-heat-warm,
.status-bar #status.status-heat-warm {
    background: #fed7aa;
    color: #9a3412;
    border: 1px solid #fb923c;
}

#status.status-heat-hot,
.status-bar #status.status-heat-hot {
    background: #fdba74;
    color: #7c2d12;
    border: 1px solid #f97316;
}

#status.status-heat-burning,
.status-bar #status.status-heat-burning {
    background: #fecaca;
    color: #7f1d1d;
    border: 1px solid #f87171;
}

#status.status-heat-secret,
.status-bar #status.status-heat-secret {
    background: #dcfce7;
    color: #065f46;
    border: 1px solid #34d399;
}

#status.status-heat-top1000,
.status-bar #status.status-heat-top1000 {
    background: #f3e8ff;
    color: #6b21a8;
    border: 1px solid #d8b4fe;
}

.status-bar #status.status-critical {
    font-weight: 700;
}

.status-bar #status.status-shake {
    animation: statusShake 0.55s ease;
}

.status-bar #status.status-bonus {
    animation: bonusGlow 1s ease;
}

.status-bar .pill-stat {
    border-radius: 999px;
    letter-spacing: 0.05em;
    background: #0f172a;
    color: #f8fafc;
}

@keyframes statusShake {
    0% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-6px);
    }

    40% {
        transform: translateX(6px);
    }

    60% {
        transform: translateX(-4px);
    }

    80% {
        transform: translateX(4px);
    }

    100% {
        transform: translateX(0);
    }
}

#guess-list {
    max-height: max(150px, calc(100vh - var(--keyboard-height, 120px) - 340px));
    max-height: max(150px, calc(100dvh - var(--keyboard-height, 120px) - 340px));
    overflow-y: auto;
    overscroll-behavior: contain;
}

.empty-state {
    border: 2px dashed #cbd5f5;
    border-radius: 1.5rem;
}

.guess-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1.1rem;
    border-radius: 1rem;
    background: #f8fafc;
    border-left: 6px solid rgba(15, 23, 42, 0.15);
}

.guess-entry .guess-word {
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
}

.guess-entry .meta {
    font-size: 0.9rem;
    color: #475569;
}

.guess-entry .guess-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1;
}

.guess-entry .heat-icon {
    font-size: 1.25rem;
}

.guess-entry .guess-right {
    text-align: right;
    min-width: 4.5rem;
    font-weight: 600;
}

.guess-entry.heat-boiling {
    border-left-color: #be123c;
    background: linear-gradient(135deg, #ffe4e6, #fda4af);
    color: #881337;
    font-weight: 700;
}

.guess-entry.heat-boiling .meta,
.guess-entry.heat-boiling .guess-word {
    color: #881337;
}

.guess-entry.heat-burning {
    border-left-color: #dc2626;
    background: linear-gradient(135deg, #fee2e2, #fca5a5);
    color: #7f1d1d;
    font-weight: 600;
}

.guess-entry.heat-burning .meta,
.guess-entry.heat-burning .guess-word {
    color: #7f1d1d;
}

.guess-entry.heat-hot {
    border-left-color: #ea580c;
    background: linear-gradient(135deg, #ffedd5, #fdba74);
    color: #9a3412;
}

.guess-entry.heat-hot .meta,
.guess-entry.heat-hot .guess-word {
    color: #9a3412;
}

.guess-entry.heat-warm {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, #fffbeb, #fcd34d);
    color: #92400e;
}

.guess-entry.heat-warm .meta,
.guess-entry.heat-warm .guess-word {
    color: #92400e;
}

.guess-entry.heat-tepid {
    border-left-color: #eab308;
    background: linear-gradient(135deg, #fefce8, #fde047);
    color: #854d0e;
}

.guess-entry.heat-tepid .meta,
.guess-entry.heat-tepid .guess-word {
    color: #854d0e;
}

.guess-entry.heat-lukewarm {
    border-left-color: #facc15;
    background: linear-gradient(135deg, #fefce8, #fef08a);
    color: #713f12;
}

.guess-entry.heat-lukewarm .meta,
.guess-entry.heat-lukewarm .guess-word {
    color: #713f12;
}

.guess-entry.heat-chilly {
    border-left-color: #94a3b8;
    background: linear-gradient(135deg, #f8fafc, #cbd5e1);
    color: #334155;
}

.guess-entry.heat-chilly .meta,
.guess-entry.heat-chilly .guess-word {
    color: #334155;
}

.guess-entry.heat-cold {
    border-left-color: #38bdf8;
    background: linear-gradient(135deg, #f0f9ff, #bae6fd);
    color: #0369a1;
}

.guess-entry.heat-cold .meta,
.guess-entry.heat-cold .guess-word {
    color: #0369a1;
}

.guess-entry.heat-icecold {
    border-left-color: #2563eb;
    background: linear-gradient(135deg, #eff6ff, #bfdbfe);
    color: #1e3a8a;
}

.guess-entry.heat-icecold .meta,
.guess-entry.heat-icecold .guess-word {
    color: #1e3a8a;
}

@keyframes secretBurn {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.guess-entry.heat-secret {
    border-left-color: #7f1d1d;
    background: linear-gradient(45deg, #dc2626, #ea580c, #f59e0b, #dc2626);
    background-size: 300% 300%;
    color: #ffffff;
    animation: secretBurn 3s infinite;
}

.guess-entry.heat-secret .guess-word {
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
    font-size: 1.1em;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.guess-entry.heat-secret .meta {
    color: #fff1f2;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.guess-entry.flip-entry {
    border-left-width: 6px;
    border-left-color: #34d399;
}

.guess-entry.flip-entry-target {
    background: linear-gradient(120deg, #ecfccb, #bbf7d0);
    border-left-color: #16a34a;
}

.guess-entry.flip-entry-bonus {
    background: linear-gradient(120deg, #e0f2fe, #bfdbfe);
    border-left-color: #0284c7;
}

.guess-entry.flip-entry-miss {
    background: #f1f5f9;
    border-left-color: #94a3b8;
    color: #475569;
}

/* Clue Selection Mode */
body.clue-selection-mode .flip-card {
    opacity: 0.3;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

@keyframes cluePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(192, 132, 252, 0.4), 0 0 15px rgba(192, 132, 252, 0.3);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(192, 132, 252, 0.6), 0 0 25px rgba(192, 132, 252, 0.5);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(192, 132, 252, 0.4), 0 0 15px rgba(192, 132, 252, 0.3);
    }
}

body.clue-selection-mode .flip-card.clue-eligible {
    opacity: 1;
    pointer-events: auto;
    cursor: pointer;
    z-index: 50;
    position: relative;
    animation: cluePulse 2s infinite ease-in-out;
    border-radius: 0.75rem;
    /* Ensure radius matches card */
}

body.clue-selection-mode .flip-card.clue-eligible:hover {
    transform: scale(1.05);
    animation: none;
    box-shadow: 0 0 0 6px rgba(192, 132, 252, 0.8), 0 0 35px rgba(192, 132, 252, 0.6);
}

body.clue-selection-mode::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 40;
    pointer-events: none;
}

.buy-clue-chip.btn-cancel {
    background: #ef4444;
    color: #ffffff;
}

.buy-clue-chip.btn-cancel:hover {
    background: #dc2626;
}

/* Flip leaderboard overlay */
.flip-board {
    position: relative;
}

.flip-grid-wrapper.blur-active #flip-grid {
    filter: blur(6px);
    pointer-events: none;
    user-select: none;
}

.flip-overlay-card {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    z-index: 10;
    pointer-events: none;
    height: 100%;
}

.flip-overlay-content {
    width: 100%;
    max-width: 480px;
    max-height: 100%;
    overflow: hidden;
    background: var(--bg-surface);
    border-radius: 1.5rem;
    box-shadow: 0 25px 45px var(--shadow-color);
    border: 1px solid var(--border-color-light);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    pointer-events: auto;
}

.leaderboard-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    border: none;
    background: var(--bg-surface-secondary);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    z-index: 20;
}

.leaderboard-close:hover {
    background: var(--bg-surface-tertiary);
    color: var(--text-primary);
}

.leaderboard-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color-light);
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-surface-secondary);
}

.leaderboard-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.leaderboard-body {
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
}

.leaderboard-user-stat {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #dcfce7;
    border-radius: 1rem;
    border: 1px solid #bbf7d0;
}

.leaderboard-user-stat .stat-label {
    display: block;
    font-size: 0.85rem;
    color: #166534;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.leaderboard-user-stat .stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: #15803d;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.leaderboard-table th {
    text-align: left;
    padding: 0.75rem;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color-light);
}

.leaderboard-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color-light);
    color: var(--text-primary);
}

.leaderboard-table tr:last-child td {
    border-bottom: none;
}

.leaderboard-table tr:nth-child(1) td {
    color: #b45309;
    font-weight: 700;
    background: var(--bg-surface-tertiary);
}

.leaderboard-table tr:nth-child(2) td {
    color: var(--text-primary);
    font-weight: 600;
}

.leaderboard-table tr:nth-child(3) td {
    color: var(--text-secondary);
}

.leaderboard-actions {
    padding: 1.25rem;
    background: var(--bg-surface-secondary);
    text-align: center;
    border-top: 1px solid var(--border-color-light);
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-buttons-container {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-icon-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-icon-btn:hover {
    transform: scale(1.1);
}

.share-icon-btn img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: contain;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Mobile adjustments for Flip Leaderboard */
@media (max-width: 600px) {
    .flip-overlay-content {
        padding: 0;
        border-radius: 1rem;
        max-height: 90vh;
        width: 95%;
    }

    .leaderboard-header {
        padding: 1rem;
    }

    .leaderboard-header h3 {
        font-size: 1.1rem;
    }

    .leaderboard-body {
        padding: 1rem;
    }

    .leaderboard-user-stat {
        margin-bottom: 1rem;
        padding: 0.75rem;
    }

    .leaderboard-user-stat .stat-value {
        font-size: 1.5rem;
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .leaderboard-actions {
        padding: 1rem;
    }
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

.blurred-name {
    display: inline-block;
    background-color: currentColor;
    opacity: 0.5;
    filter: blur(4px);
    height: 1em;
    border-radius: 4px;
    vertical-align: middle;
}