* { box-sizing: border-box; }

/* The Daily pass widget is revealed by its deferred owning stylesheet. */
.daily-pass-widget {
  visibility: hidden;
}

.daily-preview-footer {
  visibility: hidden;
}

html:not([data-boot-main-tab="daily"]) .daily-preview-footer {
  display: none !important;
}

.daily-preview-footer[hidden],
.daily-pass-widget[hidden] {
  display: none !important;
}

/* The opening counter is injected before its deferred Flash Card Hunt styles apply. */
html[data-fch-css-ready="0"] .fch-opening-discovery-counter {
  visibility: hidden;
}

:root {
  --text-primary: #4a5568;
  --text-secondary: #efefef;
  --page-bg: #f9f3e9;
  --border-light: rgba(87, 115, 179, 0.305);
  --bg-sensei-header: #304565f2;
  --coord-color: #63550e;
  --nav-btn-border: rgba(87, 115, 179, 0.305);
  --nav-btn-arrow-color: 74, 85, 104;
  --nav-btn-bg: #f2f1e6;
  --accent: #0077cc;
  --blue: #0077cc;
  --maroon: #d12847;
  --sensei-surface: #7da9eb;
  --sensei-surface-alt: #eef2f7;
  --sensei-text-muted: #000000;
  --selected-button-light-bg: var(--sensei-surface);
}

body[data-mode="dark"] {
  --page-bg: #3b3d41;
  --text-primary: #f2f1e6;
  --text-secondary: #efefef;
  --border-light: rgba(232, 232, 232, 0.305);
  --bg-sensei-header: rgb(69 99 146 / 95%);
  --nav-btn-border: #f2f1e6;
  --nav-btn-arrow-color: 226 226 226;
  --nav-btn-bg: rgb(69 99 146 / 95%);
  --accent: #f59e0b;
  --sensei-surface: #0f172a;
  --sensei-surface-alt: #111827;
  --sensei-text-muted: #cbd5e1;
}

html[data-early-page-theme="dark"] {
  --page-bg: #3b3d41;
  --text-primary: #f2f1e6;
  --text-secondary: #efefef;
  --border-light: rgba(232, 232, 232, 0.305);
  --bg-sensei-header: rgb(69 99 146 / 95%);
  --nav-btn-border: #f2f1e6;
  --nav-btn-arrow-color: 226 226 226;
  --nav-btn-bg: rgb(69 99 146 / 95%);
  --accent: #f59e0b;
  --sensei-surface: #0f172a;
  --sensei-surface-alt: #111827;
  --sensei-text-muted: #cbd5e1;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  font-family: "Segoe UI", Roboto, sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

.nav-hidden {
  display: none !important;
}

html[data-header-auth="logged-in"] #nav-login-link,
html[data-header-auth="logged-in"] #nav-signup-link,
html[data-header-auth="logged-in"] #nav-whyus-link,
html[data-header-auth="logged-in"] #mobile-login-link,
html[data-header-auth="logged-in"] #mobile-signup-link,
html[data-header-auth="logged-in"] #mobile-whyus-link {
  display: none !important;
}

html[data-header-auth="logged-in"] #nav-user-section,
html[data-header-auth="logged-in"] #mobile-user-section {
  display: flex !important;
}

html[data-header-membership="premium"] #nav-pro-badge,
html[data-header-membership="premium"] #mobile-pro-badge,
html[data-header-membership="free"] #nav-pro-upgrade-btn,
html[data-header-membership="free"] #mobile-pro-upgrade-btn {
  display: inline-flex !important;
}

.page-header {
  position: relative;
  height: 50px;
  border-bottom: 1px solid var(--border-light);
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.header-rat-frame {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-left: 25px;
}

#settings-btn.header-settings {
  position: absolute;
  top: 4px;
  left: 12px;
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 0.6;
  margin: 0;
  padding: 0;
}

.cog-icon {
  display: inline-block;
  font-size: 22px;
  color: var(--text-primary);
  background: none;
}

.logo {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
}

.logo h1 {
  margin: 0;
  font-size: 1.82rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: var(--text-primary);
  background-clip: text;
  color: transparent;
  display: inline-block;
  pointer-events: none;
}

.logo h1 .logo-year {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 700;
  background: linear-gradient(135deg, #d4af37 0%, #f0e68c 50%, #d4af37 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.02em;
  position: relative;
  display: inline-block;
}

.header-learning-slogan {
  margin: -4px 0 0 2px;
  font-size: 0.8em;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #4b5563;
  white-space: nowrap;
}

body[data-mode="dark"] .header-learning-slogan,
html[data-early-page-theme="dark"] .header-learning-slogan {
  color: #cbd5e1;
}

.header-logo-particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.header-center-nav {
  position: absolute;
  left: 23%;
  display: flex;
  gap: 40px;
  align-items: center;
}

a.nav-link,
.mobile-settings-link {
  color: var(--text-primary);
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.03em;
  text-transform: uppercase;
  text-decoration: none;
  position: relative;
  padding: 8px 0;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--text-primary);
  transition: width 0.2s ease, background 0.2s ease;
}

a.nav-link:hover,
a.nav-link:hover span {
  color: var(--accent) !important;
}

a.nav-link:hover::after {
  width: 100%;
  background: var(--accent);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2em;
}

.daily-streak-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.daily-streak-chip__image {
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
}

body[data-mode="dark"] .daily-streak-chip__image {
  filter:
    brightness(1.4)
    drop-shadow(0 0 1px rgba(255, 255, 255, 0.22))
    drop-shadow(0 0 1px rgba(255, 244, 214, 0.12));
}

/* Prevent admin workbench panel controls from flashing before deferred admin.css loads. */
#adminContainer,
#openingsAdminContainer,
#openingsTestsAdminContainer,
#flashCardAdminContainer,
#seqCommentAdminContainer,
#lessonsAdminContainer,
#famousGamesAdminContainer {
  display: none;
}

.collection-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 52px;
  text-decoration: none;
}

.header-collection-icon {
  margin-left: 10px;
}

.collection-icon-image {
  height: 55px;
  object-fit: contain;
}

.collection-icon-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #4a2d0f;
  white-space: nowrap;
}

body[data-mode="dark"] .collection-icon-label {
  color: #f3e9d3;
}

.nav-user-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-pro-upgrade-btn {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 5px 15px;
  border-radius: 999px;
  border: 1.5px solid #22c55e;
  background: transparent;
  color: #22c55e;
  cursor: pointer;
  transition: background 0.18s, color 0.18s;
  font-family: inherit;
  white-space: nowrap;
}

.nav-pro-upgrade-btn:hover {
  background: #22c55e;
  color: #fff;
}

.nav-pro-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.16s ease, opacity 0.16s ease;
}

.nav-pro-badge:hover {
  transform: scale(1.05);
}

.nav-pro-badge:focus-visible {
  outline: 2px solid rgba(104, 68, 44, 0.65);
  outline-offset: 2px;
  border-radius: 6px;
}

.nav-pro-badge-icon,
.premium-membership-title-icon {
  width: 40px;
  height: 40px;
  display: block;
  object-fit: contain;
}

.nav-logout-btn {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-transform: none;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--maroon);
  background: transparent;
  color: #d12847;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, opacity 0.15s;
  font-family: inherit;
  white-space: nowrap;
  opacity: 0.75;
}

.header-center-nav .nav-logout-btn {
  position: relative;
}

.header-center-nav .nav-logout-btn[data-username]:not([data-username=""])::after {
  content: attr(data-username);
  position: absolute;
  left: calc(100% + 8px);
  top: 50%;
  margin-top: -11px;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(123, 48, 43, 0.18);
  background: rgba(255, 245, 228, 0.98);
  color: #74302e;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(72, 29, 26, 0.14);
  opacity: 0;
  pointer-events: none;
  z-index: 1200;
  transition: opacity 0.16s ease, left 0.16s ease;
}

.header-center-nav .nav-logout-btn[data-username]:not([data-username=""]):hover::after,
.header-center-nav .nav-logout-btn[data-username]:not([data-username=""]):focus-visible::after {
  opacity: 1;
  left: calc(100% + 10px);
}

.nav-logout-btn:hover {
  background: #d12847;
  color: #fff;
  opacity: 1;
}

.nav-logout-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

body[data-mode="dark"] .nav-logout-btn {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(245, 247, 250, 0.88);
  opacity: 1;
  box-shadow: none;
}

body[data-mode="dark"] .nav-logout-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
  color: #fff;
  box-shadow: none;
}

body[data-mode="dark"] .nav-logout-btn:disabled {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(245, 247, 250, 0.42);
  box-shadow: none;
}

body[data-mode="dark"] .header-center-nav .nav-logout-btn[data-username]:not([data-username=""])::after {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(28, 33, 45, 0.98);
  color: rgba(245, 247, 250, 0.95);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.26);
}

.nav-logging-out {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-primary);
  opacity: 0.5;
}

.mobile-menu .nav-user-section {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0 4px;
  border-top: 1px solid var(--border-light);
  width: 100%;
}

.mobile-menu .nav-pro-upgrade-btn,
.mobile-menu .nav-pro-badge,
.mobile-menu .nav-logout-btn {
  width: 100%;
  text-align: center;
}

.mobile-menu .nav-pro-badge {
  width: auto;
  height: auto;
  align-self: flex-start;
  padding: 4px;
}

.points-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 0 0 0 14px;
  border-left: 1.5px solid var(--border-light);
  white-space: nowrap;
  position: relative;
  z-index: 1003;
}

.points-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #00579b;
  align-self: center;
  padding-bottom: 1px;
}

.points-value {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--blue);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

body[data-mode="dark"] .points-label,
body[data-mode="dark"] .points-value,
html[data-early-page-theme="dark"] .points-label,
html[data-early-page-theme="dark"] .points-value {
  color: var(--accent);
}

.points-modal {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  left: auto;
  max-width: calc(100vw - 16px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px) scale(0.97);
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
}

.points-modal.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.header-burger {
  display: none;
  background: none;
  border: none;
  padding: 6px;
}

.header-burger span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 4px 0;
  background: var(--text-primary);
}

.mobile-menu {
  display: none;
}

.sensei-header-cta {
  display: none;
}

.sensei-content.is-flash-card-hunt .sensei-header-cta {
  display: flex;
}

:where(.sensei-content.is-flash-card-hunt) .collect-cards-hint-row {
  justify-content: flex-start;
  width: 100%;
  max-width: var(--board-size);
  margin-bottom: 4px;
}

:where(.sensei-content.is-flash-card-hunt) .collect-cards-hint-btn {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 5px 12px 5px 9px;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: var(--text-primary);
  box-shadow: 0 7px 18px rgba(2, 6, 23, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-decoration: none;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  white-space: nowrap;
  cursor: pointer;
}

:where(.sensei-content.is-flash-card-hunt) .collect-cards-hint-text {
  color: #fef3c7;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 1;
}

:where(.sensei-content.is-flash-card-hunt) .collect-cards-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, #fef3c7 0%, #fde68a 55%, #f59e0b 100%);
  color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.55), 0 3px 9px rgba(245, 158, 11, 0.35);
  font-size: 12px;
  line-height: 1;
  filter: none;
}

:where(.sensei-content.is-flash-card-hunt) .collect-cards-hint-btn::after {
  content: "";
  position: absolute;
  inset: 1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(115deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 40%);
  pointer-events: none;
}

/* Keep lives text hidden until deferred main.css applies full styling. */

@media (max-width: 1200px) {
  #settings-btn.header-settings {
    top: 4px;
    left: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
  }

  .cog-icon {
    font-size: 18px;
  }
}

.main-page-layout {
  display: grid;
  --main-layout-gap: clamp(8px, 1vw, 14px);
  --sensei-panel-width: clamp(435px, 36vw, 525px);
  grid-template-columns: minmax(156px, 210px) minmax(12px, 1fr) minmax(auto, max-content) minmax(12px, 1fr) var(--sensei-panel-width);
  grid-template-areas: "control . chess . sensei";
  width: 100%;
  padding: 20px 20px 20px 0;
  margin: 0;
  align-items: stretch;
  justify-content: stretch;
  column-gap: var(--main-layout-gap);
  position: relative;
}

.control-panel {
  grid-area: control;
  width: clamp(156px, 15vw, 210px);
  padding: 10px 12px 28px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.quick-tabs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}

.quick-tab {
  min-height: 40px;
  height: 42px;
  width: 100%;
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 12.5px;
  font-weight: 680;
  text-transform: uppercase;
  letter-spacing: -0.01em;
  text-align: left;
  display: flex;
  align-items: center;
  text-decoration: none;
  cursor: pointer;
  color: #4b5563;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

body[data-mode="dark"] .quick-tab {
  background: #1e2a3a;
  color: #cbd5e1;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.quick-tab.active {
  background: var(--selected-button-light-bg);
  border: 2px solid #5eb33d;
  color: #5eb33d;
  font-weight: 800;
  transform: translateY(-1px);
}

body[data-mode="light"] .quick-tab.active,
body:not([data-mode="dark"]) .quick-tab.active {
  background: #ffffff;
}

body[data-mode="dark"] .quick-tab.active {
  background: #263245;
  border-color: rgba(94, 179, 61, 0.7);
  color: #5eb33d;
}

.quick-tab.admin-tab {
  display: none;
}

.chess-section {
  grid-area: chess;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 100%;
}

/* Daily viewport first-paint styles (moved from deferred main.css). */
.challenge-start-visual {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  cursor: default;
  margin-top: 14px;
  min-height: 250px;
}

.challenge-start-visual.is-hydrating .challenge-start-title-row,
.challenge-start-visual.is-hydrating .challenge-subtitle,
.challenge-start-visual.is-hydrating .challenge-start-play-btn,
.challenge-start-visual.is-hydrating .challenge-title-preview {
  display: none;
}

.challenge-start-visual.is-hydrating .daily-start-loading-slot {
  display: flex;
}

.challenge-start-title-row {
  font-family: "nyt-karnak", Georgia, "Times New Roman", serif;
  margin-top: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 4px;
}

.challenge-img-wrap {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 2px;
}

.challenge-start-title-row .challenge-img-wrap {
  width: auto;
  justify-content: flex-end;
  margin-bottom: 0;
}

.challenge-start-img {
  width: 10%;
  height: auto;
  display: block;
}

.challenge-start-title-row .challenge-start-img {
  width: clamp(31px, 1vw, 90px);
  height: auto;
}

.challenge-start-title-row .typewriter-text {
  width: auto;
  text-align: left;
  margin: 0;
  padding: 0;
}

.challenge-start-title-row picture {
  display: block;
  line-height: 0;
}

.typewriter-text {
  width: 100%;
  text-align: center;
  font-family: "Georgia", "Times New Roman", serif;
  font-size: clamp(1.25rem, 2.6vw, 1.7rem);
  font-weight: 900;
  letter-spacing: 0.11em;
  line-height: 1;
  color: #111827;
  background: linear-gradient(180deg, #1f2937 0%, #0b1324 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 auto;
  padding: 0 12px 0;
  text-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
  pointer-events: none;
  opacity: 0;
  transition: opacity 560ms ease;
}

.chessboon-copyright {
  display: inline-block;
  margin-left: 1px;
  font-size: 0.56em;
  vertical-align: super;
  line-height: 1;
}

.typewriter-text.is-visible {
  opacity: 1;
}

.challenge-subtitle {
  font-family: "nyt-karnak", Georgia, "Times New Roman", serif;
  width: 100%;
  max-width: 28ch;
  margin: 20px auto 10px;
  text-align: center;
  color: #101827;
  font-size: clamp(1rem, 1.7vw, 1.46rem);
  font-weight: 500;
  letter-spacing: 0.015em;
  line-height: 1.22;
  padding: 0 12px;
}

.challenge-subtitle.is-warning {
  color: #9a3412;
}

.daily-slow-network-retry-wrap {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 0 auto 10px;
  padding: 0 12px;
}

.daily-slow-network-retry-wrap[hidden] {
  display: none !important;
  pointer-events: none;
}

.daily-slow-network-retry-btn {
  appearance: none;
  min-width: 132px;
  border: 2px solid #5b3207;
  border-radius: 999px;
  background: linear-gradient(180deg, #f7df9d 0%, #e9b64d 52%, #c1842a 100%);
  color: #2f1a00;
  padding: 8px 18px;
  font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 #5b3207, 0 9px 18px rgba(55, 29, 2, 0.3);
  transition: transform 130ms ease, box-shadow 130ms ease, filter 130ms ease;
}

.daily-slow-network-retry-btn:hover,
.daily-slow-network-retry-btn:focus-visible {
  outline: none;
  transform: translateY(-1px);
  box-shadow: 0 5px 0 #5b3207, 0 12px 20px rgba(55, 29, 2, 0.34);
  filter: saturate(1.08);
}

.daily-slow-network-retry-btn:active {
  transform: translateY(1px);
  box-shadow: 0 3px 0 #5b3207, 0 7px 12px rgba(55, 29, 2, 0.28);
}

.daily-slow-network-retry-btn:disabled {
  cursor: wait;
  opacity: 0.8;
  transform: none;
}

body[data-mode="dark"] .challenge-subtitle.is-warning {
  color: #fbbf24;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.6);
}

body[data-mode="dark"] .daily-slow-network-retry-btn {
  border-color: #e5b75a;
  background: linear-gradient(180deg, #6a4b18 0%, #8b5e22 52%, #bb8738 100%);
  color: #f8eed6;
  box-shadow: 0 4px 0 #4a3110, 0 9px 18px rgba(2, 6, 23, 0.44);
}

@media (max-width: 520px) {
  .daily-slow-network-retry-btn {
    min-width: 118px;
    padding: 8px 14px;
    font-size: 0.81rem;
    letter-spacing: 0.06em;
  }
}

.challenge-start-play-btn {
  margin: 24px auto 0;
  min-width: 144px;
  border: none;
  border-radius: 999px;
  padding: 12px 28px;
  font-size: 1.02rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  line-height: 1;
  color: #fff;
  background: linear-gradient(135deg, #b11f3f 0%, #df3e35 100%);
  box-shadow: 0 7px 14px rgba(177, 31, 63, 0.28);
  cursor: pointer;
  transition: box-shadow 160ms ease, filter 120ms ease;
}

.challenge-start-play-btn:hover {
  transform: none !important;
  box-shadow: 0 8px 16px rgba(177, 31, 63, 0.3);
  filter: saturate(1.03);
}

.challenge-start-play-btn:active {
  transform: none !important;
}

.challenge-start-play-btn[aria-busy="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: wait;
}

.challenge-start-play-btn__spinner {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: daily-play-button-spin 700ms linear infinite;
}

@keyframes daily-play-button-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-start-play-btn__spinner {
    animation: none;
  }
}

body[data-mode="dark"] .challenge-subtitle {
  color: var(--sensei-text-muted);
}

body[data-mode="dark"] .typewriter-text {
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(15, 23, 42, 0.5);
}

.challenge-title-preview {
  margin-top: 12px;
  width: 100%;
  padding: 0 12px;
  pointer-events: none;
  text-align: center;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.challenge-title-preview__line {
  margin: 0 auto;
  width: min(100%, 560px);
  display: inline-flex;
  font-family: system-ui, "Segoe UI", sans-serif;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.challenge-title-preview__name {
  font-size: 1rem;
  line-height: 1.3;
  font-weight: 600;
  color: #0f172a;
}

.challenge-title-preview__separator {
  color: #357dcd;
  font-size: 1rem;
  line-height: 1;
  font-weight: 700;
}

.challenge-title-preview__opening {
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
  color: #334155;
}

.challenge-title-preview__opening.is-empty {
  color: #94a3b8;
  font-style: italic;
}

#challengeStartContainer {
  position: relative;
}

html[data-main-tab-restoring="1"] #challengeStartContainer > :not(#dailyStartLoadingSlot),
#challengeStartContainer.is-hydrating > :not(#dailyStartLoadingSlot) {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.sensei-content.is-daily-challenge #challengeStartContainer {
  min-height: 0;
}

html[data-boot-main-tab="daily"] .sensei-content.is-daily-challenge {
  --bg-sensei-header: rgb(69 99 146 / 95%);
  --sensei-surface: #0f172a;
  --sensei-surface-alt: #111827;
  --sensei-text-muted: #cbd5e1;
  background: #000;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) {
  --bg-sensei-header: rgb(69 99 146 / 95%);
  --sensei-surface: #0f172a;
  --sensei-surface-alt: #111827;
  --sensei-text-muted: #cbd5e1;
  background: #000;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .challenge-subtitle {
  color: #cbd5e1;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .typewriter-text {
  background: linear-gradient(180deg, #f8fafc 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(15, 23, 42, 0.5);
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .challenge-subtitle.is-warning {
  color: #fbbf24;
  font-size: 1rem;
  text-shadow: 0 1px 0 rgba(15, 23, 42, 0.6);
}

.sensei-content.is-flash-card-hunt,
.sensei-content.is-opening-drills,
.sensei-content.is-lessons,
.sensei-content.is-famous-games {
  background-image: none;
}

.challenge-title-preview.is-hydrating {
  margin-top: 12px;
}

.daily-start-loading-slot {
  margin-top: 34px;
  width: 100%;
  min-height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
}

.daily-start-loading-indicator {
  width: min(100%, 360px);
  margin: 0 auto;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid rgba(53, 125, 205, 0.25);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(246, 250, 255, 0.92) 100%);
  color: #1f3b5b;
  font-family: "nyt-karnak", Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.daily-start-loading-indicator__ring {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 2px solid rgba(53, 125, 205, 0.24);
  border-top-color: #357dcd;
  animation: daily-start-loading-spin 900ms linear infinite;
}

.daily-start-loading-recovery {
  width: min(100%, 380px);
  margin: 0 auto;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(53, 125, 205, 0.3);
  border-radius: 8px;
  background: #f6faff;
  color: #1f3b5b;
}

.daily-start-loading-recovery__message {
  font-family: "nyt-karnak", Georgia, "Times New Roman", serif;
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.35;
}

.daily-start-loading-recovery__retry {
  appearance: none;
  flex: 0 0 auto;
  border: 1px solid #2563a8;
  border-radius: 6px;
  background: #2563a8;
  color: #fff;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.daily-start-loading-recovery__retry:hover,
.daily-start-loading-recovery__retry:focus-visible {
  outline: none;
  background: #174d87;
  border-color: #174d87;
  box-shadow: 0 0 0 3px rgba(37, 99, 168, 0.2);
}

.daily-start-loading-recovery__retry:disabled {
  cursor: wait;
  opacity: 0.7;
}

@keyframes daily-start-loading-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

body[data-mode="dark"] .daily-start-loading-indicator {
  border-color: rgba(96, 165, 250, 0.32);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(22, 30, 47, 0.96) 100%);
  color: #dbeafe;
}

body[data-mode="dark"] .daily-start-loading-indicator__ring {
  border-color: rgba(147, 197, 253, 0.24);
  border-top-color: #93c5fd;
}

body[data-mode="dark"] .daily-start-loading-recovery {
  border-color: rgba(96, 165, 250, 0.36);
  background: #172033;
  color: #dbeafe;
}

body[data-mode="dark"] .daily-start-loading-recovery__retry {
  border-color: #60a5fa;
  background: #2563a8;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .daily-start-loading-indicator {
  border-color: rgba(96, 165, 250, 0.32);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(22, 30, 47, 0.96) 100%);
  color: #dbeafe;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .daily-start-loading-indicator__ring {
  border-color: rgba(147, 197, 253, 0.24);
  border-top-color: #93c5fd;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .daily-start-loading-recovery {
  border-color: rgba(96, 165, 250, 0.36);
  background: #172033;
  color: #dbeafe;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .daily-start-loading-recovery__retry {
  border-color: #60a5fa;
  background: #2563a8;
}

body[data-mode="dark"] .challenge-title-preview__name {
  color: #f8fbff;
  text-shadow: 0 1px 1px rgba(2, 6, 23, 0.82);
  font-size: 1rem;
  line-height: 1.35;
}

body[data-mode="dark"] .challenge-title-preview__separator {
  color: #f7b64c;
  text-shadow: 0 0 8px rgba(247, 182, 76, 0.28);
  font-size: 1rem;
}

body[data-mode="dark"] .challenge-title-preview__opening {
  color: #e9f2ff;
  text-shadow: 0 1px 1px rgba(2, 6, 23, 0.78);
  font-size: 1rem;
  line-height: 1.35;
}

body[data-mode="dark"] .challenge-title-preview__opening.is-empty {
  color: #64748b;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .challenge-title-preview__name {
  color: #f8fbff;
  text-shadow: 0 1px 1px rgba(2, 6, 23, 0.82);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .challenge-title-preview__separator {
  color: #f7b64c;
  text-shadow: 0 0 8px rgba(247, 182, 76, 0.28);
  font-size: 1rem;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .challenge-title-preview__opening {
  color: #e9f2ff;
  text-shadow: 0 1px 1px rgba(2, 6, 23, 0.78);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.sensei-content.is-daily-challenge:has(> #challengeStartContainer #challengeTitlePreview) .challenge-title-preview__opening.is-empty {
  color: #64748b;
}

.sensei-panel {
  grid-area: sensei;
  width: var(--sensei-panel-width);
  max-width: var(--sensei-panel-width);
  height: calc(100vh - 90px);
  margin: 0;
  align-self: start;
  justify-self: stretch;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(20px);
  border-radius: 0;
  z-index: 900;
}

.sensei-header {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-sensei-header);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  min-height: 60px;
  display: flex;
  align-items: center;
}

.moves-today-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  align-items: flex-start;
  justify-content: flex-start;
}

.moves-today-label {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.025em;
  text-align: left;
  line-height: 1.3;
  margin: 0;
}

.moves-today-track {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  width: 100%;
}

.sensei-content {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  position: relative;
  background: linear-gradient(180deg, var(--sensei-surface) 0%, var(--sensei-surface-alt) 100%);
}

.sensei-content::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sensei-content.is-flash-card-hunt {
  --bg-sensei-header: #17382e;
  --sensei-surface: #dcefe5;
  --sensei-surface-alt: #fbfdfb;
  --sensei-text-muted: #000000;
  background: linear-gradient(180deg, #d5ecdf 0%, #edf8f2 54%, #fbfdfb 100%);
}

.sensei-content.is-lessons,
.sensei-content.is-famous-games {
  --sensei-text-muted: #000000;
}

.sensei-content.is-opening-drills {
  --bg-sensei-header: #7da7cf;
  --sensei-surface: #edf6fc;
  --sensei-surface-alt: #f9fcfe;
  background: linear-gradient(180deg, #e2f0fa 0%, #f1f8fd 46%, #f9fcfe 100%);
}

html[data-early-page-theme="dark"] .sensei-content.is-opening-drills {
  --bg-sensei-header: #7da7cf;
  --sensei-surface: #edf6fc;
  --sensei-surface-alt: #f9fcfe;
  --sensei-text-primary: #000000;
  --sensei-text-muted: #000000;
  --sensei-bubble-bg: #ffffff;
  --sensei-bubble-border: rgba(125, 167, 207, 0.28);
  background: linear-gradient(180deg, #e2f0fa 0%, #f1f8fd 46%, #f9fcfe 100%);
}

.sensei-content.is-lessons {
  --bg-sensei-header: #3f6f5a;
  --sensei-surface: #edf7ec;
  --sensei-surface-alt: #fbfdf8;
  background: linear-gradient(180deg, #e5f4e7 0%, #f3faf1 48%, #fffdf5 100%);
}

.sensei-content.is-famous-games {
  --bg-sensei-header: #542038;
  --sensei-surface: #f8edf2;
  --sensei-surface-alt: #fff8f5;
  background: linear-gradient(180deg, #f4e4eb 0%, #fff4f1 50%, #fbf7ef 100%);
}

@media (max-width: 1200px) {
  .quick-tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding: 6px 10px 16px;
  }

  .quick-tab {
    flex: 0 0 auto;
    width: auto;
    min-width: clamp(120px, 22vw, 170px);
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 900px) {
  .page-header {
    height: 60px;
    padding: 0 14px;
  }

  #settings-btn.header-settings {
    display: none;
  }

  .header-rat-frame {
    gap: 10px;
    padding-left: 8px;
  }

  .header-center-nav {
    display: none;
  }

  .header-burger {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: rgba(26, 31, 40, 0.98);
    padding: 12px 20px 16px;
    z-index: 999;
  }

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

  .mobile-menu .nav-link {
    display: block;
    padding: 10px 0;
    font-size: 15px;
    color: var(--text-secondary);
  }

  .mobile-menu .mobile-settings-link {
    width: 100%;
    border: 0;
    background: none;
    appearance: none;
    text-align: start;
    cursor: pointer;
  }

  .main-page-layout {
    display: flex;
    flex-direction: column;
    padding: 10px 10px 14px;
    gap: 10px;
  }

  .control-panel {
    width: 100%;
    padding: 0;
    order: 1;
  }

  .chess-section {
    order: 2;
  }
}
