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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #000000;
    color: #ffffff;
    line-height: 1.5;
}

html {
    font-size: 16px;
}

.header {
    width: 100%;
    background-color: #000000;
    border-bottom: 1px solid #1f2937;
}

.header-container {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 3.5rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

.logo-link:hover {
    text-decoration: none;
    color: #fbbf24;
}

.logo-link:hover .logo {
    color: #fbbf24;
}

.nav-logo {
    width: 2rem;
    height: 2rem;
}

.logo {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
}

.nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: #d1d5db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: #ffffff;
}

.mm-nav-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 8px 16px;
    border-radius: 10px;
    border: 1px solid rgba(120, 145, 255, 0.45);
    background: rgba(92, 120, 255, 0.24);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mm-nav-login-btn:hover {
    background: rgba(92, 120, 255, 0.38);
    border-color: rgba(140, 165, 255, 0.55);
    color: #fff;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: #ffffff;
    transition: color 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: #fbbf24;
}

.mobile-menu-toggle .hamburger-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #000000;
    border-bottom: 1px solid #1f2937;
    padding: 1rem;
    z-index: 1000;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mobile-menu-link {
    color: #d1d5db;
    text-decoration: none;
    padding: 0.75rem 0;
    border-bottom: 1px solid #1f2937;
    transition: color 0.3s ease;
}

.mobile-menu-link:last-child {
    border-bottom: none;
}

.mobile-menu-link:hover {
    color: #ffffff;
}

.mobile-menu-link.active {
    color: #fbbf24;
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .header-content {
        position: relative;
    }
}

.hero {
    background-color: #000000;
    color: #ffffff;
    padding: 5rem 1rem;
}

.hero-container {
    max-width: 56rem;
    margin: 0 auto;
    text-align: center;
}

.hero-icon-container {
    margin-bottom: 2rem;
}

.hero-icon {
    width: 6rem;
    height: 6rem;
    margin: 0 auto 1.5rem;
    color: #fbbf24;
}

.hero-logo {
    width: 8rem;
    height: 8rem;
    margin: 0 auto 1.5rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.25rem;
    color: #d1d5db;
    margin-bottom: 2rem;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-button {
    background-color: #fbbf24;
    color: #000000;
    padding: 0.75rem 2rem;
    font-size: 1.125rem;
    font-weight: 500;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.hero-button:hover {
    background-color: #f59e0b;
}

/* 404 page */
.error-page {
    min-height: calc(100vh - 3.5rem - 4rem);
    display: flex;
    align-items: center;
}

.error-page .hero {
    flex: 1;
    padding: 4rem 1rem;
}

.error-page-code {
    font-size: 5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.error-page .hero-description {
    margin-bottom: 2rem;
}

.games-section {
    background-color: #000000;
    padding: 4rem 1rem;
}

.games-container {
    max-width: 80rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.game-class {
    display: flex;
    justify-content: center;
}

.games-grid {
    display: grid;
    gap: 2rem;
    width: 100%;
}

.games-grid.cols-2 {
    grid-template-columns: 1fr;
    max-width: 64rem;
}

.games-grid.cols-3 {
    grid-template-columns: 1fr;
    max-width: 72rem;
}

@media (min-width: 768px) {
    .games-grid.cols-2 {
        grid-template-columns: repeat(2, 1fr);
    }
    .games-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .games-grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.game-card {
    background-color: #171717;
    border: 1px solid #303030;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
    text-decoration: none;
    display: block;
    color: inherit;
}

.game-card:hover {
    background-color: #303030;
}

.game-card-content {
    padding: 1.5rem;
    text-align: center;
}

.game-card-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    color: #fbbf24;
    transition: color 0.2s;
}

.game-card:hover .game-card-icon {
    color: #fcd34d;
}

.game-card-title {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.game-card-description {
    color: #9ca3af;
    font-size: 0.875rem;
    line-height: 1.6;
}

.new-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background-color: #ef4444;
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
    }
    .hero-description {
        font-size: 1.5rem;
    }
}

.footer {
    background-color: #111111;
    border-top: 1px solid #1f2937;
    padding: 2rem 1rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 80rem;
    margin: 0 auto;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-logo-img {
    width: 2rem;
    height: 2rem;
}

.footer-brand {
    color: #ffffff;
    font-size: 1.125rem;
    font-weight: 500;
}

.footer-info {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.footer-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.footer-link:hover {
    opacity: 0.8;
}

.amtf-logo {
    height: 2rem;
    width: auto;
}

.amtf-text {
    color: #d1d5db;
    font-size: 0.875rem;
}

.footer-copyright {
    color: #6b7280;
    font-size: 0.75rem;
}

@media (min-width: 768px) {
    .footer {
        padding: 1.5rem 1rem;
    }
    
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        gap: 2rem;
    }
    
    .footer-info {
        align-items: flex-end;
        text-align: right;
    }
    
    .footer-links {
        align-items: center;
    }
    
    .footer-link {
        flex-direction: row-reverse;
    }
}

.subtitle {
    color: rgb(251, 191, 36);
    font-size: clamp(16px, 4vw, 24px);
    font-style: italic;
    text-align: center;
    margin-bottom: 20px;
}

.rules {
    text-align: center;
    margin: clamp(20px, 5vh, 50px) 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
}

.rules p {
    margin: 8px 0;
    font-size: clamp(14px, 3vw, 18px);
    line-height: 1.4;
}

.game-container {
    width: 100%;
    max-width: 1024px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.buttons-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: clamp(8px, 2vw, 20px);
    margin-top: clamp(30px, 8vh, 100px);
    padding: 0 10px;
}

.note-button {
    width: clamp(60px, 12vw, 100px);
    height: clamp(60px, 12vw, 100px);
    min-width: 60px;
    min-height: 60px;
    background-color: rgb(43, 43, 43);
    border: none;
    border-radius: clamp(8px, 2vw, 10px);
    color: white;
    font-size: clamp(20px, 4vw, 32px);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.note-button:hover {
    background-color: rgb(60, 60, 60);
    transform: scale(1.05);
}

.note-button:active {
    transform: scale(0.95);
}

.note-button.active {
    background-color: rgb(254, 240, 138);
    box-shadow: 0 0 20px rgba(254, 240, 138, 0.5);
}

.note-button.playing {
    background-color: rgb(0, 255, 0);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: scale(1.1);
}

.control-button {
    width: clamp(160px, 30vw, 200px);
    height: clamp(60px, 10vh, 80px);
    background-color: rgb(251, 191, 36);
    border: none;
    border-radius: clamp(8px, 2vw, 10px);
    color: #000000;
    font-size: clamp(18px, 4vw, 32px);
    font-weight: bold;
    cursor: pointer;
    margin: clamp(10px, 2vh, 20px);
    display: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: all 0.3s ease;
}

.control-button:hover {
    background-color: rgb(245, 158, 11);
    transform: translateY(-2px);
}

.control-button:active {
    transform: translateY(0);
}

.level-display {
    font-size: clamp(48px, 12vw, 96px);
    color: rgb(251, 191, 36);
    text-align: center;
    display: none;
    margin: clamp(20px, 5vh, 40px) 0;
}

.game-over {
    text-align: center;
    display: none;
    padding: 20px;
    max-width: 90%;
}

.final-score {
    font-size: clamp(32px, 8vw, 64px);
    margin: clamp(10px, 3vh, 20px) 0;
}

.restart-prompt {
    color: rgb(251, 191, 36);
    font-size: clamp(16px, 4vw, 24px);
    margin-top: 20px;
}

.black-note {
    background-color: #333;
    color: white;
}

.white-note {
    background-color: #f5f5f5;
    color: black;
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
    .buttons-container {
        gap: 15px;
        margin-top: 60px;
    }
    
    .note-button {
        width: 80px;
        height: 80px;
        font-size: 28px;
    }
    
    .control-button {
        width: 180px;
        height: 70px;
        font-size: 28px;
    }
}

@media screen and (max-width: 767px) {
    .buttons-container {
        gap: 8px;
        margin-top: 40px;
        padding: 0 5px;
    }
    
    .note-button {
        width: 60px;
        height: 60px;
        font-size: 20px;
        min-width: 50px;
        min-height: 50px;
    }
    
    .control-button {
        width: 140px;
        height: 60px;
        font-size: 20px;
        margin: 15px;
    }
    
    .rules {
        margin: 20px 0;
        padding: 0 10px;
    }
    
    .rules p {
        margin: 6px 0;
    }
}

@media screen and (max-width: 480px) {
    .buttons-container {
        gap: 6px;
        margin-top: 30px;
    }
    
    .note-button {
        width: 50px;
        height: 50px;
        font-size: 18px;
        min-width: 45px;
        min-height: 45px;
    }
    
    .control-button {
        width: 120px;
        height: 50px;
        font-size: 18px;
    }
}

@media screen and (max-height: 500px) and (orientation: landscape) {
    .buttons-container {
        margin-top: 20px;
        gap: 8px;
    }
    
    .note-button {
        width: clamp(45px, 8vh, 70px);
        height: clamp(45px, 8vh, 70px);
        font-size: clamp(16px, 3vh, 24px);
    }
    
    .level-display {
        font-size: clamp(32px, 8vh, 64px);
        margin: 10px 0;
    }
    
    .rules {
        margin: 10px 0;
    }
    
    .rules p {
        margin: 4px 0;
        font-size: clamp(12px, 2.5vh, 16px);
    }
}

.dashboard-main {
    background-color: #000000;
    padding: 2rem 1rem;
    min-height: calc(100vh - 3.5rem - 4rem);
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 80rem;
    margin: 0 auto;
}

.dashboard-profile-card {
    background-color: #171717;
    border: 1px solid #303030;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    width: 100%;
}

.dashboard-profile-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.dashboard-profile-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-profile-label {
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 500;
}

.dashboard-profile-username {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.dashboard-profile-joined {
    font-size: 1rem;
    color: #ffffff;
}

.dashboard-profile-permalink {
    color: #3b82f6;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: 0.5rem;
}

.dashboard-profile-permalink:hover {
    text-decoration: underline;
}

.dashboard-summary-card {
    background-color: #171717;
    border: 1px solid #303030;
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 56rem;
    align-self: center;
}

.dashboard-summary-guest-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.dashboard-summary-guest-text {
    margin: 0;
    flex: 1;
    min-width: 200px;
    color: #d1d5db;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.dashboard-summary-user-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.dashboard-summary-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 1.25rem 2rem;
    flex: 1;
    min-width: 0;
}

.dashboard-summary-metric {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dashboard-summary-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.dashboard-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.dashboard-summary-signout {
    flex-shrink: 0;
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #4b5563;
    background: #374151;
    color: #fff;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.dashboard-summary-signout:hover {
    background: #4b5563;
    border-color: #6b7280;
}

.dashboard-tests-card {
    background-color: #171717;
    border: 1px solid #303030;
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    max-width: 56rem;
    width: 100%;
    align-self: center;
}

.dashboard-tests-card--wide {
    max-width: 56rem;
}

.dashboard-tests-header {
    margin-bottom: 1.5rem;
}

.dashboard-tests-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

/* Hide auth UI until Supabase session + nav render (avoids flash of wrong account state) */
html.mm-auth-pending #mm-auth-slot,
html.mm-auth-pending #mm-auth-slot-mobile {
    visibility: hidden;
}

html.mm-auth-pending .dashboard-main > .dashboard-summary-card,
html.mm-auth-pending .dashboard-main > .dashboard-tests-card {
    visibility: hidden;
}

.dashboard-tests-table {
    display: flex;
    flex-direction: column;
    /* One template for header + every row — `auto` breaks alignment because header row sized differently from body. */
    --dashboard-tests-cols: minmax(11rem, 1.55fr) minmax(13.5rem, 1.25fr) minmax(7.5rem, 1fr) minmax(7.5rem, 1fr);
}

/* Same template on header + each row so columns line up (avoid `auto`: header vs body sized differently). */
.dashboard-tests-table-header {
    display: grid;
    grid-template-columns: var(--dashboard-tests-cols);
    gap: 0.75rem 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #303030;
    margin-bottom: 0;
    align-items: center;
}

.dashboard-tests-table-row {
    display: grid;
    grid-template-columns: var(--dashboard-tests-cols);
    gap: 0.75rem 1rem;
    padding: 0.875rem 0.6rem;
    margin: 0 -0.6rem;
    padding-left: 0.6rem;
    padding-right: 0.6rem;
    border-bottom: 1px solid #262626;
    align-items: center;
}

#dashboard-tests-rows .dashboard-tests-table-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    border-bottom-color: transparent;
}

#dashboard-tests-rows .dashboard-tests-table-row:last-child {
    border-bottom: none;
}

.dashboard-tests-table-cell {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    font-size: 0.875rem;
    min-width: 0;
    width: 100%;
}

.dashboard-tests-table-cell.header-cell {
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    justify-content: flex-start;
    text-align: left;
}

.dashboard-tests-table-cell.test-name {
    font-weight: 500;
    color: #ffffff;
    font-size: 1rem;
}

.dashboard-tests-table-cell.actions-cell {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dashboard-tests-table-cell.header-cell.dashboard-score-header {
    justify-content: flex-start;
    text-align: left;
}

.dashboard-tests-table-cell.score-cell {
    justify-content: flex-start;
    text-align: left;
    flex-direction: column;
    align-items: flex-start;
    align-self: stretch;
    min-width: 0;
}

.dashboard-score-display {
    display: inline-flex;
    align-items: baseline;
    align-self: flex-start;
    flex-wrap: wrap;
    gap: 0 4px;
    justify-content: flex-start;
    width: fit-content;
    max-width: 100%;
}

.dashboard-score-num {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.dashboard-score-suffix {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1.2;
}

.dashboard-score-placeholder {
    font-size: 1.35rem;
    font-weight: 700;
    color: #6b7280;
}

.dashboard-action-button {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.dashboard-action-button.play-button {
    background-color: #fbbf24;
    color: #000000;
}

.dashboard-action-button.play-button:hover {
    background-color: #f59e0b;
}

.dashboard-action-button.stats-button {
    background-color: #6b7280;
    color: #ffffff;
}

.dashboard-action-button.stats-button:hover {
    background-color: #4b5563;
}

.dashboard-action-button.stats-button.stats-button--disabled,
.dashboard-action-button.stats-button.stats-button--disabled:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.dashboard-action-button.stats-button.stats-button--disabled:hover {
    background-color: #6b7280;
}

.dashboard-recent-header .dashboard-recent-subtitle {
    margin: 0.4rem 0 0;
    font-size: 0.875rem;
    color: #9ca3af;
    line-height: 1.5;
}

.dashboard-recent-empty {
    margin: 0;
    color: #9ca3af;
    font-size: 0.9375rem;
    line-height: 1.5;
}

.dashboard-recent-table-wrap {
    display: flex;
    flex-direction: column;
}

.dashboard-recent-grid {
    display: grid;
    grid-template-columns: minmax(160px, 1.45fr) minmax(130px, 1fr) minmax(80px, 0.55fr);
    gap: 0.75rem 1.25rem;
    align-items: start;
}

.dashboard-recent-grid--head {
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.15rem;
    font-weight: 600;
    color: #9ca3af;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dashboard-recent-row {
    display: grid;
    grid-template-columns: minmax(160px, 1.45fr) minmax(130px, 1fr) minmax(80px, 0.55fr);
    gap: 0.75rem 1.25rem;
    padding: 0.95rem 0.5rem;
    margin: 0 -0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
    align-items: center;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
}

.dashboard-recent-row:last-child {
    border-bottom: none;
}

.dashboard-recent-row:hover {
    background-color: rgba(59, 130, 246, 0.1);
}

.dashboard-recent-test-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    max-width: 100%;
}

.dashboard-recent-test-link:hover {
    color: #ffffff;
}

/* Same Lucide symbols as homepage game cards (.game-card-icon); sized for table rows */
.dashboard-recent-test-link .game-card-icon.dashboard-recent-icon {
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    flex-shrink: 0;
    stroke-width: 2;
    color: #fbbf24;
    transition: color 0.2s;
}

.dashboard-recent-test-link:hover .game-card-icon.dashboard-recent-icon {
    color: #fcd34d;
}

.dashboard-recent-col--date {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.dashboard-recent-date-line1 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e5e7eb;
    line-height: 1.3;
}

.dashboard-recent-date-line2 {
    font-size: 0.8125rem;
    color: #6b7280;
    line-height: 1.3;
}

.dashboard-recent-col--score {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0 4px;
}

.dashboard-recent-score-num {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.dashboard-recent-score-suffix {
    font-size: 0.75rem;
    font-weight: 500;
    color: #9ca3af;
    line-height: 1.2;
}

/* --- Leaderboard (public Melody I–III) --- */
.leaderboard-main {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.leaderboard-hero {
    margin-bottom: 1.75rem;
}

.leaderboard-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--text-0);
    margin: 0 0 0.35rem;
    letter-spacing: -0.02em;
}

.leaderboard-lede {
    margin: 0;
    font-size: 0.9375rem;
    color: var(--text-2);
    line-height: 1.55;
    max-width: 42rem;
}

.leaderboard-meta {
    margin: 0.75rem 0 0;
    font-size: 0.8125rem;
    color: var(--text-2);
    letter-spacing: 0.02em;
}

.leaderboard-page-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.leaderboard-page-body .leaderboard-main {
    flex: 1;
}

.leaderboard-page-body .footer {
    margin-top: 0;
}

.leaderboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.leaderboard-tab {
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-1);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.leaderboard-tab:hover {
    background: rgba(148, 163, 184, 0.14);
    color: var(--text-0);
}

.leaderboard-tab.is-active {
    background: rgba(251, 191, 36, 0.14);
    border-color: rgba(251, 191, 36, 0.45);
    color: var(--brand);
}

.leaderboard-panel {
    display: none;
}

.leaderboard-panel.is-active {
    display: block;
}

.leaderboard-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.leaderboard-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

.leaderboard-table thead {
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.leaderboard-table th {
    padding: 0.65rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-2);
    white-space: nowrap;
}

.leaderboard-table th.leaderboard-col-rank,
.leaderboard-table th.leaderboard-col-user {
    text-align: left;
}

.leaderboard-table th.leaderboard-col-flag {
    text-align: center;
}

.leaderboard-table th.leaderboard-col-score,
.leaderboard-table th.leaderboard-col-date {
    text-align: right;
}

.leaderboard-table td {
    padding: 0.55rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid rgba(148, 163, 184, 0.1);
    color: var(--text-1);
}

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

.leaderboard-table tbody tr:hover td {
    background: rgba(59, 130, 246, 0.06);
}

.leaderboard-col-rank {
    width: 6%;
    max-width: 3.25rem;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8125rem;
    color: var(--text-2);
}

.leaderboard-col-flag {
    width: 10%;
    max-width: 3.5rem;
    font-size: 1.35rem;
    line-height: 1;
    text-align: center;
    vertical-align: middle;
}

/* HatScripts circle-flags SVGs are already circular */
.leaderboard-flag-img {
    width: 1.75rem;
    height: 1.75rem;
    display: block;
    margin: 0 auto;
    flex-shrink: 0;
}

.leaderboard-flag-fallback {
    font-size: 1.35rem;
    line-height: 1;
}

.leaderboard-col-flag--unknown {
    opacity: 0.85;
}

.leaderboard-col-user {
    width: 44%;
    font-weight: 550;
    color: var(--text-0);
}

.leaderboard-col-score {
    width: 12%;
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 650;
    color: var(--brand);
    font-size: 0.9375rem;
}

.leaderboard-col-date {
    width: 28%;
    text-align: right;
    font-size: 0.8125rem;
    color: var(--text-2);
    white-space: nowrap;
}

.leaderboard-empty,
.leaderboard-error {
    padding: 2rem 1.25rem;
    text-align: center;
    color: var(--text-2);
    font-size: 0.9375rem;
}

.leaderboard-error {
    color: var(--text-2);
}

@media (max-width: 768px) {
    .dashboard-main {
        padding: 1rem;
        gap: 1rem;
    }
    
    .dashboard-profile-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .dashboard-summary-metrics {
        grid-template-columns: 1fr;
    }

    .dashboard-summary-user-inner {
        flex-direction: column;
        align-items: stretch;
    }

    .dashboard-summary-signout {
        width: 100%;
    }

    .dashboard-tests-table-header,
    .dashboard-tests-table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    .dashboard-tests-table-cell {
        justify-content: space-between;
        padding: 0.5rem 0;
    }
    
    .dashboard-tests-table-cell.header-cell {
        display: none;
    }
    
    .dashboard-tests-table-cell.test-name::before {
        content: "Test: ";
        font-weight: 600;
        color: #9ca3af;
    }
    
    .dashboard-tests-table-cell.actions-cell::before {
        content: "Actions: ";
        font-weight: 600;
        color: #9ca3af;
        margin-right: auto;
    }
    
    .dashboard-tests-table-cell.actions-cell {
        justify-content: flex-end;
    }

    .dashboard-tests-table-cell.score-cell {
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
    }

    .dashboard-tests-table-cell.score-cell .dashboard-score-display,
    .dashboard-tests-table-cell.score-cell .dashboard-score-placeholder {
        margin-left: 0;
    }

    .dashboard-tests-table-cell.header-cell.dashboard-score-header {
        justify-content: flex-start;
    }

    .dashboard-tests-table-cell.score-best::before {
        content: "Best: ";
        font-weight: 600;
        color: #9ca3af;
        margin-right: 0;
        flex-shrink: 0;
    }

    .dashboard-tests-table-cell.score-avg::before {
        content: "Avg: ";
        font-weight: 600;
        color: #9ca3af;
        margin-right: 0;
        flex-shrink: 0;
    }

    .dashboard-recent-grid.dashboard-recent-grid--head {
        display: none;
    }

    .dashboard-recent-row {
        grid-template-columns: 1fr;
        gap: 0.6rem;
        padding: 1rem 0;
        align-items: start;
    }

    .dashboard-recent-col--score {
        padding-top: 0.15rem;
    }

    .leaderboard-main {
        padding: 1.25rem 0.75rem 2rem;
    }

    .leaderboard-col-date {
        display: none;
    }
}

.round-counter {
    position: fixed;
    top: 4.5rem;
    right: 20px;
    background-color: rgba(251, 191, 36, 0.9);
    color: #000000;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    z-index: 1000;
    display: none;
}

#centsInput:focus,
#bpmInput:focus {
    outline: none;
    border-color: rgb(254, 240, 138);
    box-shadow: 0 0 10px rgba(254, 240, 138, 0.3);
}

.chord-type,
.interval-quality,
.interval-distance {
    width: clamp(60px, 12vw, 100px);
    height: clamp(60px, 12vw, 100px);
    min-width: 60px;
    min-height: 60px;
    background-color: rgb(43, 43, 43);
    border: none;
    border-radius: clamp(8px, 2vw, 10px);
    color: white;
    font-size: clamp(12px, 3vw, 16px);
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.chord-type:hover,
.interval-quality:hover,
.interval-distance:hover {
    background-color: rgb(60, 60, 60);
    transform: scale(1.05);
}

.chord-type:active,
.interval-quality:active,
.interval-distance:active {
    transform: scale(0.95);
}

.chord-type.active,
.interval-quality.active,
.interval-distance.active {
    background-color: rgb(254, 240, 138);
    box-shadow: 0 0 20px rgba(254, 240, 138, 0.5);
}

.chord-type.playing,
.interval-quality.playing,
.interval-distance.playing {
    background-color: rgb(0, 255, 0);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: scale(1.1);
}

.harmony1 .chord-type {
    width: clamp(80px, 15vw, 120px);
    height: clamp(60px, 12vw, 100px);
}

.harmony2 .chord-type,
.harmony3 .chord-type {
    width: clamp(90px, 12vw, 110px);
    height: clamp(60px, 12vw, 100px);
}

.about-main {
    background-color: #000000;
    padding: 2rem 1rem;
    min-height: calc(100vh - 3.5rem - 4rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-container {
    max-width: 56rem;
    width: 100%;
    margin: 0 auto;
}

.about-content {
    background-color: #171717;
    border: 1px solid #303030;
    border-radius: 0.5rem;
    padding: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.about-logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.about-logo {
    width: 4rem;
    height: 4rem;
    color: #fbbf24;
}

.about-title {
    font-size: 2.5rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2rem;
    text-align: center;
}

.about-description {
    margin-bottom: 3rem;
}

.about-description p {
    font-size: 1.125rem;
    line-height: 1.7;
    color: #d1d5db;
    margin-bottom: 1.5rem;
}

.about-description p:last-child {
    margin-bottom: 0;
}

.about-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.about-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    min-width: 160px;
    justify-content: center;
}

.about-button.primary-button {
    background-color: #fbbf24;
    color: #000000;
}

.about-button.primary-button:hover {
    background-color: #f59e0b;
    transform: translateY(-2px);
}

.about-button.secondary-button {
    background-color: #374151;
    color: #ffffff;
    border: 1px solid #4b5563;
}

.about-button.secondary-button:hover {
    background-color: #4b5563;
    transform: translateY(-2px);
}

.button-icon {
    width: 1rem;
    height: 1rem;
}

.about-creator {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #303030;
}

.creator-text {
    font-size: 1.125rem;
    color: #ffffff;
    margin-bottom: 1.5rem;
}

.creator-link {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.creator-link:hover {
    color: #60a5fa;
    text-decoration: underline;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: #374151;
    border-radius: 0.5rem;
    color: #ffffff;
    text-decoration: none;
    transition: all 0.2s;
}

.social-link:hover {
    background-color: #4b5563;
    transform: translateY(-2px);
}

.social-icon {
    width: 1.25rem;
    height: 1.25rem;
}

@media (max-width: 768px) {
    .about-main {
        padding: 1rem;
    }
    
    .about-content {
        padding: 2rem;
    }
    
    .about-logo {
        width: 3.5rem;
        height: 3.5rem;
    }
    
    .about-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .about-description p {
        font-size: 1rem;
        line-height: 1.6;
        margin-bottom: 1.25rem;
    }
    
    .about-buttons {
        margin-bottom: 2rem;
        gap: 0.75rem;
    }
    
    .about-button {
        padding: 0.625rem 1.25rem;
        font-size: 0.95rem;
        min-width: 140px;
    }
    
    .about-creator {
        padding-top: 1.5rem;
    }
    
    .creator-text {
        font-size: 1rem;
        margin-bottom: 1.25rem;
    }
    
    .social-links {
        gap: 0.75rem;
    }
    
    .social-link {
        width: 2.25rem;
        height: 2.25rem;
    }
    
    .social-icon {
        width: 1.125rem;
        height: 1.125rem;
    }
}

@media (max-width: 480px) {
    .about-content {
        padding: 1.5rem;
    }
    
    .about-logo {
        width: 3rem;
        height: 3rem;
    }
    
    .about-title {
        font-size: 1.75rem;
    }
    
    .about-description p {
        font-size: 0.95rem;
    }
    
    .about-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
    }
    
    .about-button {
        width: 100%;
        max-width: 200px;
        min-width: auto;
    }
}

/* --- VoidZero-inspired redesign layer --- */
:root {
    --bg-0: #05070d;
    --bg-1: #0b1020;
    --bg-2: #121a30;
    --surface: rgba(16, 23, 43, 0.78);
    --surface-strong: rgba(20, 29, 53, 0.92);
    --border: rgba(148, 163, 184, 0.2);
    --text-0: #f8fafc;
    --text-1: #cbd5e1;
    --text-2: #94a3b8;
    --brand: #fbbf24;
    --brand-strong: #f59e0b;
    --ok: #22c55e;
    --danger: #ef4444;
    --shadow-lg: 0 22px 48px rgba(2, 6, 23, 0.45);
    --radius-md: 14px;
    --radius-lg: 20px;
}

html {
    scroll-behavior: smooth;
}

body {
    background:
        radial-gradient(circle at 10% 10%, rgba(251, 191, 36, 0.12), transparent 36%),
        radial-gradient(circle at 85% 5%, rgba(59, 130, 246, 0.14), transparent 34%),
        linear-gradient(180deg, var(--bg-0), var(--bg-1) 38%, var(--bg-0));
    color: var(--text-0);
}

/* Phones: flat background; gradient stays on wider viewports only. */
@media (max-width: 768px) {
    body {
        background: var(--bg-0);
    }
}

a {
    color: inherit;
}

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(12px);
    background: rgba(5, 7, 13, 0.78);
}

.header-container,
.games-container,
.footer-container {
    max-width: 74rem;
}

.logo {
    letter-spacing: normal;
    font-size: 1rem;
    font-weight: 700;
}

.nav-link,
.mobile-menu-link {
    color: var(--text-1);
    font-weight: 500;
}

.nav-link:hover,
.mobile-menu-link:hover,
.nav-link.active,
.mobile-menu-link.active {
    color: var(--text-0);
}

.mobile-menu {
    border-color: var(--border);
    background: var(--surface-strong);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.hero {
    padding: 6rem 1rem 4rem;
    background: transparent;
}

.hero-container {
    max-width: 68rem;
}

.hero-logo {
    width: 6.75rem;
    height: 6.75rem;
    filter:
        drop-shadow(0 0 14px rgba(251, 191, 36, 0.3))
        drop-shadow(0 0 32px rgba(251, 191, 36, 0.2));
}

.hero-title {
    font-size: clamp(2.4rem, 6vw, 4.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hero-description {
    color: var(--text-1);
    max-width: 42rem;
}

.hero-button,
.about-button.primary-button,
.dashboard-action-button.play-button {
    background: linear-gradient(130deg, var(--brand), var(--brand-strong));
    color: #111827;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.28);
}

.hero-button:hover,
.about-button.primary-button:hover,
.dashboard-action-button.play-button:hover {
    transform: translateY(-2px);
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.22), transparent 46%),
        linear-gradient(130deg, #fcd34d, #f59e0b);
    filter: brightness(1.04);
    box-shadow:
        0 12px 30px rgba(245, 158, 11, 0.3),
        0 0 22px rgba(251, 191, 36, 0.28);
}

.games-section {
    background: transparent;
    padding: 2rem 1rem 3.5rem;
}

.game-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.28);
}

.game-card:hover {
    background: var(--surface-strong);
    border-color: rgba(251, 191, 36, 0.35);
    transform: translateY(-5px);
    box-shadow:
        0 24px 48px rgba(2, 6, 23, 0.42),
        0 0 26px rgba(251, 191, 36, 0.16);
}

.game-card-icon {
    color: var(--brand);
}

.game-card-title {
    font-weight: 650;
}

.game-card-description {
    color: var(--text-2);
}

.game-card:active {
    transform: translateY(-2px);
}

.footer {
    margin-top: 2.25rem;
    background: transparent;
    border-top: 1px solid var(--border);
}

.footer-brand,
.creator-text {
    color: var(--text-0);
}

.amtf-text,
.footer-copyright {
    color: var(--text-2);
}

.about-main,
.dashboard-main {
    background: transparent;
}

.about-content,
.dashboard-tests-card,
.dashboard-summary-card,
.dashboard-profile-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.about-title {
    font-size: clamp(2rem, 4vw, 3rem);
}

.about-description p {
    color: var(--text-1);
}

.about-button.secondary-button,
.dashboard-action-button.stats-button {
    background: rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: var(--text-0);
}

.about-button.secondary-button:hover,
.dashboard-action-button.stats-button:hover {
    background: rgba(148, 163, 184, 0.25);
}

.social-link {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.social-link:hover {
    background: rgba(148, 163, 184, 0.2);
}

.dashboard-main {
    max-width: 74rem;
    padding-top: 3rem;
    padding-bottom: 1rem;
}

.dashboard-tests-table-header {
    border-bottom-color: var(--border);
}

.dashboard-tests-table-row {
    border-bottom-color: rgba(148, 163, 184, 0.16);
}

.dashboard-tests-table-cell.header-cell {
    color: var(--text-2);
}

.dashboard-tests-table-cell.test-name {
    color: var(--text-0);
}

.dashboard-hero {
    padding: 1rem 0 0;
}

.dashboard-hero-container {
    text-align: left;
    max-width: 100%;
}

.dashboard-hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.75rem;
}

.dashboard-hero-copy {
    margin: 0;
    max-width: 56rem;
}

.error-page {
    min-height: calc(100vh - 3.5rem - 14rem);
}

.error-page .hero {
    width: 100%;
}

.error-page-body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.error-page-body .error-page {
    flex: 1;
}

.error-page-body .footer {
    margin-top: 0;
}

.seo-content-section {
    padding-top: 0.5rem;
}

.seo-content-container {
    max-width: 56rem;
    gap: 0.9rem;
}

.seo-heading {
    font-size: clamp(1.25rem, 2.6vw, 1.8rem);
    font-weight: 650;
    color: var(--text-0);
    margin: 0.5rem 0 0.2rem;
}

.seo-copy {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-1);
    margin: 0;
}

.seo-link {
    color: var(--brand);
    text-decoration: none;
}

.seo-link:hover {
    color: #fcd34d;
    text-decoration: underline;
}

/* Stats page */
.stats-page-body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.stats-page-body .stats-main {
    flex: 1;
}

.stats-main {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
}

.stats-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--text-1, #9ca3af);
}

.stats-breadcrumb-link {
    color: var(--brand, #fbbf24);
    text-decoration: none;
}

.stats-breadcrumb-link:hover {
    text-decoration: underline;
}

.stats-breadcrumb-sep {
    opacity: 0.5;
}

.stats-breadcrumb-current {
    color: var(--text-0, #f8fafc);
}

.stats-hero {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.stats-hero-title-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
}

.stats-hero-icon {
    width: 1.75rem;
    height: 1.75rem;
    color: var(--brand, #fbbf24);
}

.stats-title {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    color: var(--text-0, #f8fafc);
    margin: 0;
}

.stats-lede {
    margin: 0;
    color: var(--text-1, #9ca3af);
    font-size: 0.9375rem;
    line-height: 1.55;
    max-width: 36rem;
}

.stats-meta {
    margin: 0.5rem 0 0;
    font-size: 0.8125rem;
    color: #6b7280;
}

.stats-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 999px;
    background: linear-gradient(130deg, var(--brand, #fbbf24), var(--brand-strong, #f59e0b));
    color: #111827;
    font-weight: 600;
    font-size: 0.9375rem;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.28);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.28);
    transition: transform 0.2s, filter 0.2s;
    flex-shrink: 0;
}

.stats-play-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
    color: #111827;
}

.stats-play-btn--inline {
    margin-top: 0.5rem;
}

.stats-play-icon {
    width: 1rem;
    height: 1rem;
}

.stats-state-card {
    background: var(--surface, rgba(16, 23, 43, 0.78));
    border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
    border-radius: var(--radius-lg, 0.75rem);
    padding: 2rem 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.35));
}

.stats-state-text {
    margin: 0 0 1rem;
    color: var(--text-1, #9ca3af);
    font-size: 0.9375rem;
    line-height: 1.55;
}

.stats-secondary-btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    background: rgba(148, 163, 184, 0.15);
    color: var(--text-0, #f8fafc);
    text-decoration: none;
    font-size: 0.875rem;
}

.stats-secondary-btn:hover {
    background: rgba(148, 163, 184, 0.25);
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.875rem;
    margin-bottom: 1.25rem;
}

.stats-summary-card {
    background: var(--surface, rgba(16, 23, 43, 0.78));
    border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1rem 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.stats-summary-card--highlight {
    border-color: rgba(251, 191, 36, 0.35);
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.08), rgba(16, 23, 43, 0.85));
}

.stats-summary-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.stats-summary-value {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-0, #f8fafc);
    line-height: 1.2;
}

.stats-summary-card--highlight .stats-summary-value {
    color: var(--brand, #fbbf24);
}

.stats-charts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.stats-chart-card {
    background: var(--surface, rgba(16, 23, 43, 0.78));
    border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1.25rem 1.25rem 1rem;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.35));
    overflow: hidden;
}

.stats-chart-header {
    margin-bottom: 1rem;
}

.stats-chart-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-0, #f8fafc);
}

.stats-chart-subtitle {
    margin: 0.3rem 0 0;
    font-size: 0.8125rem;
    color: #9ca3af;
    line-height: 1.45;
}

.stats-chart-canvas-wrap {
    position: relative;
    height: 280px;
    width: 100%;
}

.stats-chart-canvas-wrap--short {
    height: 220px;
}

.stats-history-card {
    background: var(--surface, rgba(16, 23, 43, 0.78));
    border: 1px solid var(--border, rgba(148, 163, 184, 0.2));
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg, 0 10px 40px rgba(0, 0, 0, 0.35));
}

.stats-history-header {
    margin-bottom: 1rem;
}

.stats-history-empty {
    color: #9ca3af;
    font-size: 0.9375rem;
    margin: 0;
}

.stats-history-wrap {
    overflow-x: auto;
}

.stats-history-grid {
    display: grid;
    grid-template-columns: 3rem 1fr minmax(5rem, 8rem);
    gap: 0.5rem 1rem;
    align-items: center;
}

.stats-history-grid--head {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    margin-bottom: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9ca3af;
}

.stats-history-row {
    display: grid;
    grid-template-columns: 3rem 1fr minmax(5rem, 8rem);
    gap: 0.5rem 1rem;
    align-items: center;
    padding: 0.625rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    font-size: 0.875rem;
}

.stats-history-row:last-child {
    border-bottom: none;
}

.stats-history-col--num {
    color: #6b7280;
    font-variant-numeric: tabular-nums;
}

.stats-history-date-line1 {
    color: var(--text-0, #f8fafc);
}

.stats-history-date-line2 {
    font-size: 0.75rem;
    color: #6b7280;
}

.stats-history-col--score {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.stats-history-score-num {
    font-weight: 600;
    color: var(--text-0, #f8fafc);
}

.stats-history-score-suffix {
    font-size: 0.8125rem;
    color: #9ca3af;
    margin-left: 0.125rem;
}

@media (min-width: 768px) {
    .stats-charts-grid {
        grid-template-columns: 1.4fr 1fr;
    }

    .stats-chart-card--wide {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .stats-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .stats-main {
        padding: 1.25rem 0.75rem 2rem;
    }

    .stats-hero {
        flex-direction: column;
    }
}
