/* ============================================
   Chess Mouse Speed — Dark Racing Theme
   Inspired by ChessMouseSpeed.com logos:
   deep black · blood red · fire orange · white
   ============================================ */

/* ============================================
   Design Tokens
   ============================================ */
:root {
    --black:        #080808;
    --dark:         #111111;
    --dark-2:       #181818;
    --dark-3:       #222222;
    --panel:        #1a1a1a;
    --panel-raised: #212121;

    --red:          #d4231b;
    --red-bright:   #e8281f;
    --red-glow:     rgba(212, 35, 27, 0.35);

    --orange:       #f5a623;
    --orange-dim:   #c4831a;
    --orange-glow:  rgba(245, 166, 35, 0.3);

    --gold:         #cfa43a;

    --white:        #ffffff;
    --off-white:    #e8e8e8;
    --muted:        #666666;
    --muted-2:      #3a3a3a;

    --border:       rgba(255,255,255,0.07);
    --border-hot:   rgba(245, 166, 35, 0.4);

    --sq-light:     #f0d9b5;
    --sq-dark:      #b58863;

    --grad-fire:    linear-gradient(135deg, var(--red-bright) 0%, var(--orange) 100%);
    --grad-dark:    linear-gradient(180deg, var(--dark-2), var(--dark));

    --ease-snap:    cubic-bezier(0.2, 0.8, 0.2, 1);
    --t-fast:       120ms;
    --t-mid:        200ms;
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { font-size: 16px; }

body {
    font-family: 'Rajdhani', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--black);
    color: var(--off-white);
    line-height: 1.5;
    overflow-x: hidden;
    /* Subtle red radial glow at top, like a track spotlight */
    background-image:
        radial-gradient(ellipse 90% 40% at 50% -5%, rgba(212,35,27,0.1) 0%, transparent 65%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.018'/%3E%3C/svg%3E");
}

/* ============================================
   App Shell
   ============================================ */
.app-shell {
    display: grid;
    grid-template-columns: 210px 1fr 270px;
    grid-template-rows: auto 1fr auto;
    grid-template-areas:
        "header header header"
        "left   main   right"
        "footer footer footer";
    min-height: 100vh;
}

.header        { grid-area: header; }
.left-sidebar  { grid-area: left; }
.main-content  { grid-area: main; }
.right-sidebar { grid-area: right; }
.footer        { grid-area: footer; }

/* ============================================
   Typography
   ============================================ */
h1, h2, h3 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ============================================
   Header
   ============================================ */
.header {
    background: var(--black);
    border-bottom: 1px solid var(--border);
    /* Racing double-stripe */
    box-shadow: 0 1px 0 0 var(--red), 0 2px 0 0 var(--orange);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 1.5rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: transform var(--t-fast) var(--ease-snap), filter var(--t-fast);
    text-decoration: none;
}
.logo:hover {
    transform: translateY(-1px);
    filter: brightness(1.1);
}
.logo-img {
    height: 42px;
    width: auto;
    display: block;
}
/* Fallback text logo */
.logo-icon { display: none; }
.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--white);
    letter-spacing: -0.01em;
    line-height: 1;
}
.logo-highlight { color: var(--orange); }

.header-nav .tagline {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.16em;
    font-weight: 600;
    color: var(--orange);
    opacity: 0.95;
}

.nav-learn-link {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--white);
    text-decoration: none;
    background: var(--dark-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 0.3rem 0.7rem;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.nav-learn-link:hover {
    background: var(--orange);
    border-color: var(--orange);
    color: #fff;
}

/* Sidebar article cards */
.sidebar-articles { padding: 0.75rem; }
.sidebar-article-link {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--off-white);
    font-size: 0.78rem;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 500;
    line-height: 1.35;
    transition: color 0.15s;
}
.sidebar-article-link:last-of-type { border-bottom: none; }
.sidebar-article-link:hover { color: var(--orange); }
.sidebar-article-icon { font-size: 0.85rem; flex-shrink: 0; margin-top: 1px; }
.sidebar-article-text { flex: 1; }
.sidebar-article-all {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', monospace;
    color: var(--orange);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.15s;
}
.sidebar-article-all:hover { opacity: 1; }

.header-controls { display: flex; gap: 0.5rem; }

.icon-btn {
    width: 38px;
    height: 38px;
    background: var(--dark-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t-fast) var(--ease-snap);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}
.icon-btn:hover {
    background: var(--dark-2);
    border-color: var(--orange);
    color: var(--orange);
    transform: translateY(-1px);
    box-shadow: 0 0 10px var(--orange-glow);
}
.icon-btn:active { transform: translateY(0); }

.sound-off { display: none; }
.sound-muted .sound-on { display: none; }
.sound-muted .sound-off { display: block; }

/* ============================================
   SEO
   ============================================ */
.seo-content {
  max-width: 900px;
  margin: 60px auto;
  padding: 0 20px;
  color: #ccc;
  line-height: 1.7;
}
.seo-content h2,
.seo-content h3 {
  color: #f5a623;
  margin-bottom: 10px;
}

/* ============================================
   Legal
   ============================================ */

.help-legal {
  margin-top: 30px;
  text-align: center;
}

.help-legal a {
  color: var(--accent-orange);
  text-decoration: none;
  font-weight: 600;
}

.help-legal a:hover {
  text-decoration: underline;
}

/* ============================================
   Sidebars
   ============================================ */
.left-sidebar,
.right-sidebar {
    background: var(--dark);
    border-right: 1px solid var(--border);
    padding: 1.25rem 1rem;
    overflow-y: auto;
    max-height: calc(100vh - 56px);
    position: sticky;
    top: 56px;
    align-self: start;
}
.right-sidebar {
    border-right: none;
    border-left: 1px solid var(--border);
}

.sidebar-section { margin-bottom: 2rem; }

.sidebar-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--orange);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}
.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: -1px; left: 0;
    width: 1.5rem; height: 1px;
    background: var(--red);
}

/* Stats */
.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
}
.stat-label {
    font-size: 0.68rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    color: var(--orange);
    font-size: 0.875rem;
}

/* Leaderboard */
.leaderboard { display: flex; flex-direction: column; gap: 0.3rem; }

.leaderboard-item {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 0.5rem;
    align-items: center;
    padding: 0.4rem 0.5rem;
    background: var(--dark-2);
    border-radius: 3px;
    border-left: 2px solid transparent;
    transition: all var(--t-fast) var(--ease-snap);
    font-size: 0.78rem;
    cursor: default;
}
.leaderboard-item:hover {
    background: var(--dark-3);
    border-left-color: var(--orange);
    transform: translateX(2px);
}
.leaderboard-item.rank-1 {
    border-left-color: var(--gold);
    background: linear-gradient(90deg, rgba(207,164,58,0.12), var(--dark-2));
}
.leaderboard-item.rank-2 {
    border-left-color: #a0a0a0;
    background: linear-gradient(90deg, rgba(160,160,160,0.07), var(--dark-2));
}
.leaderboard-item.rank-3 {
    border-left-color: #c87533;
    background: linear-gradient(90deg, rgba(200,117,51,0.07), var(--dark-2));
}
.leaderboard-item .rank {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--muted);
    font-weight: 600;
}
.leaderboard-item .name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--off-white);
    font-weight: 500;
}
.leaderboard-item .points {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    color: var(--orange);
    font-size: 0.68rem;
}

/* Support */
.support-section {
    background: linear-gradient(135deg, rgba(212,35,27,0.08), rgba(245,166,35,0.04));
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.1rem;
}
.support-text {
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 0.875rem;
    line-height: 1.4;
}
.support-btn {
    display: block;
    width: 100%;
    text-align: center;
    text-decoration: none;
}
.support-btn img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 3px;
    transition: opacity var(--t-fast), transform var(--t-fast) var(--ease-snap);
}
.support-btn img:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

/* ============================================
   Ad
   ============================================ */

.promo-placeholder {
    background: var(--dark-2);
    border: 1px dashed var(--border);
    border-radius: 4px;
    min-height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Make ad box clickable */
.promo-placeholder.promo-link {
    text-decoration: none;
    color: inherit;
    transition: all var(--t-fast) var(--ease-snap);
    cursor: pointer;
}

.promo-placeholder.promo-link:hover {
    border-color: var(--border-hot);
    box-shadow: 0 0 18px var(--orange-glow);
    transform: translateY(-2px);
}

/* Text inside ad */
.promo-content {
    color: var(--off-white);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-align: center;
}

/* Subtext */
.promo-subtext {
    display: block;
    margin-top: 6px;
    font-size: 0.65rem;
    color: var(--orange);
    opacity: 0.9;
    letter-spacing: 0.08em;
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
    padding: 0.5rem 2rem 2rem;
    min-height: calc(100vh - 120px);
    background: var(--black);
}

/* ============================================
   Screens
   ============================================ */
.screen { display: none; }
.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: screenIn 180ms var(--ease-snap) both;
}
@keyframes screenIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   Main Menu
   ============================================ */
.menu-container {
    text-align: center;
    max-width: 920px;
    width: 100%;
    padding-top: 10px;
}

.main-title {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    margin: 0 0 10px 0;
}
.title-top {
    font-size: clamp(1.25rem, 3.5vw, 2rem);
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.3em;
    line-height: 1;
    margin-bottom: 0.1em;
}
.title-bottom {
    font-size: clamp(2.5rem, 7vw, 4.5rem);
    font-weight: 900;
    line-height: 1;
    letter-spacing: 0.04em;
    background: linear-gradient(135deg, var(--red-bright) 0%, var(--orange) 55%, #ffd060 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 40px var(--red-glow));
}

/* Mode grid */
.mode-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
    gap: 0.875rem;
}

.mode-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.5rem 1rem 1.25rem;
    text-align: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all var(--t-fast) var(--ease-snap);
}
/* speed-line corner accent */
.mode-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 0; height: 0;
    border-style: solid;
    border-width: 0 28px 28px 0;
    border-color: transparent var(--dark-3) transparent transparent;
    transition: border-color var(--t-fast);
}
.mode-card:hover {
    transform: translateY(-3px);
    border-color: var(--red);
    background: var(--panel-raised);
    box-shadow:
        0 0 0 1px rgba(212,35,27,0.5),
        0 10px 30px rgba(0,0,0,0.5),
        0 0 25px var(--red-glow);
}
.mode-card:hover::after { border-color: transparent var(--red) transparent transparent; }
.mode-card:active { transform: translateY(-1px); }

.mode-number {
    position: absolute;
    top: 0.5rem; left: 0.6rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    color: var(--muted-2);
    font-weight: 600;
}

.mode-icon {
    font-size: 2.25rem;
    margin-bottom: 0.5rem;
    color: var(--orange);
    display: block;
    transition: transform var(--t-fast) var(--ease-snap), color var(--t-fast);
}
.mode-card:hover .mode-icon {
    color: var(--red-bright);
    transform: scale(1.12);
}

.mode-card h3 {
    font-size: 0.82rem;
    letter-spacing: 0.1em;
    color: var(--white);
    margin-bottom: 0.3rem;
}
.mode-card p {
    font-size: 0.7rem;
    color: var(--muted);
    line-height: 1.3;
}

.mode-bar {
    height: 2px;
    background: var(--grad-fire);
    position: absolute;
    bottom: 0; left: 0; right: 0;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-mid) var(--ease-snap);
}
.mode-card:hover .mode-bar { transform: scaleX(1); }


/* ============================================
   Featured / Staff Picks Row
   ============================================ */

.featured-label,
.all-modes-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    color: var(--orange);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.featured-label::after,
.all-modes-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border-hot), transparent);
}
.all-modes-label {
    margin-top: 1.75rem;
    color: var(--muted);
}
.all-modes-label::after {
    background: linear-gradient(90deg, var(--border), transparent);
}

/* Featured card grid — two equal columns */
.mode-grid-featured {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.875rem;
    margin-bottom: 0;
}

/* Base featured card — inherits .mode-card, adds upgrades */
.mode-card--featured {
    padding: 1.75rem 1.5rem 1.5rem;
    background: linear-gradient(160deg, #1e1a10 0%, var(--panel) 60%);
    border-color: rgba(245, 166, 35, 0.35);
    position: relative;
}
.mode-card--featured::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(160deg, rgba(245,166,35,0.07) 0%, transparent 55%);
    pointer-events: none;
}
.mode-card--featured:hover {
    border-color: var(--orange);
    box-shadow:
        0 0 0 1px rgba(245,166,35,0.6),
        0 12px 36px rgba(0,0,0,0.55),
        0 0 32px var(--orange-glow);
    transform: translateY(-4px);
}
.mode-card--featured .mode-icon {
    font-size: 2.75rem;
    color: var(--orange);
}
.mode-card--featured h3 {
    font-size: 0.95rem;
    letter-spacing: 0.12em;
}
.mode-card--featured p {
    font-size: 0.78rem;
    color: #999;
    line-height: 1.4;
}

/* yohfish featured card — ocean-blue treatment */
.mode-card--featured-yohfish {
    background: linear-gradient(160deg, #0a1520 0%, var(--panel) 60%);
    border-color: rgba(64, 180, 230, 0.4);
}
.mode-card--featured-yohfish::before {
    background: linear-gradient(160deg, rgba(64,180,230,0.09) 0%, transparent 55%);
}
.mode-card--featured-yohfish .mode-icon {
    color: #40b4e6;
}
.mode-card--featured-yohfish:hover {
    border-color: #40b4e6;
    box-shadow:
        0 0 0 1px rgba(64,180,230,0.6),
        0 12px 36px rgba(0,0,0,0.55),
        0 0 32px rgba(64,180,230,0.3);
}

/* yohfish badge */
.featured-badge--fish {
    background: linear-gradient(135deg, #40b4e6, #5ecbf7);
    color: var(--black);
    box-shadow: 0 0 10px rgba(64,180,230,0.45);
}

/* King Survival featured card gets the gold treatment */
.mode-card--featured-king {
    background: linear-gradient(160deg, #191508 0%, var(--panel) 60%);
    border-color: rgba(207,164,58,0.4);
}
.mode-card--featured-king::before {
    background: linear-gradient(160deg, rgba(207,164,58,0.09) 0%, transparent 55%);
}
.mode-card--featured-king .mode-icon {
    color: var(--gold);
}
.mode-card--featured-king:hover {
    border-color: var(--gold);
    box-shadow:
        0 0 0 1px rgba(207,164,58,0.6),
        0 12px 36px rgba(0,0,0,0.55),
        0 0 32px rgba(207,164,58,0.3);
}

/* Badge pill in top-right of featured cards */
.featured-badge {
    position: absolute;
    top: 0.6rem;
    right: 0.6rem;
    background: var(--red);
    color: var(--white);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.52rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    padding: 0.22rem 0.55rem;
    border-radius: 3px;
    box-shadow: 0 0 10px var(--red-glow);
    text-transform: uppercase;
}
.featured-badge--gold {
    background: linear-gradient(135deg, var(--gold), #ecca55);
    color: var(--black);
    box-shadow: 0 0 10px rgba(207,164,58,0.45);
}

/* Mobile: stack featured cards */
@media (max-width: 900px) {
    .mode-grid-featured {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 600px) {
    .mode-grid-featured {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Settings Screen
   ============================================ */
.settings-container {
    max-width: 480px;
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.back-btn {
    position: relative;
    align-self: flex-start;
    width: 100%;
    text-align: left;
    margin-bottom: 1.5rem;
    background: transparent;
    border: none;
    color: var(--muted);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-snap);
    letter-spacing: 0.1em;
    padding: 0;
}
.back-btn:hover {
    color: var(--orange);
    transform: translateX(-3px);
}

.settings-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    letter-spacing: 0.1em;
    background: var(--grad-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.settings-group { margin-bottom: 1.75rem; }
.settings-group label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.option-btn {
    padding: 0.65rem 1.4rem;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--panel);
    color: var(--off-white);
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-snap);
    letter-spacing: 0.05em;
}
.option-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    background: var(--panel-raised);
    transform: translateY(-1px);
}
.option-btn:active { transform: translateY(0); }
.option-btn.active {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
    box-shadow: 0 0 14px var(--red-glow), 0 2px 8px rgba(0,0,0,0.5);
}

.option-btn--superhard.active {
    background: linear-gradient(135deg, #7b1fa2, #c62828);
    border-color: #7b1fa2;
    box-shadow: 0 0 14px rgba(123,31,162,0.6), 0 2px 8px rgba(0,0,0,0.5);
}
.option-btn--superhard:hover {
    border-color: #7b1fa2;
    color: #ce93d8;
}

.piece-group .option-btn { font-size: 1rem; padding: 0.5rem 0.8rem; }

.personal-best {
    background: linear-gradient(135deg, rgba(212,35,27,0.1), rgba(245,166,35,0.06));
    border: 1px solid rgba(207,164,58,0.2);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 1.75rem 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.pb-label {
    font-family: 'Orbitron', sans-serif;
    color: var(--muted);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
}
.pb-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gold);
}

.start-btn {
    width: 100%;
    padding: 1.125rem 2rem;
    background: var(--grad-fire);
    border: none;
    border-radius: 6px;
    color: var(--white);
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    letter-spacing: 0.12em;
    transition: all var(--t-fast) var(--ease-snap);
    box-shadow: 0 4px 24px var(--red-glow), 0 2px 6px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}
.start-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 50%);
    opacity: 0;
    transition: opacity var(--t-fast);
}
.start-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 32px var(--red-glow), 0 0 0 1px rgba(245,166,35,0.5);
}
.start-btn:hover::before { opacity: 1; }
.start-btn:active { transform: translateY(0); }

.key-hint {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.62rem;
    opacity: 0.75;
}

/* ============================================
   Game Screen
   ============================================ */
.game-container { max-width: 820px; width: 100%; }

.game-body {
    display: flex;
    flex-direction: row;
    gap: 1.25rem;
    align-items: flex-start;
}

.game-side-panel {
    flex: 1;
    min-width: 160px;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-top: 1.25rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    padding: 0.875rem 1.25rem;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: inset 0 1px 0 0 rgba(212,35,27,0.4);
}

.game-info { display: flex; gap: 2.5rem; }
.info-item { text-align: center; }
.info-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 0.2rem;
    font-weight: 700;
}
.info-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}
.timer-value { color: var(--orange); }
.score-value { color: var(--red-bright); }
.streak-value { color: var(--gold); }

.pause-btn {
    padding: 0.55rem 1rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--t-fast) var(--ease-snap);
}
.pause-btn:hover {
    border-color: var(--orange);
    color: var(--orange);
    transform: translateY(-1px);
}
.pause-btn:active { transform: translateY(0); }

/* ============================================
   Chess Board
   ============================================ */
.board-wrapper {
    position: relative;
    padding: 1.25rem;
    margin: 0 auto;
    touch-action: none;
    overscroll-behavior: contain;
    -webkit-user-select: none;
    user-select: none;
}

.board-labels {
    position: absolute;
    display: flex;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    color: #999;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}
.board-labels-files {
    bottom: 0.2rem;
    left: 1.25rem; right: 1.25rem;
    justify-content: space-around;
}
.board-labels-ranks {
    flex-direction: column;
    top: 1.25rem; bottom: 1.25rem;
    left: 0.2rem;
    justify-content: space-around;
}

.chessboard {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: min(560px, 70vw);
    height: min(560px, 70vw);
    border: 3px solid var(--dark-3);
    border-radius: 3px;
    box-shadow:
        0 0 0 1px rgba(212,35,27,0.5),
        0 16px 48px rgba(0,0,0,0.7),
        0 0 80px rgba(0,0,0,0.5);
    overflow: hidden;
    user-select: none;
}

.chessboard, .square {
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.square {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-snap);
}
.square.light { background: var(--sq-light); }
.square.dark  { background: var(--sq-dark); }

.square.highlight {
    background: var(--orange) !important;
    animation: pulseHL 160ms ease;
}
@keyframes pulseHL {
    0%, 100% { filter: brightness(1); }
    50%       { filter: brightness(1.25); }
}

.square.highlight-subtle {
    box-shadow: inset 0 0 22px rgba(245,166,35,0.5);
}

.square.target {
    background: var(--orange) !important;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.2), 0 0 14px var(--orange-glow);
}

.square.selected {
    background: var(--red) !important;
    box-shadow: 0 0 16px var(--red-glow);
}

.square.error { animation: errShake 160ms ease; }
@keyframes errShake {
    0%, 100% { transform: translateX(0); }
    25%  { transform: translateX(-4px); background: var(--red) !important; }
    75%  { transform: translateX(4px);  background: var(--red) !important; }
}

/* Knight Maze danger squares — persistent red tint */
.square.danger {
    background: rgba(212, 35, 27, 0.45) !important;
    box-shadow: inset 0 0 12px rgba(212, 35, 27, 0.3);
}

.square.clicked::after {
    content: '';
    position: absolute;
    width: 28px; height: 28px;
    background: rgba(255,255,255,0.65);
    border-radius: 50%;
    animation: ripple 200ms ease-out forwards;
    pointer-events: none;
}
@keyframes ripple {
    from { transform: scale(0); opacity: 1; }
    to   { transform: scale(2.5); opacity: 0; }
}

.piece {
    font-size: min(3.75rem, 8.5vw);
    line-height: 1;
    pointer-events: none;
    z-index: 10;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
    /* Force text (not emoji) rendering of Unicode chess glyphs on iOS Safari */
    font-variant-emoji: text;
}
.piece.white {
    color: #f0f0f0;
    /* iOS Safari ignores `color` on emoji-classified glyphs; these two properties
       force the fill colour and add a dark outline so white pieces are visible
       against both light and dark squares. */
    -webkit-text-fill-color: #f0f0f0;
    -webkit-text-stroke: 0.5px rgba(0, 0, 0, 0.55);
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}
.piece.black {
    color: #111111;
    -webkit-text-fill-color: #111111;
    -webkit-text-stroke: 0.5px rgba(255, 255, 255, 0.25);
}

.piece.dragging {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    transform: scale(1.2);
    cursor: grabbing;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.7));
}

.square.drag-over {
    outline: 3px solid var(--orange);
    outline-offset: -3px;
}

.game-instruction {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--off-white);
    letter-spacing: 0.06em;
    line-height: 1.6;
    opacity: 0.9;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1rem;
}

.rhythm-feedback {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold);
    text-align: center;
    letter-spacing: 0.08em;
    min-height: 1.5em;
    padding: 0.5rem;
    transition: opacity 0.2s;
}

/* ============================================
   Overlays
   ============================================ */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 200;
    backdrop-filter: blur(6px);
}
.overlay.active {
    display: flex;
    animation: fadeIn 150ms ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.overlay-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: 2px solid var(--red);
    border-radius: 8px;
    padding: 2.5rem;
    text-align: center;
    max-width: 370px;
    width: 90%;
    box-shadow: 0 0 0 1px rgba(212,35,27,0.25), 0 24px 60px rgba(0,0,0,0.7);
}
.overlay-content h2 {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    letter-spacing: 0.12em;
    background: var(--grad-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.pause-stats {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: var(--muted);
    margin-bottom: 1.5rem;
    line-height: 2;
}

.resume-btn {
    width: 100%;
    padding: 0.875rem;
    background: var(--grad-fire);
    border: none;
    border-radius: 4px;
    color: var(--white);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: 0.625rem;
    transition: all var(--t-fast) var(--ease-snap);
    letter-spacing: 0.08em;
    box-shadow: 0 4px 18px var(--red-glow);
}
.resume-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 22px var(--red-glow); }
.resume-btn:active { transform: translateY(0); }

.quit-btn {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--muted);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-snap);
}
.quit-btn:hover { border-color: var(--red); color: var(--red); }

/* ============================================
   Results Screen
   ============================================ */
.results-container { max-width: 480px; width: 100%; text-align: center; }

.results-title {
    font-size: 2.25rem;
    margin-bottom: 0.25rem;
    letter-spacing: 0.1em;
    background: var(--grad-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}
.results-mode {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 2rem;
    letter-spacing: 0.14em;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.75rem;
}
.result-item {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 1.1rem;
    transition: border-color var(--t-fast);
}
.result-item:hover { border-color: var(--border-hot); }
.result-label {
    display: block;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.58rem;
    letter-spacing: 0.14em;
    color: var(--muted);
    margin-bottom: 0.4rem;
    font-weight: 700;
}
.result-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--off-white);
}
.result-value.highlight { color: var(--gold); }

.new-record {
    background: linear-gradient(135deg, var(--gold), #ecca55);
    color: var(--black);
    padding: 0.875rem 1rem;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    margin-bottom: 1.75rem;
    letter-spacing: 0.08em;
    animation: popIn 200ms var(--ease-snap) both;
    box-shadow: 0 0 30px rgba(207,164,58,0.45);
}
@keyframes popIn {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.results-actions { display: flex; gap: 0.75rem; }
.retry-btn {
    flex: 1;
    padding: 0.875rem;
    background: var(--grad-fire);
    border: none;
    border-radius: 4px;
    color: var(--white);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-snap);
    letter-spacing: 0.08em;
    box-shadow: 0 3px 16px var(--red-glow);
}
.retry-btn:hover { transform: translateY(-1px); box-shadow: 0 5px 22px var(--red-glow); }
.retry-btn:active { transform: translateY(0); }

.menu-btn {
    flex: 1;
    padding: 0.875rem;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--off-white);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t-fast) var(--ease-snap);
    letter-spacing: 0.05em;
}
.menu-btn:hover { border-color: var(--orange); color: var(--orange); }

/* ============================================
   Help Modal
   ============================================ */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 300;
    padding: 2rem;
}
.modal.active {
    display: flex;
    animation: fadeIn 150ms ease;
}

.modal-content {
    background: var(--panel);
    border: 1px solid var(--border);
    border-top: 2px solid var(--orange);
    border-radius: 8px;
    padding: 2rem;
    max-width: 560px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 0 0 1px rgba(245,166,35,0.15), 0 24px 60px rgba(0,0,0,0.8);
}
.modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    width: 34px; height: 34px;
    border: 1px solid var(--border);
    background: var(--dark-3);
    border-radius: 50%;
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    transition: all var(--t-fast) var(--ease-snap);
    line-height: 1;
}
.modal-close:hover {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    letter-spacing: 0.1em;
    background: var(--grad-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.help-section { margin-bottom: 1.5rem; text-align: left; }
.help-section h3 {
    font-size: 0.7rem;
    color: var(--orange);
    margin-bottom: 0.75rem;
    letter-spacing: 0.12em;
}

/* Contact modal list */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.contact-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.97rem;
}
.contact-icon {
    font-size: 1rem;
    width: 1.4rem;
    text-align: center;
    flex-shrink: 0;
}
.contact-list a {
    color: var(--off-white);
    text-decoration: none;
    transition: color 0.15s;
    border-bottom: 1px solid transparent;
}
.contact-list a:hover {
    color: var(--orange);
    border-bottom-color: var(--orange);
}
.help-section ul, .help-section dl { margin-left: 0; }
.help-section li {
    margin-bottom: 0.5rem;
    color: var(--off-white);
    font-size: 0.9rem;
    list-style: none;
    padding-left: 0.875rem;
    border-left: 2px solid var(--muted-2);
    margin-left: 0.25rem;
}
.help-section dt {
    font-weight: 700;
    margin-top: 0.75rem;
    color: var(--white);
    font-size: 0.9rem;
}
.help-section dd {
    color: var(--muted);
    margin-left: 0;
    font-size: 0.875rem;
}

kbd {
    display: inline-block;
    padding: 0.18rem 0.45rem;
    background: var(--dark-3);
    border: 1px solid var(--muted-2);
    border-radius: 3px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--off-white);
}

/* ============================================
   Footer
   ============================================ */
.footer {
    background: var(--black);
    border-top: 1px solid var(--border);
    box-shadow: 0 -1px 0 0 var(--red);
    padding: 0.875rem 2rem;
}
.footer-content {
    text-align: center;
    color: var(--muted);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
        grid-template-areas:
            "header"
            "main"
            "right"
            "left"
            "footer";
    }
    .left-sidebar, .right-sidebar {
        border: none;
        border-top: 1px solid var(--border);
        max-height: none;
    }
    .header-nav .tagline { display: none; }
    .logo-img { height: 34px; }
    .main-content { padding: 1rem; }
    .mode-grid { grid-template-columns: 1fr 1fr; }
    .game-info { gap: 1.25rem; }
    .info-value { font-size: 1.5rem; }
    .board-wrapper { padding: 0.75rem; }
    .chessboard { width: min(560px, 88vw); height: min(560px, 88vw); }
    .game-body { flex-direction: column; }
    .game-side-panel { max-width: 100%; min-width: unset; padding-top: 0; flex-direction: row; flex-wrap: wrap; }
    .results-grid { grid-template-columns: 1fr; }
    .results-actions { flex-direction: column; }
    .back-btn { margin-bottom: 1rem; }
    .board-labels { font-size: 0.75rem; color: #aaa; }
}
@media (max-width: 500px) {
    .mode-grid { grid-template-columns: 1fr; }
}

/* ============================================
   Accessibility
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
button:focus-visible, .square:focus-visible {
    outline: 2px solid var(--orange);
    outline-offset: 2px;
}

/* ============================================
   Mode 07-09 additions
   ============================================ */

/* Rhythm game — square stays lit for the full beat */
.square.rhythm-active {
    background: var(--gold) !important;
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.4), 0 0 20px rgba(207,164,58,0.7);
    animation: rhythmPulse 120ms ease-out;
}

.square.rhythm-countdown {
    background: var(--orange) !important;
    box-shadow: inset 0 0 0 3px rgba(255,255,255,0.3);
    animation: rhythmPulse 100ms ease-out;
}

.square.rhythm-preview {
    outline: 2px dashed var(--gold);
    outline-offset: -2px;
    opacity: 0.7;
}

@keyframes rhythmPulse {
    from { transform: scale(1.06); }
    to   { transform: scale(1); }
}

.square.beat-pulse {
    box-shadow: inset 0 0 0 4px var(--orange);
    animation: beatPulse 80ms ease-out;
}

@keyframes beatPulse {
    from { box-shadow: inset 0 0 0 6px var(--orange); }
    to   { box-shadow: inset 0 0 0 0px transparent; }
}

/* ============================================
   Mode 10: King Survival
   ============================================ */

/* Black king square when in check */
.square.in-check {
    outline: 3px solid var(--accent-red) !important;
    outline-offset: -3px;
    animation: checkPulse 500ms ease infinite alternate;
}

@keyframes checkPulse {
    from { outline-color: var(--accent-red); }
    to   { outline-color: #ff6b6b; }
}

/* Selected white piece (click-to-move first click) */
.square.king-from {
    background: rgba(215, 38, 30, 0.7) !important;
    outline: 3px solid var(--accent-red);
    outline-offset: -3px;
}

/* Legal move destination dots */
.square.king-legal::after {
    content: '';
    position: absolute;
    width: 34%;
    height: 34%;
    background: rgba(245, 166, 35, 0.65);
    border-radius: 50%;
    pointer-events: none;
    z-index: 5;
}

/* When a legal square already has a piece (capture) show ring instead of dot */
.square.king-legal:has(.piece)::after {
    width: 92%;
    height: 92%;
    border-radius: 50%;
    background: transparent;
    border: 4px solid rgba(245, 166, 35, 0.65);
}

/* ============================================
   King Role Selector (Mode 10 settings)
   ============================================ */

.king-role-group {
    gap: 0.625rem;
}

.king-role-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.875rem 1.5rem;
    min-width: 130px;
    position: relative;
    overflow: hidden;
}

.king-role-btn .role-icon {
    font-size: 1.6rem;
    line-height: 1;
    display: block;
    transition: transform var(--t-fast) var(--ease-snap);
}

.king-role-btn .role-label {
    font-size: 0.72rem;
    letter-spacing: 0.12em;
    font-weight: 700;
}

.king-role-btn:hover .role-icon {
    transform: scale(1.15);
}

.king-role-btn.active .role-icon {
    filter: drop-shadow(0 0 8px currentColor);
}

/* Hint text below the role buttons */
.king-role-hint {
    margin-top: 0.65rem;
    font-size: 0.72rem;
    color: var(--muted);
    text-align: center;
    letter-spacing: 0.03em;
    line-height: 1.45;
    transition: color var(--t-mid);
    min-height: 2.2em;
}

/* Survive role gets a distinct gold tint when active */
[data-kingrole="survive"].active {
    background: linear-gradient(135deg, rgba(207,164,58,0.22), rgba(245,166,35,0.08));
    border-color: var(--gold);
    color: var(--gold);
    box-shadow: 0 0 14px rgba(207,164,58,0.3), 0 2px 8px rgba(0,0,0,0.5);
}

/* Checkmate role keeps the fire red when active */
[data-kingrole="checkmate"].active {
    background: var(--red);
    border-color: var(--red);
    color: var(--white);
    box-shadow: 0 0 14px var(--red-glow), 0 2px 8px rgba(0,0,0,0.5);
}

/* ============================================
   Flipped board (Survive mode — black at bottom)
   ============================================ */

.chessboard.board-flipped {
    transform: rotate(180deg);
}

/* Counter-rotate each square's content so pieces stay upright */
.chessboard.board-flipped .square {
    transform: rotate(180deg);
}

/* Also flip the rank/file label wrappers */
.board-wrapper.board-flipped .board-labels-files {
    flex-direction: row-reverse;
}

.board-wrapper.board-flipped .board-labels-ranks {
    flex-direction: column-reverse;
}

/* ============================================
   Leaderboard Link
   ============================================ */

.leaderboard-link {
    display: block;
    margin-top: 0.75rem;
    text-align: right;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--orange);
    text-decoration: none;
    transition: color var(--t-fast) var(--ease-snap);
    background: none;
    border: none;
    cursor: pointer;
}
.leaderboard-link:hover {
    color: var(--white);
}

/* ============================================
   leaderboard.html — Full Page Styles
   ============================================ */

.lb-page {
    min-height: 100vh;
    background: var(--black);
    color: var(--off-white);
    font-family: 'Rajdhani', sans-serif;
    padding: 2rem 1rem 4rem;
}

.lb-page .lb-header {
    text-align: center;
    margin-bottom: 3rem;
}

.lb-page .lb-header h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 900;
    background: var(--grad-fire);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.lb-page .lb-header p {
    color: var(--muted);
    font-size: 0.85rem;
    letter-spacing: 0.05em;
}

.lb-page .lb-back {
    display: inline-block;
    margin-bottom: 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--orange);
    text-decoration: none;
}
.lb-page .lb-back:hover { color: var(--white); }

.lb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    max-width: 860px;
    margin: 0 auto;
}

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

.lb-section h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--orange);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-hot);
}

.lb-section .leaderboard {
    gap: 0.4rem;
}

.lb-section .leaderboard-item {
    font-size: 0.82rem;
    padding: 0.5rem 0.7rem;
}

#lbStatus {
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: 2rem;
}

/* ============================================
   Mode 16: yohfish — Engine Game Styles
   ============================================ */

/* Last engine move highlight */
.square.yoh-last-from {
    background: rgba(245, 166, 35, 0.22) !important;
}
.square.yoh-last-to {
    background: rgba(245, 166, 35, 0.35) !important;
}
