/*
Copyright (c) 2026 ChessthenX. All rights reserved.
Unauthorized copying, modification, or distribution is prohibited.
*/

:root {
  --ink: #1f1a14;
  --paper: #f8f2e6;
  --paper-strong: #f1e7d7;
  --wood-light: #e8d3b0;
  --wood-dark: #b58863;
  --wood-border: #6c4b2b;
  --accent: #7a4e20;
  --accent-2: #385940;
  --danger: #8f2e2e;
  --shadow: 0 12px 30px rgba(31, 26, 20, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Georgia", "Times New Roman", serif;
  color: var(--ink);
  background: linear-gradient(135deg, #d8c4a6 0%, #f0e2cb 40%, #d8c8b1 100%);
  display: flex;
  flex-direction: column;
}

.background-shape {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.35), transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(122, 78, 32, 0.16), transparent 45%);
}

.page {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  width: 100%;
  flex: 1 0 auto;
}

.site-footer {
  width: 100%;
  margin-top: 18px;
  padding: 16px 18px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: rgba(31, 26, 20, 0.75);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid rgba(31, 26, 20, 0.3);
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.nav-brand {
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}


.thenx-wordmark {
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 0.92;
}

.thenx-top {
  position: relative;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(3rem, 7vw, 5.2rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #b9ff56;
  text-transform: uppercase;
  text-shadow:
    0 0 6px rgba(185, 255, 86, 0.22),
    0 0 18px rgba(185, 255, 86, 0.14);
}

.thenx-bottom {
  position: relative;
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
}

.thenx-bottom-wrap {
  display: inline-flex;
  align-items: flex-end;
  padding: 8px 16px 10px;
  border: 1px solid rgba(185, 255, 86, 0.75);
  margin-top: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 0 16px rgba(185, 255, 86, 0.08);
}

.thenx-then {
  position: relative;
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #c7ff73;
  text-shadow:
    0 0 6px rgba(185, 255, 86, 0.16),
    0 0 14px rgba(185, 255, 86, 0.12);
}

.thenx-x {
  position: relative;
  font-size: clamp(3.5rem, 7vw, 6.3rem);
  line-height: 0.88;
  font-weight: 900;
  color: #d4ff7f;
  margin-left: 4px;
  text-shadow:
    0 0 8px rgba(185, 255, 86, 0.18),
    0 0 18px rgba(185, 255, 86, 0.12);
}

.thenx-top::after,
.thenx-then::after,
.thenx-x::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 12% 18%, rgba(0, 0, 0, 0.85) 0 1px, transparent 1.5px),
    radial-gradient(circle at 28% 42%, rgba(0, 0, 0, 0.75) 0 1.2px, transparent 1.8px),
    radial-gradient(circle at 46% 26%, rgba(0, 0, 0, 0.8) 0 1px, transparent 1.6px),
    radial-gradient(circle at 58% 58%, rgba(0, 0, 0, 0.78) 0 1.1px, transparent 1.8px),
    radial-gradient(circle at 76% 30%, rgba(0, 0, 0, 0.72) 0 1.1px, transparent 1.7px),
    radial-gradient(circle at 86% 62%, rgba(0, 0, 0, 0.82) 0 1px, transparent 1.5px),
    radial-gradient(circle at 20% 74%, rgba(0, 0, 0, 0.76) 0 1px, transparent 1.7px),
    radial-gradient(circle at 70% 82%, rgba(0, 0, 0, 0.86) 0 1.1px, transparent 1.6px);
  mix-blend-mode: multiply;
  opacity: 0.68;
}

.thenx-top::before,
.thenx-then::before,
.thenx-x::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 32%, rgba(0, 0, 0, 0.08) 100%);
  mix-blend-mode: soft-light;
  opacity: 0.8;
}

.thenx-wordmark-nav {
  flex-shrink: 0;
}

.thenx-wordmark-nav .thenx-top {
  font-size: clamp(1.15rem, 2.1vw, 1.8rem);
}

.thenx-wordmark-nav .thenx-bottom-wrap {
  margin-top: 4px;
  padding: 3px 8px 5px;
}

.thenx-wordmark-nav .thenx-then {
  font-size: clamp(0.84rem, 1.6vw, 1.15rem);
}

.thenx-wordmark-nav .thenx-x {
  margin-left: 2px;
  font-size: clamp(1.3rem, 2.4vw, 1.9rem);
}

.thenx-wordmark-compact .thenx-top {
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
}

.thenx-wordmark-compact .thenx-bottom-wrap {
  margin-top: 4px;
  padding: 3px 8px 5px;
}

.thenx-wordmark-compact .thenx-then {
  font-size: clamp(0.88rem, 1.8vw, 1.15rem);
}

.thenx-wordmark-compact .thenx-x {
  margin-left: 2px;
  font-size: clamp(1.35rem, 2.8vw, 1.95rem);
}

.nav-links {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--ink);
  border: 1px solid rgba(108, 75, 43, 0.22);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 600;
}

.nav-links a.active {
  background: linear-gradient(180deg, #9a6a3a, #7a4e20);
  color: #fff8ec;
  border-color: transparent;
}

.nav-links button.secondary {
  width: auto;
  padding: 8px 14px;
}

.single-column {
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.page-copy {
  margin: 0 0 10px;
}

.compact-auth .small-note {
  margin: 6px 0 0;
  font-size: 0.92rem;
}

.small-note {
  margin: 8px 0 4px;
  font-size: 0.92rem;
  opacity: 0.88;
}

.leaderboard-page-card {
  margin-top: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 2.6vw, 2.2rem);
  letter-spacing: 0.5px;
}

.page-header p {
  margin: 6px 0 0;
  font-size: 1rem;
}

.score-rules {
  display: flex;
  gap: 10px;
  font-weight: 600;
}

.score-rules span {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(31, 26, 20, 0.1);
  padding: 8px 12px;
  border-radius: 999px;
}

.layout-grid {
  display: grid;
  grid-template-columns: 280px minmax(360px, 1fr) 300px;
  gap: 14px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.63));
  border: 1px solid rgba(108, 75, 43, 0.25);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.card h2 {
  margin: 0 0 10px;
  font-size: 1.2rem;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.auth-state {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  background: var(--paper-strong);
  border: 1px solid rgba(108, 75, 43, 0.2);
}

.score-panel {
  display: grid;
  gap: 10px;
}

.score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
}

.score-row strong {
  font-size: 1.15rem;
}

.score-panel.score-pulse {
  animation: scorePulse 520ms ease;
}

@keyframes scorePulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(44, 159, 71, 0);
  }
  40% {
    transform: scale(1.02);
    box-shadow: 0 0 0 10px rgba(44, 159, 71, 0.28);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(44, 159, 71, 0);
  }
}

.auth-forms {
  display: grid;
  gap: 12px;
}

.form-block {
  padding: 10px;
  border: 1px solid rgba(108, 75, 43, 0.2);
  border-radius: 10px;
  background: rgba(248, 242, 230, 0.8);
}

input,
select,
button {
  width: 100%;
  margin-top: 7px;
  margin-bottom: 6px;
  border-radius: 8px;
  border: 1px solid rgba(108, 75, 43, 0.35);
  padding: 9px 10px;
  font: inherit;
  color: var(--ink);
}

input,
select {
  background: #fffdf7;
}

button {
  cursor: pointer;
  background: linear-gradient(180deg, #9a6a3a, #7a4e20);
  color: #fff8ec;
  border: none;
  font-weight: 600;
}

button:hover {
  filter: brightness(1.04);
}

button.secondary {
  background: linear-gradient(180deg, #5f6d5d, #385940);
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.hidden {
  display: none;
}

.board-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.board-shell {
  position: relative;
}

.board {
  width: min(72vw, 580px);
  max-width: 580px;
  border: 8px solid var(--wood-border);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 180ms ease;
}

.celebration {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 240ms ease, transform 240ms ease;
}

.celebration span {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(108, 75, 43, 0.25);
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 14px 24px rgba(31, 26, 20, 0.25);
}

.celebration.show {
  opacity: 1;
  transform: scale(1);
  animation: confettiPulse 700ms ease;
}

@keyframes confettiPulse {
  0% {
    box-shadow: 0 0 0 rgba(255, 215, 128, 0);
  }
  40% {
    box-shadow: 0 0 0 14px rgba(255, 215, 128, 0.45);
  }
  100% {
    box-shadow: 0 0 0 rgba(255, 215, 128, 0);
  }
}

.board-meta {
  width: 100%;
  padding: 4px 4px 8px;
}

.timer-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 16px 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(108, 75, 43, 0.25);
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 2rem;
}

.timer-pill.danger {
  color: #8f2e2e;
  border-color: rgba(143, 46, 46, 0.4);
}

.timer-panel {
  margin-top: 12px;
  display: grid;
  gap: 6px;
  align-items: start;
}

.timer-label {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--accent);
}

.btn-start {
  background: linear-gradient(180deg, #2e7d32, #1b5e20);
}

.btn-start.btn-progress {
  background: linear-gradient(180deg, #f0a23a, #d9841f);
}

.btn-next {
  background: linear-gradient(180deg, #2d6cdf, #1b4fa8);
  color: #ffffff;
  border: none;
}

.status {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid transparent;
}

.status:empty {
  display: none;
}

.status.info {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(108, 75, 43, 0.2);
}

.status.success {
  background: #2c9f47;
  color: #f5fff7;
  border-color: #1d6f31;
  font-weight: 700;
}

.status.error {
  background: #7a1010;
  color: #fff4f4;
  border-color: #4f0a0a;
}

.next-move {
  margin: 9px 2px 0;
}

.review-controls {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 52px 52px 1fr 52px 52px;
  gap: 8px;
  align-items: center;
}

.review-btn {
  margin: 0;
  padding: 6px 0;
}

.review-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.review-label {
  text-align: center;
  font-weight: 700;
  border: 1px solid rgba(108, 75, 43, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  padding: 7px 10px;
}

.board-tools {
  margin-top: 8px;
}

.board-tools button {
  max-width: 160px;
  margin: 0;
}

.keyboard-help {
  margin: 8px 2px 0;
  font-size: 0.9rem;
  opacity: 0.85;
}

.board.board-flash-success {
  animation: boardPulseSuccess 420ms ease;
}

.board.board-flash-error {
  animation: boardPulseError 420ms ease;
}

@keyframes boardPulseSuccess {
  0% {
    box-shadow: 0 0 0 rgba(44, 159, 71, 0);
  }
  50% {
    box-shadow: 0 0 0 11px rgba(44, 159, 71, 0.45);
  }
  100% {
    box-shadow: 0 0 0 rgba(44, 159, 71, 0);
  }
}

@keyframes boardPulseError {
  0% {
    box-shadow: 0 0 0 rgba(143, 46, 46, 0);
  }
  50% {
    box-shadow: 0 0 0 7px rgba(143, 46, 46, 0.38);
  }
  100% {
    box-shadow: 0 0 0 rgba(143, 46, 46, 0);
  }
}

.setup-card label {
  display: block;
  margin-top: 6px;
  font-weight: 600;
}

.leaderboard-card {
  margin-top: 14px;
}

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

th,
td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(108, 75, 43, 0.22);
}

tbody tr.current-user {
  background: rgba(122, 78, 32, 0.15);
  font-weight: 700;
}

.white-1e1d7 {
  background-color: var(--wood-light);
}

.black-3c85d {
  background-color: var(--wood-dark);
}

.square-55d63.tap-selected {
  box-shadow: inset 0 0 0 4px rgba(44, 159, 71, 0.6);
}

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

  .board {
    width: min(92vw, 560px);
  }

  .page-header {
    align-items: start;
    flex-direction: column;
  }

  .app-nav {
    align-items: start;
    flex-direction: column;
  }
}

/* Premium login redesign */
body[data-page="login"] {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 18%, rgba(212, 171, 93, 0.16), transparent 28%),
    radial-gradient(circle at 82% 24%, rgba(64, 96, 180, 0.2), transparent 26%),
    linear-gradient(180deg, #050a16 0%, #07101d 54%, #091320 100%);
  color: #f3ecdf;
  font-family: "Georgia", "Times New Roman", serif;
}

body[data-page="login"] .background-shape,
body[data-page="login"] .page,
body[data-page="login"] .app-nav,
body[data-page="login"] .single-column,
body[data-page="login"] .auth-card {
  display: none !important;
}

.auth-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 14% 72%, rgba(255, 255, 255, 0.06), transparent 18%),
    radial-gradient(circle at 88% 20%, rgba(255, 255, 255, 0.05), transparent 18%),
    linear-gradient(90deg, rgba(255,255,255,0.02), transparent 18%, transparent 82%, rgba(255,255,255,0.02)),
    linear-gradient(180deg, rgba(255,255,255,0.02), transparent 20%, transparent 80%, rgba(255,255,255,0.015));
}

.auth-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
}

.auth-stage {
  width: min(1080px, 100%);
  display: grid;
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 0.78fr);
  gap: 28px;
  align-items: center;
}

.auth-stage-copy {
  padding: 24px 10px;
}

.auth-kicker {
  display: inline-block;
  margin-bottom: 14px;
  color: #d9b86a;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-stage-copy h1 {
  margin: 0 0 16px;
  font-size: clamp(3rem, 6vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: -0.04em;
  color: #f7f0e6;
}

.auth-stage-copy p {
  max-width: 520px;
  margin: 0 0 24px;
  font-size: 1.15rem;
  line-height: 1.65;
  color: #c7d0e0;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.auth-premium-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(210, 184, 120, 0.22);
  background:
    linear-gradient(180deg, rgba(8, 15, 28, 0.92), rgba(6, 11, 22, 0.97)),
    rgba(8, 15, 28, 0.96);
  box-shadow:
    0 30px 80px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255,255,255,0.04);
  padding: 28px;
}

.auth-premium-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top right, rgba(212, 171, 93, 0.14), transparent 26%),
    radial-gradient(circle at bottom left, rgba(83, 110, 196, 0.12), transparent 24%);
  pointer-events: none;
}

.auth-premium-head,
.auth-premium-form,
.auth-divider,
.auth-register-block,
.auth-status,
#logoutBtn {
  position: relative;
  z-index: 1;
}

.auth-card-mark {
  display: inline-flex;
  margin-bottom: 10px;
  align-items: flex-start;
}

.auth-premium-head h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  color: #f6efe1;
  letter-spacing: -0.03em;
}

.auth-premium-head p,
.auth-register-block p {
  margin: 0 0 16px;
  color: #c3ccda;
  line-height: 1.6;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.auth-register-block h3 {
  margin: 0 0 6px;
  color: #f0e5d3;
  font-size: 1.35rem;
}

.auth-label {
  display: block;
  margin: 14px 0 8px;
  color: #e7dcc8;
  font-size: 0.95rem;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body[data-page="login"] input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  border-radius: 12px;
  border: 1px solid rgba(94, 110, 151, 0.24);
  background: rgba(10, 20, 38, 0.92);
  color: #eef2f8;
  padding: 0 14px;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

body[data-page="login"] input::placeholder {
  color: #8391aa;
}

.auth-gold-btn,
.auth-outline-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  font-family: "Georgia", "Times New Roman", serif;
}

.auth-gold-btn {
  border: none;
  color: #1b140a;
  background: linear-gradient(180deg, #ddbf7b, #b98e41);
}

.auth-outline-btn {
  border: 1px solid rgba(217, 184, 106, 0.35);
  color: #f4ead7;
  background: rgba(255, 255, 255, 0.04);
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 16px;
  color: #c5b38a;
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  justify-content: center;
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: linear-gradient(90deg, transparent, rgba(217, 184, 106, 0.35), transparent);
}

.auth-state-premium {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(217, 184, 106, 0.18);
  color: #e6ebf4;
}

.auth-status {
  margin-top: 16px !important;
}

@media (max-width: 860px) {
  .auth-stage {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .auth-stage-copy {
    padding: 8px 0;
  }

  .auth-stage-copy h1 {
    font-size: clamp(2.3rem, 10vw, 4rem);
  }

  .auth-premium-card {
    padding: 22px;
  }
}

/* Landing-style theme for trainer pages */
body[data-page="board"],
body[data-page="leaderboard"] {
  color: #f3f5f8;
  background:
    radial-gradient(circle at top left, rgba(255, 129, 93, 0.16), transparent 28%),
    radial-gradient(circle at 85% 22%, rgba(243, 198, 78, 0.14), transparent 20%),
    radial-gradient(circle at 30% 100%, rgba(88, 208, 190, 0.12), transparent 24%),
    linear-gradient(180deg, #09111d 0%, #0a1421 52%, #08111f 100%);
}

body[data-page="board"] .background-shape,
body[data-page="leaderboard"] .background-shape {
  background:
    radial-gradient(circle at 16% 10%, rgba(255,255,255,0.05), transparent 30%),
    radial-gradient(circle at 82% 82%, rgba(185,255,86,0.08), transparent 24%);
}

body[data-page="board"] .app-nav,
body[data-page="leaderboard"] .app-nav {
  background: #050608;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  padding: 22px 24px 20px;
}

body[data-page="board"] .nav-brand,
body[data-page="leaderboard"] .nav-brand {
  color: #d4ff7f;
  font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
  font-size: clamp(2rem, 4vw, 3.1rem);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  text-shadow:
    0 0 8px rgba(185, 255, 86, 0.2),
    0 0 20px rgba(185, 255, 86, 0.12);
}

body[data-page="board"] .nav-links a,
body[data-page="leaderboard"] .nav-links a {
  color: #f3f5f8;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
}

body[data-page="board"] .nav-links a.active,
body[data-page="leaderboard"] .nav-links a.active {
  background: linear-gradient(135deg, #ff9c69, #ffb269);
  color: #11131a;
  border-color: transparent;
}

body[data-page="board"] .nav-links button.secondary,
body[data-page="leaderboard"] .nav-links button.secondary {
  background: linear-gradient(180deg, #b9ff56, #97ef6b);
  color: #11131a;
  border-radius: 12px;
  font-weight: 700;
}

body[data-page="board"] .page-header h1,
body[data-page="leaderboard"] h1 {
  color: #f3f5f8;
}

body[data-page="board"] .page-header p,
body[data-page="leaderboard"] .status.info {
  color: #c4cfdf;
}

body[data-page="board"] .score-rules span {
  background: rgba(255,255,255,0.08);
  color: #f3f5f8;
  border: 1px solid rgba(255,255,255,0.12);
}

body[data-page="board"] .card,
body[data-page="leaderboard"] .card {
  background: rgba(12, 19, 32, 0.82);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22);
}

body[data-page="board"] .card h2,
body[data-page="leaderboard"] .card h2,
body[data-page="leaderboard"] .card h1,
body[data-page="board"] .score-row,
body[data-page="board"] label,
body[data-page="leaderboard"] th,
body[data-page="leaderboard"] td {
  color: #f3f5f8;
}

body[data-page="board"] .auth-state,
body[data-page="board"] .review-label,
body[data-page="board"] .timer-pill,
body[data-page="board"] .status.info,
body[data-page="leaderboard"] .status.info {
  background: rgba(255,255,255,0.06);
  color: #f3f5f8;
  border: 1px solid rgba(255,255,255,0.1);
}

body[data-page="board"] input,
body[data-page="board"] select {
  background: rgba(255,255,255,0.06);
  color: #f3f5f8;
  border: 1px solid rgba(255,255,255,0.12);
}

body[data-page="board"] input::file-selector-button {
  background: #f6f1e7;
  color: #11131a;
  border: none;
  border-radius: 8px;
  padding: 8px 12px;
  margin-right: 10px;
}

body[data-page="board"] .btn-start {
  background: linear-gradient(180deg, #b9ff56, #97ef6b);
  color: #11131a;
}

body[data-page="board"] .btn-next {
  background: linear-gradient(135deg, #ff9c69, #ffb269);
  color: #11131a;
}

body[data-page="board"] #loadPgnBtn {
  background: linear-gradient(135deg, #ff9c69, #ffb269);
  color: #11131a;
}

body[data-page="board"] .timer-label {
  color: #ffb269;
}

body[data-page="board"] .review-btn,
body[data-page="board"] button.secondary {
  background: rgba(255,255,255,0.08);
  color: #f3f5f8;
}

body[data-page="board"] .board {
  border: 8px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 18px 40px rgba(0,0,0,0.28);
}

body[data-page="leaderboard"] table {
  color: #f3f5f8;
}

body[data-page="leaderboard"] th,
body[data-page="leaderboard"] td {
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

body[data-page="leaderboard"] tbody tr.current-user {
  background: rgba(185,255,86,0.12);
}

body[data-page="board"] .site-footer,
body[data-page="leaderboard"] .site-footer {
  color: #c4cfdf;
}

body[data-page="board"] .site-footer a,
body[data-page="leaderboard"] .site-footer a {
  border-bottom-color: rgba(255,255,255,0.22);
}


.auth-reset-block {
  margin-top: 18px;
}


.auth-inline-status {
  margin-top: 12px !important;
  display: block;
}

.auth-reset-block .auth-inline-status,
#resendVerify .auth-inline-status {
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

/* Extra compact pass for laptop-height screens */
@media (max-height: 900px) and (min-width: 861px) {
  body[data-page="login"] .auth-shell {
    padding: 12px 14px;
  }

  body[data-page="login"] .auth-stage {
    width: min(980px, 100%);
    gap: 16px;
    align-items: start;
  }

  body[data-page="login"] .auth-stage-copy {
    padding: 6px 4px;
  }

  body[data-page="login"] .auth-kicker {
    margin-bottom: 8px;
    font-size: 0.76rem;
  }

  body[data-page="login"] .auth-stage-copy h1 {
    margin: 0 0 8px;
    font-size: clamp(2.1rem, 4.4vw, 3.6rem);
    line-height: 0.9;
  }

  body[data-page="login"] .auth-stage-copy p {
    margin: 0 0 14px;
    font-size: 0.94rem;
    line-height: 1.42;
  }

  body[data-page="login"] .auth-premium-card {
    padding: 16px 18px;
    border-radius: 18px;
  }

  body[data-page="login"] .auth-card-mark {
    margin-bottom: 6px;
  }

  body[data-page="login"] .auth-premium-head h2 {
    margin: 0 0 6px;
    font-size: clamp(1.45rem, 2vw, 2rem);
  }

  body[data-page="login"] .auth-premium-head p,
  body[data-page="login"] .auth-register-block p {
    margin: 0 0 8px;
    font-size: 0.88rem;
    line-height: 1.35;
  }

  body[data-page="login"] .auth-register-block h3 {
    margin: 0 0 2px;
    font-size: 1.02rem;
  }

  body[data-page="login"] .auth-label {
    margin: 7px 0 4px;
    font-size: 0.82rem;
  }

  body[data-page="login"] input {
    min-height: 36px;
    padding: 0 10px;
    font-size: 0.9rem;
  }

  body[data-page="login"] .auth-gold-btn,
  body[data-page="login"] .auth-outline-btn {
    min-height: 38px;
    margin-top: 10px;
    font-size: 0.9rem;
  }

  body[data-page="login"] .auth-reset-block {
    margin-top: 10px;
  }

  body[data-page="login"] .auth-divider {
    margin: 10px 0 8px;
    font-size: 0.7rem;
  }

  body[data-page="login"] .auth-status,
  body[data-page="login"] .auth-inline-status {
    margin-top: 8px !important;
    padding: 7px 9px;
    font-size: 0.82rem;
    line-height: 1.3;
  }
}

/* Center all left-side login content as one block */
body[data-page="login"] .auth-stage {
  align-items: center;
}

body[data-page="login"] .auth-stage-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 72vh;
}

body[data-page="login"] .auth-stage-copy > * {
  width: 100%;
}

@media (max-width: 860px) {
  body[data-page="login"] .auth-stage-copy {
    min-height: auto;
    justify-content: flex-start;
  }
}

/* Better vertical centering for the whole left-side block */
body[data-page="login"] .auth-stage {
  align-items: stretch;
}

body[data-page="login"] .auth-stage-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  min-height: 0;
  max-width: 520px;
}

@media (max-width: 860px) {
  body[data-page="login"] .auth-stage {
    align-items: start;
  }

  body[data-page="login"] .auth-stage-copy {
    justify-content: flex-start;
    align-self: auto;
    max-width: 100%;
  }
}


/* auth-v2-start */
body[data-page="login"] {
  min-height: 100vh;
  margin: 0;
  color: #f3f5f8;
  background:
    radial-gradient(circle at 14% 18%, rgba(255, 129, 93, 0.18), transparent 24%),
    radial-gradient(circle at 82% 14%, rgba(185, 255, 86, 0.08), transparent 20%),
    linear-gradient(180deg, #08101d 0%, #091321 54%, #07101d 100%);
  overflow-x: hidden;
}

.auth-v2-scene {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 72%, rgba(255, 255, 255, 0.03), transparent 20%),
    radial-gradient(circle at 78% 30%, rgba(243, 198, 78, 0.08), transparent 16%);
}

.auth-v2-shell {
  min-height: 100vh;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-v2-stage {
  width: min(1240px, 100%);
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(340px, 1fr);
  gap: 24px;
  align-items: stretch;
}

.auth-v2-brand,
.auth-v2-workspace {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 28px;
  background: rgba(11, 17, 30, 0.88);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.auth-v2-brand {
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 26px;
}

.auth-v2-wordmark {
  width: fit-content;
}

.auth-v2-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-v2-kicker,
.auth-v2-eyebrow,
.auth-v2-card-label {
  display: inline-flex;
  width: fit-content;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  color: #f0d58e;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-v2-card-label-accent {
  background: rgba(185, 255, 86, 0.12);
  color: #d8ff93;
}

.auth-v2-copy h1 {
  margin: 0;
  max-width: 14ch;
  font-size: clamp(2.2rem, 3.8vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.auth-v2-copy p {
  margin: 0;
  max-width: 44ch;
  color: #b9c4d6;
  line-height: 1.65;
  font-size: 1rem;
}

.auth-v2-state {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: #e7ebf2;
  font-weight: 600;
}

.auth-v2-workspace {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-v2-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.auth-v2-header h2 {
  margin: 8px 0 0;
  font-size: clamp(1.4rem, 2.1vw, 2rem);
}

.auth-v2-home {
  text-decoration: none;
  color: #c7d1e2;
  font-weight: 700;
  white-space: nowrap;
}

.auth-v2-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.auth-v2-card {
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(18, 26, 43, 0.75);
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.auth-v2-card-login {
  box-shadow: inset 0 0 0 1px rgba(243, 198, 78, 0.06);
}

.auth-v2-card-signup {
  box-shadow: inset 0 0 0 1px rgba(185, 255, 86, 0.05);
}

.auth-v2-card h3 {
  margin: 2px 0 0;
  font-size: 1.55rem;
}

.auth-v2-card-copy {
  margin: 0 0 4px;
  color: #b5c0d2;
  line-height: 1.45;
  font-size: 0.93rem;
}

.auth-v2-label {
  margin-top: 2px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #e6ebf3;
}

body[data-page="login"] input {
  min-height: 42px;
  width: 100%;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: #0f172a;
  color: #f3f5f8;
  font-size: 0.95rem;
}

.auth-v2-primary,
.auth-v2-secondary {
  min-height: 42px;
  width: 100%;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
}

.auth-v2-primary {
  border: none;
  color: #11131a;
  background: linear-gradient(135deg, #d9bd6a, #f0d58e);
}

.auth-v2-primary-accent {
  background: linear-gradient(135deg, #ff9c69, #ffb269);
}

.auth-v2-secondary {
  border: 1px solid rgba(255,255,255,0.14);
  color: #f3f5f8;
  background: rgba(255,255,255,0.03);
}

.auth-v2-details {
  margin-top: 2px;
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 10px;
}

.auth-v2-details summary {
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: #dbe3ef;
}

.auth-v2-details summary::-webkit-details-marker {
  display: none;
}

.auth-v2-details-body {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-v2-inline-status,
.auth-v2-status {
  margin: 0 !important;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 0.86rem;
  line-height: 1.35;
}

.auth-v2-footer {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-v2-footer .auth-v2-status {
  flex: 1;
}

.hidden {
  display: none !important;
}

@media (max-width: 1040px) {
  .auth-v2-stage {
    grid-template-columns: 1fr;
  }

  .auth-v2-copy h1 {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .auth-v2-shell {
    padding: 14px;
  }

  .auth-v2-brand,
  .auth-v2-workspace {
    padding: 18px;
    border-radius: 22px;
  }

  .auth-v2-grid {
    grid-template-columns: 1fr;
  }

  .auth-v2-header,
  .auth-v2-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .auth-v2-copy h1 {
    font-size: clamp(2rem, 9vw, 2.8rem);
  }
}
/* auth-v2-end */


/* landing polish only */
:root {
  --landing-heading-font: "Cinzel", serif;
  --landing-body-font: "Outfit", "Segoe UI", sans-serif;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.logo {
  font-size: 1.46rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.nav a {
  font-size: 0.97rem;
  letter-spacing: 0.01em;
}

.hero .eyebrow,
.section .eyebrow,
.page-hero .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  opacity: 0.95;
}

.hero-copy {
  max-width: 640px;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.hero .lead {
  max-width: 52ch;
  font-size: 1.06rem;
  line-height: 1.72;
  color: rgba(244, 232, 210, 0.95);
}

.hero-actions {
  margin-top: 1.55rem;
  gap: 0.9rem;
}

.btn {
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  padding: 0.82rem 1.28rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.btn-primary {
  box-shadow: 0 12px 24px rgba(127, 91, 26, 0.16);
}

.slideshow {
  border-radius: 26px;
  box-shadow:
    0 18px 42px rgba(30, 20, 8, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.02) contrast(1.03);
}

.section-grid p,
.section p,
.card p,
.contact-wrap p {
  font-size: 1rem;
  line-height: 1.74;
}

h2 {
  letter-spacing: -0.015em;
}

.cards .card {
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(78, 53, 18, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.cards .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(78, 53, 18, 0.13);
}

.card h3 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.contact-wrap h2 {
  max-width: 12ch;
}

.contact-form {
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(78, 53, 18, 0.08);
}

.contact-form input,
.contact-form textarea {
  font-size: 0.97rem;
  line-height: 1.5;
}

.site-footer {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

@media (min-width: 900px) {
  .hero-grid {
    gap: 2.6rem;
  }

  .section {
    padding-top: 5.4rem;
    padding-bottom: 5.1rem;
  }
}

@media (max-width: 900px) {
  .hero-copy h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero .lead {
    font-size: 1rem;
  }
}
/* landing polish only end */

/* landing polish only */
:root {
  --landing-heading-font: "Cinzel", serif;
  --landing-body-font: "Outfit", "Segoe UI", sans-serif;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.logo {
  font-size: 1.46rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.nav a {
  font-size: 0.97rem;
  letter-spacing: 0.01em;
}

.hero .eyebrow,
.section .eyebrow,
.page-hero .eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  opacity: 0.95;
}

.hero-copy {
  max-width: 640px;
}

.hero-copy h1 {
  font-size: clamp(2.2rem, 4.4vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
  text-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.hero .lead {
  max-width: 52ch;
  font-size: 1.06rem;
  line-height: 1.72;
  color: rgba(244, 232, 210, 0.95);
}

.hero-actions {
  margin-top: 1.55rem;
  gap: 0.9rem;
}

.btn {
  font-size: 0.96rem;
  letter-spacing: 0.01em;
  padding: 0.82rem 1.28rem;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.btn-primary {
  box-shadow: 0 12px 24px rgba(127, 91, 26, 0.16);
}

.slideshow {
  border-radius: 26px;
  box-shadow:
    0 18px 42px rgba(30, 20, 8, 0.22),
    0 0 0 1px rgba(255, 255, 255, 0.05);
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.02) contrast(1.03);
}

.section-grid p,
.section p,
.card p,
.contact-wrap p {
  font-size: 1rem;
  line-height: 1.74;
}

h2 {
  letter-spacing: -0.015em;
}

.cards .card {
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(78, 53, 18, 0.08);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.cards .card:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(78, 53, 18, 0.13);
}

.card h3 {
  font-size: 1.2rem;
  letter-spacing: -0.01em;
}

.contact-wrap h2 {
  max-width: 12ch;
}

.contact-form {
  border-radius: 24px;
  box-shadow: 0 14px 30px rgba(78, 53, 18, 0.08);
}

.contact-form input,
.contact-form textarea {
  font-size: 0.97rem;
  line-height: 1.5;
}

.site-footer {
  font-size: 0.95rem;
  letter-spacing: 0.01em;
}

@media (min-width: 900px) {
  .hero-grid {
    gap: 2.6rem;
  }

  .section {
    padding-top: 5.4rem;
    padding-bottom: 5.1rem;
  }
}

@media (max-width: 900px) {
  .hero-copy h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .hero .lead {
    font-size: 1rem;
  }
}
/* landing polish only end */

.contact-status {
  margin-top: 12px;
  margin-bottom: 0;
  padding: 12px 14px;
  border-radius: 14px;
  font-weight: 600;
  line-height: 1.45;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text, #f3f5f8);
}

.contact-status.success {
  background: rgba(119,214,120,0.18);
  border-color: rgba(119,214,120,0.34);
  color: #d8ffd7;
}

.contact-status.error {
  background: rgba(255,107,107,0.16);
  border-color: rgba(255,107,107,0.34);
  color: #ffd7d7;
}



/* board layout final start */
body[data-page="board"] .layout-grid {
  align-items: start !important;
}

body[data-page="board"] .board-column-stack {
  display: inline-flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-self: center !important;
  align-self: start !important;
  gap: 10px !important;
  width: fit-content !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 auto !important;
}

body[data-page="board"] .board-card {
  display: contents !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: none !important;
  box-shadow: none !important;
}

body[data-page="board"] .board-shell {
  position: relative !important;
  display: inline-block !important;
  width: fit-content !important;
  max-width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 10px !important;
  margin: 0 auto !important;
  line-height: 0 !important;
  border-radius: 14px !important;
  border: 1px solid rgba(255, 255, 255, 0.10) !important;
  background: rgba(12, 19, 32, 0.82) !important;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22) !important;
}

body[data-page="board"] .board-shell #board,
body[data-page="board"] .board {
  display: block !important;
  margin: 0 auto !important;
  height: auto !important;
  min-height: 0 !important;
}

body[data-page="board"] .board-status-card {
  width: 100% !important;
  max-width: 100% !important;
  align-self: stretch !important;
  margin: 0 !important;
  padding: 10px 12px 12px !important;
  height: auto !important;
  min-height: 0 !important;
}

body[data-page="board"] .board-status-card .board-meta {
  display: block !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  height: auto !important;
  min-height: 0 !important;
}

body[data-page="board"] .board-status-card #statusText {
  margin: 0 0 8px !important;
}

body[data-page="board"] .board-status-card #statusText:empty {
  display: none !important;
  margin: 0 !important;
}

body[data-page="board"] .board-status-card .review-controls {
  display: grid !important;
  grid-template-columns: 52px 52px 1fr 52px 52px !important;
  align-items: center !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
}

body[data-page="board"] .board-status-card .review-btn {
  margin: 0 !important;
}

body[data-page="board"] .board-status-card .review-label {
  margin: 0 !important;
  text-align: center !important;
}

@media (max-width: 1080px) {
  body[data-page="board"] .layout-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  body[data-page="board"] .board-column-stack {
    order: 1 !important;
  }

  body[data-page="board"] .setup-card {
    order: 2 !important;
  }

  body[data-page="board"] .auth-card {
    order: 3 !important;
  }

  body[data-page="board"] .board {
    width: min(94vw, 620px) !important;
  }

  body[data-page="board"] .app-nav {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }

  body[data-page="board"] .nav-links {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 10px !important;
  }

  body[data-page="board"] .page-header {
    align-items: flex-start !important;
    flex-direction: column !important;
    gap: 12px !important;
  }
}

@media (max-width: 680px) {
  body[data-page="board"] .board {
    width: min(94vw, 420px) !important;
  }

  body[data-page="board"] .board-shell {
    padding: 8px !important;
  }

  body[data-page="board"] .board-status-card .review-controls {
    grid-template-columns: 44px 44px 1fr 44px 44px !important;
    gap: 6px !important;
  }
}
/* board layout final end */


/* clear board notation start */
body[data-page="board"] .notation-322f9 {
  z-index: 2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(15px, 1.15vw, 20px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.01em;
  pointer-events: none;
}

body[data-page="board"] .white-1e1d7 .notation-322f9 {
  color: rgba(64, 45, 27, 0.95);
  text-shadow: 0 1px 2px rgba(255, 248, 230, 0.9);
}

body[data-page="board"] .black-3c85d .notation-322f9 {
  color: rgba(255, 241, 205, 0.98);
  text-shadow: 0 1px 3px rgba(25, 14, 8, 0.8);
}

body[data-page="board"] .alpha-d2270 {
  right: 5px;
  bottom: 4px;
}

body[data-page="board"] .numeric-fc462 {
  top: 5px;
  left: 5px;
}
/* clear board notation end */


/* last move highlight start */
body[data-page="board"] .square-55d63.last-move-from {
  box-shadow:
    inset 0 0 0 5px rgba(255, 205, 72, 0.95),
    inset 0 0 22px rgba(255, 205, 72, 0.45) !important;
}

body[data-page="board"] .square-55d63.last-move-to {
  box-shadow:
    inset 0 0 0 5px rgba(80, 230, 170, 0.98),
    inset 0 0 24px rgba(80, 230, 170, 0.48) !important;
}

body[data-page="board"] .square-55d63.last-move-to .piece-417db {
  filter: drop-shadow(0 0 5px rgba(80, 230, 170, 0.75));
}
/* last move highlight end */


/* compact board viewport start */
body[data-page="board"] .page {
  padding-top: clamp(10px, 1.2vh, 18px) !important;
  padding-bottom: 8px !important;
}

body[data-page="board"] .app-nav {
  padding: 10px 14px !important;
  margin-bottom: 10px !important;
}

body[data-page="board"] .page-header {
  margin-bottom: 10px !important;
  gap: 10px !important;
}

body[data-page="board"] .page-header h1 {
  font-size: clamp(2rem, 3vw, 3.1rem) !important;
  line-height: 0.95 !important;
}

body[data-page="board"] .page-header p {
  margin-top: 4px !important;
  font-size: clamp(1rem, 1.2vw, 1.35rem) !important;
}

body[data-page="board"] .score-rules span {
  padding: 7px 13px !important;
}

body[data-page="board"] .layout-grid {
  gap: 12px !important;
  grid-template-columns: minmax(220px, 260px) auto minmax(250px, 320px) !important;
  align-items: start !important;
}

body[data-page="board"] .card {
  padding: 12px !important;
}

body[data-page="board"] .board {
  width: min(42vw, 620px, calc(100vh - 330px)) !important;
  width: min(42vw, 620px, calc(100dvh - 330px)) !important;
  max-width: 620px !important;
}

body[data-page="board"] .board-status-card {
  padding: 8px 10px !important;
}

body[data-page="board"] .review-controls {
  gap: 7px !important;
}

body[data-page="board"] .setup-card h2,
body[data-page="board"] .auth-card h2 {
  margin-bottom: 8px !important;
}

body[data-page="board"] .setup-card label {
  margin-top: 4px !important;
}

body[data-page="board"] input,
body[data-page="board"] select,
body[data-page="board"] button {
  margin-top: 5px !important;
  margin-bottom: 5px !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

body[data-page="board"] .timer-panel {
  margin-top: 8px !important;
}

body[data-page="board"] .timer-pill {
  margin-top: 6px !important;
  padding: 12px 22px !important;
  font-size: clamp(1.5rem, 2.4vw, 2.25rem) !important;
}

body[data-page="board"] .site-footer {
  margin-top: 8px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
  font-size: 0.85rem !important;
}

@media (max-height: 820px) and (min-width: 1081px) {
  body[data-page="board"] .page-header h1 {
    font-size: clamp(1.7rem, 2.3vw, 2.5rem) !important;
  }

  body[data-page="board"] .page-header p {
    font-size: 1rem !important;
  }

  body[data-page="board"] .board {
    width: min(38vw, 560px, calc(100vh - 285px)) !important;
    width: min(38vw, 560px, calc(100dvh - 285px)) !important;
  }
}

@media (max-width: 1080px) {
  body[data-page="board"] .layout-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="board"] .board {
    width: min(92vw, 560px, calc(100vh - 300px)) !important;
    width: min(92vw, 560px, calc(100dvh - 300px)) !important;
  }
}
/* compact board viewport end */


/* correct move popup visibility start */
body[data-page="board"] .celebration span {
  color: #1f1a14 !important;
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(108, 75, 43, 0.28) !important;
  text-shadow: none !important;
  font-weight: 900 !important;
}
/* correct move popup visibility end */


/* CCT training start */
body[data-page="cct"] .cct-layout {
  grid-template-columns: 260px minmax(420px, 1fr) 320px;
}

body[data-page="cct"] .cct-rules {
  flex-wrap: wrap;
}

body[data-page="cct"] .cct-board-card {
  gap: 12px;
}

body[data-page="cct"] .cct-meta {
  width: 100%;
}

.cct-timer-row,
.cct-position-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.cct-timer-pill {
  min-width: 104px;
  padding: 10px 18px;
  font-size: 1.35rem;
}

.small-note {
  margin: 0 0 12px;
  line-height: 1.45;
  opacity: 0.86;
}

.cct-category-grid {
  display: grid;
  gap: 8px;
}

.cct-category {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(108, 75, 43, 0.25);
  color: var(--ink, #1f1a14);
}

.cct-category.active[data-cct-category="good"] {
  background: linear-gradient(180deg, #2c9f47, #1d6f31);
  color: #fff;
}

.cct-category.active[data-cct-category="equal"] {
  background: linear-gradient(180deg, #d79d37, #a86d17);
  color: #fff;
}

.cct-category.active[data-cct-category="bad"] {
  background: linear-gradient(180deg, #8f2e2e, #641919);
  color: #fff;
}

.cct-selection-card {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid rgba(108, 75, 43, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.45);
}

.cct-selection-card h3,
.cct-upload h3 {
  margin-top: 0;
}

.cct-selection-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cct-selection-list li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
}

.cct-upload {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(108, 75, 43, 0.2);
}

.cct-results-card {
  margin-top: 14px;
}

.cct-result-list {
  display: grid;
  gap: 8px;
}

.cct-result-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(108, 75, 43, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
}

.cct-result-row.correct {
  border-color: rgba(44, 159, 71, 0.35);
  background: rgba(44, 159, 71, 0.14);
}

.cct-result-row.missed {
  border-color: rgba(215, 157, 55, 0.35);
  background: rgba(215, 157, 55, 0.14);
}

.cct-result-row.wrong {
  border-color: rgba(143, 46, 46, 0.35);
  background: rgba(143, 46, 46, 0.14);
}

.square-55d63.cct-selected {
  box-shadow: inset 0 0 0 4px rgba(45, 108, 223, 0.75);
}

.square-55d63.cct-source {
  box-shadow: inset 0 0 0 4px rgba(45, 108, 223, 0.5);
}

.square-55d63.cct-target.cct-good {
  box-shadow: inset 0 0 0 5px rgba(44, 159, 71, 0.8);
}

.square-55d63.cct-target.cct-equal {
  box-shadow: inset 0 0 0 5px rgba(215, 157, 55, 0.85);
}

.square-55d63.cct-target.cct-bad {
  box-shadow: inset 0 0 0 5px rgba(143, 46, 46, 0.82);
}

@media (max-width: 1080px) {
  body[data-page="cct"] .cct-layout {
    grid-template-columns: 1fr;
  }

  .cct-result-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  body[data-page="cct"] .board {
    width: min(94vw, 420px);
  }

  .cct-timer-row,
  .cct-position-row {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* CCT training end */

.leaderboard-zones{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.leaderboard-head{display:flex;justify-content:space-between;align-items:end;gap:12px;margin-bottom:12px}
.leaderboard-head h2{margin:0}
.leaderboard-head span{color:var(--paper-strong);font-size:.95rem}
.cct-category.active[data-cct-category="good_check"]{background:linear-gradient(180deg,#1e88e5,#0d47a1);color:#fff}
.cct-category.active[data-cct-category="bad_check"]{background:linear-gradient(180deg,#7b1fa2,#4a1363);color:#fff}
.square-55d63.cct-target.cct-good_check,.square-55d63.cct-target.cct-good-check{box-shadow:inset 0 0 0 5px rgba(30,136,229,.9),inset 0 0 18px rgba(30,136,229,.55)}
.square-55d63.cct-target.cct-bad_check,.square-55d63.cct-target.cct-bad-check{box-shadow:inset 0 0 0 5px rgba(123,31,162,.9),inset 0 0 18px rgba(123,31,162,.55)}
@media (max-width:1080px){.leaderboard-zones{grid-template-columns:1fr}.leaderboard-head{align-items:flex-start;flex-direction:column}}

/* CCT equal check start */
.cct-category.active[data-cct-category="equal_check"]{background:linear-gradient(180deg,#00897b,#005f56);color:#fff}
.square-55d63.cct-target.cct-equal_check,.square-55d63.cct-target.cct-equal-check{box-shadow:inset 0 0 0 5px rgba(0,137,123,.9),inset 0 0 18px rgba(0,137,123,.5)}
/* CCT equal check end */

/* CCT timer left layout start */
body[data-page="cct"] .compact-auth {
  align-self: start;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

body[data-page="cct"] .cct-left-timer {
  display: grid;
  gap: 8px;
  padding-top: 6px;
}

body[data-page="cct"] .cct-left-timer .timer-label {
  color: rgba(31, 26, 20, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

body[data-page="cct"] .cct-left-timer .cct-timer-pill {
  box-sizing: border-box;
  display: flex;
  justify-content: center;
  line-height: 1.15;
  min-width: 0;
  padding: 12px 10px;
  text-align: center;
  white-space: normal;
  width: 100%;
}
/* CCT timer left layout end */
