/* ================================================================
   Melodle - Neo-Pop / Neo-Brutalism Design
   ================================================================ */

:root {
    /* Colors - Neo-Pop Palette */
    --primary: #FF6B6B;
    /* Koralrød */
    --primary-dark: #EE5253;
    --primary-light: #ff8787;
    --secondary: #4ECDC4;
    /* Turkis */
    --accent: #FFE66D;
    /* Gul */

    --bg-body: #F7F9FC;
    /* Lys grå/hvid baggrund */
    --bg-card: #FFFFFF;
    --bg-card-light: #f0f3f6;
    --border-color: #2D3436;
    /* Mørkegrå til kanter */

    --text-primary: #2D3436;
    --text-secondary: #636E72;
    --text-muted: #B2BEC3;

    --success: #6AB04C;
    --error: #EB4D4B;
    --warning: #f39c12;

    /* Neo-Brutalism Layout */
    --border-width: 3px;
    --shadow-hard: 4px 4px 0px var(--border-color);
    --shadow-hover: 6px 6px 0px var(--border-color);
    --shadow-active: 2px 2px 0px var(--border-color);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50px;

    /* Dot pattern opacity */
    --dot-color: var(--text-muted);
}

/* Dark Mode */
[data-theme="dark"] {
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --bg-card-light: #334155;
    --border-color: #475569;

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* Ændret accent fra gul til blå for bedre kontrast */
    --accent: #3b82f6;

    --dot-color: #334155;

    --shadow-hard: 4px 4px 0px #000000;
    --shadow-hover: 6px 6px 0px #000000;
    --shadow-active: 2px 2px 0px #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-body);
    /* Retro dot pattern */
    background-image: radial-gradient(var(--dot-color) 1px, transparent 1px);
    background-size: 20px 20px;
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* ----------------------------------------------------------------
   Layout
   ---------------------------------------------------------------- */
.app-container {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 15px 20px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-hard);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-icon {
    font-size: 1.5rem;
}

.logo h1 {
    font-weight: 900;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: -1px;
    color: var(--primary);
    text-shadow: 2px 2px 0px var(--border-color);
    margin: 0;
}

.nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--text-primary);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--secondary);
    border-radius: 2px;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card-light);
    border: var(--border-width) solid var(--border-color);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-active);
    margin-left: 10px;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-hard);
}

[data-theme="dark"] .theme-toggle {
    background: var(--accent);
}

.game-container {
    flex: 1;
}

.footer {
    text-align: center;
    margin-top: auto;
    padding-top: 30px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
}

/* ----------------------------------------------------------------
   Screens
   ---------------------------------------------------------------- */
.screen {
    display: none;
    animation: slideUp 0.4s ease;
}

.screen.active {
    display: block;
}

.hidden {
    display: none !important;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

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

/* ----------------------------------------------------------------
   Hero Section
   ---------------------------------------------------------------- */
.hero {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px 20px;
    background: var(--accent);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-hard);
}

.hero h2 {
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.2;
}

.hero p {
    font-weight: 600;
    color: var(--text-primary);
    opacity: 0.8;
}

/* ----------------------------------------------------------------
   How to Play
   ---------------------------------------------------------------- */
.how-to-play {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-hard);
}

.how-to-play h3 {
    font-size: 1rem;
    margin-bottom: 16px;
    color: var(--text-primary);
    font-weight: 800;
}

.steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.step {
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-number {
    width: 28px;
    height: 28px;
    background: var(--secondary);
    border: 2px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.step-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.step-text strong {
    color: var(--text-primary);
    font-weight: 700;
}

.how-to-play .tip {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 2px solid var(--bg-card-light);
    margin: 0;
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Category Selector
   ---------------------------------------------------------------- */
.category-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 25px;
}

.category-btn {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px 15px;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: var(--shadow-hard);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.category-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.category-btn.active {
    background: var(--secondary);
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

.cat-icon {
    font-size: 2rem;
}

.cat-name {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.cat-count {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.category-btn.active .cat-count {
    color: var(--text-primary);
    opacity: 0.7;
}

/* ----------------------------------------------------------------
   Buttons (Neo-Brutalism Style)
   ---------------------------------------------------------------- */
.primary-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 18px;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: var(--shadow-hard);
    transition: all 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.primary-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
    background: var(--primary-dark);
}

.primary-btn:active {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

.primary-btn:disabled {
    background: #a0a0a0;
    color: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-active);
}

[data-theme="dark"] .primary-btn:disabled {
    background: #4a5568;
    color: #718096;
}

.secondary-btn {
    width: 100%;
    background: white;
    color: var(--text-primary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 14px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-hard);
    margin-top: 15px;
    transition: all 0.1s;
}

.secondary-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.secondary-btn:active {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

/* Share Button (Dark Mode Friendly) */
.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--secondary);
    color: var(--text-primary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 24px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-hard);
    transition: all 0.1s;
}

.share-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
    background: #3ec1b8;
}

.share-btn:active {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

[data-theme="dark"] .share-btn {
    background: var(--secondary);
    color: #1e293b;
}

/* ----------------------------------------------------------------
   Score Bar
   ---------------------------------------------------------------- */
.score-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: 50px;
    padding: 12px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-hard);
}

.score-item {
    text-align: center;
}

.score-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.score-value {
    font-weight: 900;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.score-value.highlight {
    color: var(--primary);
}

.lives-hearts {
    letter-spacing: 2px;
    font-size: 1.2rem;
}

.lives-hearts.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

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

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

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

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

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

/* ----------------------------------------------------------------
   Player Container (Vinyl Design)
   ---------------------------------------------------------------- */
.player-container {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px 30px 30px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: var(--shadow-hard);
    position: relative;
}

/* Waveform bars (for endless mode) */
.waveform {
    margin-bottom: 20px;
}

.waveform-bars {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 6px;
    height: 60px;
}

.waveform-bars span {
    width: 10px;
    background: var(--secondary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    animation: wave 1s ease-in-out infinite;
    animation-play-state: paused;
}

.waveform-bars span:nth-child(1) {
    height: 20px;
    animation-delay: 0s;
}

.waveform-bars span:nth-child(2) {
    height: 35px;
    animation-delay: 0.1s;
}

.waveform-bars span:nth-child(3) {
    height: 50px;
    animation-delay: 0.2s;
}

.waveform-bars span:nth-child(4) {
    height: 40px;
    animation-delay: 0.3s;
}

.waveform-bars span:nth-child(5) {
    height: 55px;
    animation-delay: 0.4s;
}

.waveform-bars span:nth-child(6) {
    height: 45px;
    animation-delay: 0.5s;
}

.waveform-bars span:nth-child(7) {
    height: 60px;
    animation-delay: 0.6s;
}

.waveform-bars span:nth-child(8) {
    height: 35px;
    animation-delay: 0.7s;
}

.waveform-bars span:nth-child(9) {
    height: 50px;
    animation-delay: 0.8s;
}

.waveform-bars span:nth-child(10) {
    height: 25px;
    animation-delay: 0.9s;
}

@keyframes wave {

    0%,
    100% {
        transform: scaleY(0.5);
        opacity: 0.7;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

/* Vinyl Player (for daily mode) */
.vinyl-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vinyl-record {
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    border-radius: 50%;
    border: 4px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: repeating-radial-gradient(#1a1a1a, #1a1a1a 10px, #2d2d2d 11px, #1a1a1a 12px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    transition: transform 0.5s ease;
    position: relative;
    z-index: 2;
}

.vinyl-record.spinning {
    animation: spin 3s linear infinite;
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.vinyl-label {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.2);
}

.vinyl-icon {
    font-size: 32px;
}

.tone-arm {
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100px;
    height: 150px;
    pointer-events: none;
    z-index: 1;
    transform-origin: top right;
    transform: rotate(-30deg);
    transition: transform 0.5s ease;
}

.tone-arm.playing {
    transform: rotate(0deg);
}

.tone-arm::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 12px;
    height: 120px;
    background: #ccc;
    border: 2px solid var(--border-color);
    transform: rotate(-10deg);
}

.tone-arm::after {
    content: '';
    position: absolute;
    bottom: 25px;
    left: 20px;
    width: 40px;
    height: 60px;
    background: var(--secondary);
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

.clip-info {
    margin-top: 15px;
    font-weight: 600;
    color: var(--text-secondary);
}

.play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--secondary);
    border: var(--border-width) solid var(--border-color);
    cursor: pointer;
    font-size: 2rem;
    color: var(--text-primary);
    box-shadow: var(--shadow-hard);
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.play-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: #3ec1b8;
}

.play-btn:active {
    transform: scale(0.95);
    box-shadow: var(--shadow-active);
}

.play-icon {
    font-size: 2rem;
    color: var(--text-primary);
    margin-left: 4px;
}

/* Hint Display */
.hint-display {
    background: var(--accent);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-top: 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.hint-display.hidden {
    display: none;
}

/* ----------------------------------------------------------------
   Guess Input
   ---------------------------------------------------------------- */
.guess-container {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.guess-input {
    flex: 1;
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 15px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    outline: none;
    box-shadow: var(--shadow-active);
    transition: box-shadow 0.2s;
}

.guess-input::placeholder {
    color: #8895a0;
    /* Improved contrast for accessibility */
}

.guess-input:focus {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
    outline: 2px solid var(--primary-light);
    outline-offset: -2px;
}

/* Dark mode input improvements */
[data-theme="dark"] .guess-input {
    background: var(--bg-card);
}

[data-theme="dark"] .guess-input::placeholder {
    color: #64748b;
}

[data-theme="dark"] .guess-input:focus {
    border-color: var(--secondary);
    outline-color: var(--secondary);
}

.guess-btn {
    background: var(--primary);
    color: white;
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0 25px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: var(--shadow-active);
    transition: all 0.1s;
}

.guess-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.guess-btn:active {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

/* ----------------------------------------------------------------
   Autocomplete
   ---------------------------------------------------------------- */
.autocomplete-wrapper {
    position: relative;
    flex: 1;
}

.autocomplete-wrapper .guess-input {
    width: 100%;
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    max-height: 250px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-hard);
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 2px solid var(--bg-card-light);
    transition: background 0.15s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.active {
    background: var(--accent);
}

.autocomplete-item .title {
    font-weight: 600;
    color: var(--text-primary);
}

.autocomplete-item .artist {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-left: 8px;
}

/* ----------------------------------------------------------------
   Action Buttons
   ---------------------------------------------------------------- */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.action-btn {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 24px;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-active);
    transition: all 0.1s;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.action-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.action-btn:active {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

.action-btn.skip {
    background: #FFECEC;
    color: var(--error);
}

.action-btn.skip:hover {
    background: var(--error);
    color: white;
}

.btn-penalty {
    font-size: 0.75rem;
    opacity: 0.7;
    font-weight: 500;
}

/* ----------------------------------------------------------------
   Result Popup
   ---------------------------------------------------------------- */
.result-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
}

.result-popup.hidden {
    display: none;
}

.result-content {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 10px 10px 0px rgba(0, 0, 0, 0.2);
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 100%;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-active);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    margin: 0 auto 20px;
}

.result-icon.correct {
    background: var(--success);
}

.result-icon.wrong {
    background: var(--error);
}

.result-icon.skip {
    background: var(--warning);
}

.result-content h3 {
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.song-info {
    margin-bottom: 20px;
}

.song-title {
    font-size: 1.4rem;
    font-weight: 900;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.song-artist {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 5px;
}

.song-album {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.result-points {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--success);
    margin-bottom: 24px;
}

.result-points.hidden {
    display: none;
}

/* ----------------------------------------------------------------
   Game Over Screen
   ---------------------------------------------------------------- */
.gameover-content {
    text-align: center;
}

.gameover-content h2 {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 24px;
    color: var(--primary);
    text-shadow: 2px 2px 0 var(--border-color);
}

.final-score {
    background: var(--accent);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-hard);
}

.final-score-label {
    display: block;
    font-size: 0.875rem;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 700;
    opacity: 0.7;
}

.final-score-value {
    font-size: 4rem;
    font-weight: 900;
    color: var(--text-primary);
}

.final-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stat {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    box-shadow: var(--shadow-active);
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 900;
    color: var(--secondary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
}

.save-score {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

/* ----------------------------------------------------------------
   Attempt Circles (Wordle-style)
   ---------------------------------------------------------------- */
.attempt-circles {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 24px;
}

.attempt-circles .circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card-light);
    border: var(--border-width) solid var(--border-color);
    transition: all 0.3s ease;
}

.attempt-circles .circle.correct {
    background: var(--success);
    border-color: var(--border-color);
    box-shadow: 0 0 15px rgba(106, 176, 76, 0.5);
    animation: pulse 0.5s ease;
}

.attempt-circles .circle.wrong {
    background: var(--error);
    border-color: var(--border-color);
    box-shadow: 0 0 15px rgba(235, 77, 75, 0.5);
    animation: shake 0.5s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

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

/* ----------------------------------------------------------------
   Share Button
   ---------------------------------------------------------------- */
.share-container {
    margin-top: 20px;
    text-align: center;
}

.share-btn {
    background: var(--secondary);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 12px 32px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.1s ease;
    box-shadow: var(--shadow-hard);
}

.share-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.share-btn:active {
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

.share-copied {
    margin-top: 12px;
    padding: 8px 16px;
    background: var(--success);
    color: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
    animation: popIn 0.3s ease;
}

.share-copied.hidden {
    display: none;
}

/* ----------------------------------------------------------------
   Daily Leaderboard
   ---------------------------------------------------------------- */
.daily-leaderboard {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-top: 20px;
    box-shadow: var(--shadow-hard);
}

.daily-leaderboard h3 {
    font-size: 1rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 2px solid var(--bg-card-light);
}

.leaderboard-table th {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-muted);
}

.leaderboard-table td {
    font-weight: 600;
}

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

/* ----------------------------------------------------------------
   Highscore Page Styles
   ---------------------------------------------------------------- */
.mode-toggle {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.toggle-btn {
    flex: 1;
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: var(--shadow-hard);
}

.toggle-btn:hover {
    transform: translate(-2px, -2px);
    box-shadow: var(--shadow-hover);
}

.toggle-btn.active {
    background: var(--secondary);
    transform: translate(2px, 2px);
    box-shadow: var(--shadow-active);
}

.highscore-list {
    background: var(--bg-card);
    border: var(--border-width) solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-hard);
}

.highscore-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 2px solid var(--bg-card-light);
    gap: 12px;
}

.highscore-item:last-child {
    border-bottom: none;
}

.highscore-item .rank {
    width: 40px;
    font-weight: 800;
    color: var(--primary);
}

.highscore-item .name {
    flex: 1;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.highscore-item .correct {
    color: var(--success);
    font-weight: 700;
}

.highscore-item .emoji {
    font-size: 1.2rem;
}

.highscore-item .score {
    font-weight: 800;
    color: var(--primary);
    min-width: 60px;
    text-align: right;
}

.highscore-item .date {
    font-size: 0.8rem;
    color: var(--text-muted);
    min-width: 50px;
    text-align: right;
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 800px) {
    .header {
        flex-direction: column;
        justify-content: center;
        gap: 16px;
    }

    .nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 10px;
    }

    .category-selector {
        grid-template-columns: 1fr 1fr;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .result-content {
        padding: 24px;
    }

    .save-score {
        flex-direction: column;
    }

    .score-bar {
        padding: 12px 15px;
    }
}