:root {
  color-scheme: dark;
  --bg: #07090c;
  --page: #0d1117;
  --surface: rgba(18, 23, 29, 0.88);
  --surface-soft: rgba(28, 35, 44, 0.92);
  --surface-dark: #0b0f14;
  --line: rgba(153, 173, 191, 0.22);
  --line-strong: rgba(181, 204, 223, 0.34);
  --text: #d6dde3;
  --muted: #92a0ad;
  --faint: #64717d;
  --accent: #4dd86f;
  --accent-soft: rgba(77, 216, 111, 0.14);
  --accent-2: #48c7e8;
  --accent-2-soft: rgba(72, 199, 232, 0.14);
  --accent-3: #e8c96a;
  --good: #4dd86f;
  --good-soft: rgba(77, 216, 111, 0.14);
  --warn: #e8c96a;
  --warn-soft: rgba(232, 201, 106, 0.14);
  --bad: #ff6b6b;
  --bad-soft: rgba(255, 107, 107, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 14px 40px rgba(0, 0, 0, 0.22);
  --radius: 8px;
  --radius-sm: 6px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
  --app-vw: 100vw;
  --app-vh: 100vh;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* The web fallback mirrors a Live Activity without assuming a particular
   Dynamic Island/notch width.  The native target uses the same content in
   compact regions; on the web the width is always capped to the viewport. */
.live-timer-island {
  position: fixed;
  top: max(8px, calc(var(--safe-top) + 4px));
  left: 50%;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 1.8vw, 14px);
  inline-size: fit-content;
  max-inline-size: calc(100vw - max(24px, var(--safe-left, 0px) + var(--safe-right, 0px) + 24px));
  min-height: 42px;
  padding: 7px clamp(12px, 2.5vw, 18px);
  overflow: hidden;
  transform: translateX(-50%);
  border: 1px solid rgba(228, 244, 255, 0.19);
  border-radius: 999px;
  background: rgba(4, 7, 10, 0.94);
  color: #f5fbff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  pointer-events: auto;
}
.live-timer-island[hidden] { display: none; }
.live-timer-island-mark {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: var(--accent);
  font-size: 0.78rem;
}
.live-timer-island-label {
  max-width: min(34vw, 220px);
  overflow: hidden;
  color: #c4d1dc;
  font-size: 0.78rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.live-timer-island strong {
  color: #fff;
  font-family: var(--mono);
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.live-timer-island-action {
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(77, 216, 111, 0.48);
  border-radius: 999px;
  background: rgba(77, 216, 111, 0.13);
  color: #baf4c8;
  font-size: 0.73rem;
  font-weight: 800;
  white-space: nowrap;
}

/* A phone fallback should look like the native compact Dynamic Island: the
   timer and mark are enough to identify the active session.  The pill itself
   remains tappable and resumes the session when the task screen is not open. */
html[data-device="mobile"] .live-timer-island {
  gap: 7px;
  min-height: 36px;
  padding: 5px 10px;
}
html[data-device="mobile"] .live-timer-island-label,
html[data-device="mobile"] .live-timer-island-action {
  display: none;
}
html[data-device="mobile"] .live-timer-island strong {
  font-size: 1.02rem;
}
.active-timer-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  margin: 0 0 22px;
  border-color: rgba(77, 216, 111, 0.34);
  background: linear-gradient(120deg, rgba(77, 216, 111, 0.12), rgba(18, 23, 29, 0.88));
}
.active-timer-panel h2 { margin: 8px 0 4px; letter-spacing: 0; }
.active-timer-panel p { margin: 0; color: var(--muted); }
.active-timer-panel-clock {
  color: #f5fbff;
  font-family: var(--mono);
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}
.active-timer-panel .hero-actions { margin: 0; }
.setting-status {
  display: grid;
  gap: 4px;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(77, 216, 111, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(77, 216, 111, 0.08);
}
.setting-status strong {
  color: #baf4c8;
  font-size: 0.88rem;
}
.setting-status span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}
@media (max-width: 720px) {
  .live-timer-island {
    gap: 8px;
    min-height: 38px;
    padding: 5px 10px;
  }
  .live-timer-island-label { max-width: 30vw; font-size: 0.7rem; }
  .live-timer-island-action { padding-inline: 7px; font-size: 0.68rem; }
  .active-timer-panel { grid-template-columns: 1fr auto; gap: 12px; }
  .active-timer-panel .hero-actions { grid-column: 1 / -1; }
}

/* Result screens keep the decision-making metrics visible and move mechanics into details. */
.result-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 0;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(8, 12, 17, 0.92);
}
.result-hero-primary,
.result-hero-read {
  min-width: 0;
  padding: 24px;
}
.result-hero-primary {
  border-right: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(77, 216, 111, 0.14), rgba(8, 12, 17, 0.02));
}
.result-hero small,
.result-record-card small,
.result-detail-grid small {
  display: block;
  color: #91a7b8;
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.result-hero-primary strong {
  display: block;
  margin-top: 8px;
  color: #73ef8d;
  font-size: clamp(3rem, 8vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}
.result-hero-primary span,
.result-hero-read span,
.result-record-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.5;
}
.result-hero-read strong {
  display: block;
  margin-top: 10px;
  color: #f0f5fa;
  font-size: clamp(1.4rem, 3vw, 2.35rem);
  line-height: 1.15;
  letter-spacing: 0;
}
.result-hero.good .result-hero-read strong { color: #9af2a8; }
.result-hero.warn .result-hero-read strong { color: #f2d982; }
.result-hero.bad .result-hero-read strong { color: #f1a1a1; }
.result-key-grid { margin-top: 12px; }
.result-key-card {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.result-key-card strong {
  font-size: clamp(1.45rem, 3.5vw, 2.3rem);
  line-height: 1.05;
}
.result-key-card span {
  font-size: 0.86rem;
}
.result-target,
.result-record-grid,
.result-detail-grid {
  margin-top: 14px;
}
.result-target {
  padding: 16px 18px;
  border: 1px solid rgba(77, 216, 111, 0.28);
  border-radius: var(--radius-sm);
  background: rgba(77, 216, 111, 0.07);
}
.result-target strong,
.result-target span,
.result-target small {
  display: block;
}
.result-target strong {
  color: #dfffe4;
  font-size: 1.02rem;
}
.result-target span {
  margin-top: 6px;
  color: #b7f6c1;
  font-weight: 800;
  line-height: 1.5;
}
.result-target small {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.5;
}
.result-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.result-record-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 20, 26, 0.86);
}
.result-record-card strong {
  display: block;
  margin-top: 8px;
  color: #62ed83;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.05;
  letter-spacing: 0;
}
.result-more { margin-top: 18px; }
.result-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.result-detail-grid > div {
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(15, 20, 26, 0.72);
}
.result-detail-grid strong,
.result-detail-grid span {
  display: block;
  margin-top: 7px;
  color: #d6e0e8;
  font-size: 1rem;
  line-height: 1.35;
}
.result-detail-grid span strong { margin-top: 0; }
.score-explanation {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  line-height: 1.55;
}
.nested-details { margin-top: 14px; }

@media (max-width: 720px) {
  .result-hero { grid-template-columns: 1fr; }
  .result-hero-primary { border-right: 0; border-bottom: 1px solid var(--line); }
  .result-record-grid { grid-template-columns: 1fr; }
  .result-detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-detail-grid > div:last-child { grid-column: 1 / -1; }
}

* { box-sizing: border-box; }
html, body { min-height: 100%; overflow-x: hidden; }
html { background: var(--bg); }
body {
  margin: 0;
  font-family: var(--font);
  background:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.014) 1px, transparent 1px),
    linear-gradient(180deg, #090d12 0%, #07090c 42%, #050608 100%);
  background-size: 44px 44px, 44px 44px, auto;
  color: var(--text);
  font-size: 16px;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
b, strong { color: #eef3f7; }
#app {
  min-height: 100vh;
  min-height: 100dvh;
  min-height: var(--app-vh);
  padding-bottom: var(--safe-bottom);
  background:
    linear-gradient(180deg, rgba(72, 199, 232, 0.06), transparent 320px),
    linear-gradient(90deg, rgba(77, 216, 111, 0.045), transparent 34%, transparent 66%, rgba(232, 201, 106, 0.035));
}

.topbar {
  position: sticky;
  top: 10px;
  z-index: 30;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 14px;
  width: min(1220px, calc(100% - 22px));
  margin: 0 auto 8px;
  padding: 12px clamp(12px, 2.4vw, 22px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 10, 14, 0.82);
  box-shadow: 0 18px 70px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}
.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  flex: 0 0 auto;
  object-fit: contain;
}
.brand strong { display: block; font-size: 1.02rem; line-height: 1.08; }
.brand small { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 3px; }
.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.25vw, 16px);
  min-width: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  flex: 0 0 auto;
  color: #aebac5;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  padding: 8px 0;
}
.site-nav a:hover {
  color: #f0f5f8;
  text-decoration: none;
}
.site-nav .language-link {
  padding-left: clamp(10px, 1.5vw, 18px);
  border-left: 1px solid var(--line);
  color: #eef3f7;
}
.nav-group {
  position: relative;
  flex: 0 0 auto;
}
.nav-group > summary {
  padding: 8px 0;
  color: #aebac5;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1;
  list-style: none;
  white-space: nowrap;
}
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary::after {
  display: inline-block;
  margin-left: 5px;
  color: #6f8190;
  content: '⌄';
  font-size: 0.8em;
}
.nav-group[open] > summary,
.nav-group > summary:hover { color: #f0f5f8; }
.nav-group[open] > summary::after { content: '⌃'; }
.nav-group-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  z-index: 40;
  display: grid;
  min-width: 168px;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(10, 15, 20, 0.98);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42);
}
.nav-group-menu a { padding: 9px 10px; }
.nav-group-menu a:hover { background: rgba(77, 216, 111, 0.1); }
.nav-group.language-group {
  margin-left: clamp(6px, 1vw, 14px);
  padding-left: clamp(8px, 1.2vw, 16px);
  border-left: 1px solid var(--line);
}
.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.top-actions a,
.brand {
  text-decoration: none;
}

#main {
  position: relative;
  width: min(1180px, calc(100% - 22px));
  min-height: calc(var(--app-vh) - 64px);
  margin: 0 auto;
  padding: 28px clamp(0px, 2vw, 18px) 90px;
  background: transparent;
  overflow-x: clip;
  overflow-y: visible;
}
#main::before {
  content: "FOCUS SPRINT";
  position: absolute;
  top: 94px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 0;
  color: rgba(230, 242, 255, 0.032);
  font-size: clamp(3.2rem, 10vw, 8rem);
  font-style: italic;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
  letter-spacing: 0.02em;
}
#main > * { position: relative; z-index: 1; }
#main:focus { outline: none; }

html[data-device="desktop"] .topbar {
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr) auto;
}

html[data-device="tablet"] .topbar {
  grid-template-columns: minmax(180px, 1fr) auto;
  grid-template-rows: auto auto;
  top: max(6px, var(--safe-top));
}

html[data-device="tablet"] .site-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  justify-content: flex-start;
  padding-top: 10px;
  border-top: 1px solid #1d1d1d;
}

html[data-device="tablet"] .top-actions {
  grid-column: 2;
  grid-row: 1;
  flex-wrap: nowrap;
}

html[data-device="mobile"] #main {
  width: 100%;
  min-height: calc(var(--app-vh) - 84px);
  padding: 16px 8px calc(70px + var(--safe-bottom));
  overflow-x: hidden;
}

html[data-device="mobile"] #main::before {
  top: 78px;
  font-size: clamp(3rem, 16vw, 4.6rem);
}

html[data-device="mobile"] .topbar {
  top: max(6px, var(--safe-top));
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 10px;
  width: calc(100% - 12px);
  padding: 10px 12px;
}

html[data-device="mobile"] .brand-mark {
  width: 34px;
  height: 34px;
}

html[data-device="mobile"] .site-nav {
  grid-column: auto;
  justify-content: flex-start;
  gap: 14px;
  padding: 10px 0 2px;
  border-top: 1px solid #1d1d1d;
  overflow-x: auto;
  scrollbar-width: none;
}

html[data-device="mobile"] .site-nav::-webkit-scrollbar {
  display: none;
}

html[data-device="mobile"] .top-actions {
  justify-content: stretch;
}

html[data-device="mobile"] .top-actions .btn {
  flex: 1;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1220px, calc(100% - 22px));
  margin: 0 auto 14px;
  padding: 18px clamp(14px, 3vw, 28px) 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 10, 14, 0.72);
  color: var(--muted);
}
.site-footer strong {
  display: block;
  color: #cfcfcf;
  font-size: 0.92rem;
}
.site-footer span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  line-height: 1.35;
}
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 14px;
}
.site-footer a {
  color: #a8cdb0;
  font-size: 0.84rem;
  text-decoration: none;
}
.site-footer a:hover {
  color: #eff8f1;
  text-decoration: none;
}

.content-page {
  overflow: visible;
}
.content-page::before {
  top: 82px;
}
.content-panel {
  max-width: 920px;
}
.content-panel h1,
.content-panel h2 {
  color: #eef3f7;
  letter-spacing: 0;
}
.content-panel h1 {
  margin: 16px 0 12px;
  font-size: clamp(1.7rem, 4vw, 2.45rem);
}
.content-panel h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
}
.content-panel p,
.content-panel li {
  color: var(--text);
  line-height: 1.72;
}
.content-panel ul,
.content-panel ol {
  margin: 10px 0 0 20px;
  padding: 0;
}
.content-panel li + li {
  margin-top: 6px;
}
.content-panel a,
.contact-box a {
  color: #9ceeb0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.content-guide-grid {
  margin-top: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.contact-box {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 0;
  margin-top: 16px;
  border: 1px solid var(--line);
}
.contact-box strong,
.contact-box span {
  min-width: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
  color: var(--text);
}
.contact-box strong:nth-child(1),
.contact-box span:nth-child(2) {
  border-top: 0;
}
.contact-box strong {
  background: #222222;
  color: #d0d0d0;
}
.contact-box span {
  border-left: 1px solid var(--line);
  background: #151515;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  max-width: 1040px;
  margin: 38px auto 34px;
}
.hero > .panel { margin: 0; }
.hero > .score-panel { margin: 0 auto; }
.intro-copy { padding: 0; overflow: hidden; }
.test-title {
  display: block;
  padding: 18px 20px;
  background:
    linear-gradient(90deg, rgba(77, 216, 111, 0.22), rgba(72, 199, 232, 0.12)),
    rgba(10, 18, 18, 0.96);
  color: #f3f8f5;
  text-align: center;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  font-weight: 800;
  line-height: 1.35;
  word-break: keep-all;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.attempt-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 4vw, 34px);
  padding: 16px 16px 6px;
  color: var(--muted);
}
.attempt-strip b {
  color: #b5fac0;
  font-size: 1.05rem;
}
.mode-strip {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 640px) {
  html[data-device="mobile"]:has(#mobileMenuBtn) .brand {
    grid-column: 1;
    grid-row: 1;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .top-actions {
    grid-column: 2;
    grid-row: 1;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .mobile-menu-btn {
    grid-column: 3;
    grid-row: 1;
  }
}

.ranking-page-intro {
  max-width: 980px;
  margin: 18px auto 8px;
  padding: 22px 24px;
  background: rgba(12, 16, 21, 0.78);
}
.ranking-page-intro h1 {
  margin: 10px 0 6px;
  letter-spacing: 0;
}
.ranking-page-intro p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}
.reminder-settings {
  margin: 20px 0;
  padding: 16px;
  border: 1px solid rgba(153, 173, 191, 0.2);
  border-radius: var(--radius-sm);
  background: rgba(12, 17, 22, 0.62);
}
.reminder-settings-title {
  margin: 0 0 14px;
  align-items: start;
}
.reminder-settings-title h3 { margin: 0 0 5px; letter-spacing: 0; }
.reminder-settings-title p { margin: 0; color: var(--muted); font-size: 0.84rem; }
.reminder-status {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}
.reminder-status.is-on {
  border-color: rgba(77, 216, 111, 0.45);
  background: rgba(77, 216, 111, 0.1);
  color: #baf4c8;
}
.reminder-controls {
  display: grid;
  grid-template-columns: minmax(150px, 0.55fr) minmax(0, 1.45fr);
  gap: 14px;
  align-items: end;
}
.reminder-time-field { display: grid; gap: 6px; }
.reminder-time-field > span,
.reminder-days legend { color: var(--muted); font-size: 0.76rem; font-weight: 800; }
.reminder-time-field input { width: 100%; }
.reminder-days { min-width: 0; margin: 0; padding: 0; border: 0; }
.reminder-days legend { margin-bottom: 6px; padding: 0; }
.reminder-days > div { display: flex; flex-wrap: wrap; gap: 5px; }
.day-choice { position: relative; cursor: pointer; }
.day-choice input { position: absolute; opacity: 0; pointer-events: none; }
.day-choice span {
  display: inline-grid;
  min-width: 35px;
  min-height: 34px;
  place-items: center;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(18, 25, 32, 0.8);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}
.day-choice input:checked + span {
  border-color: rgba(77, 216, 111, 0.55);
  background: rgba(77, 216, 111, 0.14);
  color: #caffd1;
}
.reminder-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.reminder-note { margin: 12px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.5; }

@media (max-width: 640px) {
  .ranking-page-intro { margin-top: 10px; padding: 18px 16px; }
  .reminder-settings { padding: 13px; }
  .reminder-controls { grid-template-columns: 1fr; }
  .reminder-actions .btn { flex: 1 1 100%; }
}

@media (max-width: 640px) {
  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav > .nav-group {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
    min-width: 0;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav > .nav-group > summary {
    display: block;
    min-width: 0;
    padding: 11px 8px;
    border: 1px solid rgba(153, 173, 191, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(18, 25, 32, 0.84);
    color: #c2cfda;
    text-align: center;
    font-size: 0.78rem;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav .nav-group-menu {
    position: static;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    min-width: 0;
    gap: 5px;
    padding: 5px 0 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav .nav-group[open] .nav-group-menu {
    display: grid;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav .nav-group-menu a {
    padding: 10px 8px;
    border: 1px solid rgba(153, 173, 191, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(18, 25, 32, 0.84);
    text-align: center;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav .nav-group.language-group {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  html[data-device="mobile"] .site-nav:not(#siteNav) {
    flex-wrap: wrap;
    gap: 8px 12px;
    overflow: visible;
  }
}

.mode-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-bottom: 1px solid var(--line);
  background: rgba(153, 173, 191, 0.16);
}
.mode-chip {
  min-width: 0;
  padding: 14px 12px;
  border-left: 0;
  background: rgba(13, 18, 24, 0.72);
  text-align: center;
}
.mode-chip b {
  display: block;
  color: #bdf9c6;
  font-size: 1.02rem;
  line-height: 1.2;
}
.mode-chip small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: keep-all;
}
.hero h1 {
  max-width: 820px;
  margin: 32px auto 0;
  padding: 0 20px;
  color: #eef3f7;
  font-size: clamp(1.62rem, 4.6vw, 2.65rem);
  line-height: 1.25;
  letter-spacing: 0;
  font-weight: 800;
  text-align: center;
}
.hero p {
  max-width: 820px;
  margin: 20px auto 0;
  padding: 0 24px;
  color: var(--text);
  font-size: 1.04rem;
  line-height: 1.72;
}
.hero-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 28px 0 0;
  padding: 0 18px 28px;
}
.score-panel {
  width: min(780px, 100%);
  margin: 0 auto;
  background:
    linear-gradient(135deg, rgba(72, 199, 232, 0.11), rgba(77, 216, 111, 0.055)),
    rgba(14, 20, 29, 0.92);
  border-color: rgba(92, 189, 214, 0.24);
}
.score-label {
  color: #a8bbc8;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: var(--mono);
}
.status-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 10px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(151, 187, 210, 0.2);
}
.status-line span { color: #94a1b4; font-size: 0.84rem; }
.status-line strong {
  color: #f2f8ff;
  font-size: 1.55rem;
  text-align: right;
}

.panel, .task-card, .metric-card, .summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}
.panel {
  margin: 0 auto 26px;
  padding: clamp(16px, 3vw, 24px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(166, 186, 205, 0.24);
  background: rgba(25, 31, 39, 0.9);
  color: #dbe4ea;
  text-decoration: none;
  font-weight: 800;
  transition: transform 120ms ease, background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}
.btn:hover {
  transform: translateY(-1px);
  background: rgba(39, 48, 59, 0.96);
  color: #ffffff;
  border-color: rgba(205, 222, 236, 0.38);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}
.btn-primary {
  border-color: rgba(77, 216, 111, 0.58);
  background:
    linear-gradient(135deg, rgba(77, 216, 111, 0.94), rgba(39, 154, 87, 0.94));
  color: #041007;
  box-shadow: 0 14px 30px rgba(40, 187, 86, 0.18);
}
.btn-primary:hover { background: linear-gradient(135deg, #6df488, #38c66a); border-color: rgba(111, 246, 136, 0.72); }
.btn-danger { border-color: rgba(255, 107, 107, 0.34); color: #ffd0d0; background: rgba(65, 24, 28, 0.78); }
.btn-ghost { background: transparent; }
.btn-lg {
  min-height: 48px;
  padding-inline: 22px;
  font-size: 1.05rem;
  font-weight: 800;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(166, 186, 205, 0.26);
  background: rgba(31, 38, 47, 0.84);
  color: #cbd6df;
  font-size: 0.78rem;
  font-weight: 800;
}
.badge.good { color: #a8e8b0; border-color: #336d3d; background: var(--good-soft); }
.badge.warn { color: #e9d58b; border-color: #7b6733; background: var(--warn-soft); }
.badge.bad { color: #f2aaaa; border-color: #8d4040; background: var(--bad-soft); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
}
.kpi {
  min-width: 0;
  padding: 16px 14px;
  border-left: 1px solid #334763;
  text-align: center;
}
.kpi:first-child { border-left: 0; }
.kpi strong {
  display: block;
  color: #20be68;
  font-size: 1.5rem;
  letter-spacing: 0;
  font-weight: 800;
}
.kpi span {
  display: block;
  margin-top: 6px;
  color: #9ba8ba;
  font-size: 0.78rem;
}

.record-panel, .cloud-panel { max-width: 980px; }
.record-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
}
.record-card {
  min-width: 0;
  padding: 14px 12px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #191919;
  text-align: center;
}
.record-card:first-child { border-left: 0; }
.record-card small {
  display: block;
  color: #a0a0a0;
  font-size: 0.8rem;
  font-weight: 800;
}
.record-card strong {
  display: block;
  margin-top: 9px;
  color: #d0d0d0;
  font-size: 1.35rem;
  line-height: 1.2;
}
.record-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}
.record-card em {
  display: block;
  margin-top: 10px;
  color: #79ad7c;
  font-size: 0.78rem;
  font-style: normal;
  line-height: 1.45;
}

.starter-panel {
  max-width: 980px;
  background: #111111;
}
.starter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
}
.starter-option {
  min-width: 0;
  padding: 16px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: #191919;
  color: var(--text);
  text-align: left;
}
.starter-option:first-child { border-left: 0; }
.starter-option:hover { background: #242424; }
.starter-option.primary { background: #132016; }
.starter-option small {
  display: block;
  color: #88b88b;
  font-size: 0.78rem;
  font-weight: 850;
}
.starter-option strong {
  display: block;
  margin-top: 8px;
  color: #d0d0d0;
  font-size: 1.12rem;
  line-height: 1.3;
}
.starter-option span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.guide-panel {
  max-width: 980px;
  background: #101010;
}
.momentum-panel {
  max-width: 980px;
  background: #111111;
}
.momentum-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
}
.daily-card,
.profile-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  background: #191919;
}
.daily-card.done {
  border-color: #336d3d;
  background: #111d13;
}
.daily-card small,
.profile-card small,
.result-poster small {
  display: block;
  color: #8f8f8f;
  font-size: 0.78rem;
  font-weight: 800;
}
.daily-card strong,
.profile-card strong,
.result-poster strong {
  display: block;
  margin-top: 8px;
  color: #d0d0d0;
  font-size: 1.3rem;
  line-height: 1.3;
}
.daily-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}
.daily-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.daily-meta span {
  padding: 4px 8px;
  border: 1px solid #3f3f3f;
  background: #222222;
  color: #9eb99f;
  font-size: 0.78rem;
  font-weight: 800;
}
.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 14px 0;
  border: 1px solid var(--line);
}
.profile-stats span {
  min-width: 0;
  padding: 10px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}
.profile-stats span:nth-child(odd) { border-left: 0; }
.profile-stats span:nth-child(1),
.profile-stats span:nth-child(2) { border-top: 0; }
.profile-stats b {
  display: block;
  color: var(--accent);
  font-size: 1.15rem;
}
.achievement-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
}
.achievement {
  min-width: 0;
  padding: 11px 10px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  background: #161616;
}
.achievement:nth-child(4n + 1) { border-left: 0; }
.achievement:nth-child(-n + 4) { border-top: 0; }
.achievement strong {
  display: block;
  color: #7f7f7f;
  font-size: 0.84rem;
}
.achievement span {
  display: block;
  margin-top: 5px;
  color: #686868;
  font-size: 0.75rem;
  line-height: 1.35;
}
.achievement.unlocked {
  background: #162319;
}
.achievement.unlocked strong {
  color: #9bd39f;
}
.achievement.unlocked span {
  color: #78a97b;
}
.training-panel {
  max-width: 980px;
  background: #101511;
}
.training-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
}
.training-main,
.training-stats {
  min-width: 0;
  border: 1px solid var(--line);
  background: #171717;
}
.training-main {
  padding: 18px;
}
.training-main small {
  display: block;
  color: #8f8f8f;
  font-size: 0.78rem;
  font-weight: 800;
}
.training-main strong {
  display: block;
  margin-top: 8px;
  color: #cfe6d0;
  font-size: 1.35rem;
}
.training-main p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.58;
}
.training-bars {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}
.training-bars span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
  color: #a7a7a7;
  font-size: 0.82rem;
  font-weight: 800;
}
.training-bars i {
  display: block;
  height: 9px;
  border: 1px solid #3b3b3b;
  background:
    linear-gradient(90deg, var(--accent) var(--value), transparent 0),
    #111111;
}
.training-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.training-stats div {
  min-width: 0;
  padding: 15px;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}
.training-stats div:nth-child(odd) { border-left: 0; }
.training-stats div:nth-child(1),
.training-stats div:nth-child(2) { border-top: 0; }
.training-stats b {
  display: block;
  color: var(--accent);
  font-size: 1.35rem;
}
.training-stats span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}
.training-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.training-rules span {
  padding: 6px 9px;
  border: 1px solid #355f3a;
  background: #132016;
  color: #9fc9a2;
  font-size: 0.8rem;
  font-weight: 800;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
}
.guide-card {
  min-width: 0;
  padding: 16px;
  border-left: 1px solid var(--line);
  background: #191919;
}
.guide-card:first-child { border-left: 0; }
.guide-card strong {
  display: block;
  color: #d0d0d0;
  font-size: 0.98rem;
}
.guide-card p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.62;
}
.content-guide-grid .guide-card:nth-child(odd) {
  border-left: 0;
}
.content-guide-grid .guide-card:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}
.interpret-note {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  background: #151515;
  color: var(--muted);
  line-height: 1.55;
}
.interpret-note strong {
  flex: 0 0 auto;
  color: #d0d0d0;
}
.interpret-note.good { border-color: #336d3d; background: #111d13; }
.interpret-note.good strong { color: #9ad79f; }
.interpret-note.warn { border-color: #7b6733; background: #211e13; }
.interpret-note.warn strong { color: #e0c977; }
.interpret-note.bad { border-color: #8d4040; background: #241515; }
.interpret-note.bad strong { color: #eba0a0; }

.result-poster {
  margin: 16px 0 0;
  padding: 18px;
  border: 1px solid #365d3b;
  background: #111d13;
}
.result-poster strong {
  color: #bde8c0;
}
.result-poster span {
  display: block;
  margin-top: 10px;
  color: #8fb393;
  line-height: 1.5;
}
.share-preview {
  margin-top: 14px;
  padding: 20px;
  border: 1px solid #2e7b3f;
  background:
    linear-gradient(180deg, rgba(24, 48, 28, 0.88), rgba(11, 12, 11, 0.94)),
    #101010;
  color: #d8d8d8;
}
.share-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(157, 211, 159, 0.22);
}
.share-preview-head span {
  color: #bde8c0;
  font-weight: 900;
  letter-spacing: 0;
}
.share-preview-head b {
  color: #8fb393;
  font-size: 0.82rem;
}
.share-preview-main {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 16px;
  align-items: end;
  padding: 22px 0 18px;
}
.share-preview-main strong {
  display: block;
  color: #ffffff;
  font-size: clamp(2.1rem, 8vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}
.share-preview-main em {
  display: block;
  margin-top: 10px;
  color: #9bd39f;
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
}
.share-preview-main span {
  color: #bde8c0;
  font-size: clamp(1.25rem, 4vw, 2.4rem);
  font-weight: 900;
  line-height: 1.05;
  text-align: right;
}
.share-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid rgba(157, 211, 159, 0.24);
}
.share-stat-grid div {
  min-width: 0;
  padding: 13px 12px;
  border-left: 1px solid rgba(157, 211, 159, 0.24);
  background: rgba(0, 0, 0, 0.18);
}
.share-stat-grid div:first-child { border-left: 0; }
.share-stat-grid b {
  display: block;
  color: #f3f3f3;
  font-size: 1.2rem;
  letter-spacing: 0;
}
.share-stat-grid span {
  display: block;
  margin-top: 5px;
  color: #8fb393;
  font-size: 0.76rem;
  font-weight: 800;
}
.share-preview p {
  margin: 14px 0 0;
  color: #9bd39f;
  font-weight: 800;
  line-height: 1.45;
}
.share-preview code {
  display: block;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(157, 211, 159, 0.22);
  background: rgba(0, 0, 0, 0.22);
  color: #bde8c0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.challenge-invite {
  margin: 14px 0;
  padding: 13px 14px;
  border: 1px solid #2e7b3f;
  background: #101b12;
}
.challenge-invite small {
  display: block;
  color: #8fb393;
  font-size: 0.78rem;
  font-weight: 900;
}
.challenge-invite strong {
  display: block;
  margin-top: 5px;
  color: #d7f4da;
  font-size: 1.1rem;
}
.challenge-invite span {
  display: block;
  margin-top: 5px;
  color: #9eb99f;
  line-height: 1.45;
}
.new-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
  color: var(--muted);
}
.new-badges strong {
  color: #d0d0d0;
}
.new-badges span {
  padding: 5px 9px;
  border: 1px solid #336d3d;
  background: #162319;
  color: #9bd39f;
  font-size: 0.82rem;
  font-weight: 800;
}

.result-readout {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
}
.result-readout-card {
  min-width: 0;
  padding: 14px 12px;
  border-left: 1px solid var(--line);
  background: #191919;
}
.result-readout-card:first-child { border-left: 0; }
.result-readout-card small {
  display: block;
  color: #8f8f8f;
  font-size: 0.76rem;
  font-weight: 850;
}
.result-readout-card strong {
  display: block;
  margin-top: 8px;
  color: #d0d0d0;
  font-size: 1.08rem;
  line-height: 1.3;
}
.result-readout-card span {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.result-readout-card.good { background: #111d13; }
.result-readout-card.good strong { color: #a8e8b0; }
.result-readout-card.warn { background: #211e13; }
.result-readout-card.warn strong { color: #e9d58b; }
.result-readout-card.bad { background: #241515; }
.result-readout-card.bad strong { color: #f0b3b3; }

.cloud-panel { background: transparent; border-color: transparent; padding-inline: 0; }
.cloud-record-grid { margin-top: 14px; }
.cloud-pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 8px;
  min-height: 30px;
  padding: 5px 10px;
  border-radius: 3px;
  border: 1px solid #565656;
  background: #2b2b2b;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}
.cloud-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--faint);
}
.cloud-pill.ready { color: #b2e0b8; border-color: #31683a; background: #162819; }
.cloud-pill.ready span { background: var(--good); }
.cloud-pill.error { color: #f0b3b3; border-color: #8a4545; background: #2d1717; }
.cloud-pill.error span { background: var(--bad); }
.cloud-pill.checking span { background: var(--warn); }

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  margin-top: 16px;
  background: #151515;
}
.leaderboard-tab {
  min-height: 72px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  padding: 13px 14px;
  background: transparent;
  color: #b7b7b7;
  text-align: left;
  cursor: pointer;
}
.leaderboard-tab:first-child { border-left: 0; }
.leaderboard-tab strong {
  display: block;
  color: #cfcfcf;
  font-size: 0.95rem;
  line-height: 1.25;
}
.leaderboard-tab span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.3;
}
.leaderboard-tab:hover,
.leaderboard-tab:focus-visible {
  background: #202020;
  outline: 0;
}
.leaderboard-tab.active {
  background: #102117;
  box-shadow: inset 0 -3px 0 var(--good);
}
.leaderboard-tab.active strong { color: #c8efcf; }

.leaderboard-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 26px;
}
.leaderboard-method {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}
.leaderboard-head h3 { margin: 0; color: #c2c2c2; letter-spacing: 0; }
.leaderboard-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
  border: 1px solid var(--line);
}
.leaderboard-row {
  display: grid;
  grid-template-columns: 70px minmax(120px, 1fr) minmax(90px, auto) minmax(140px, auto);
  align-items: center;
  gap: 0;
  min-height: 42px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: #171717;
}
.leaderboard-row:first-child { border-top: 0; }
.leaderboard-row:nth-child(even) { background: #242424; }
.leaderboard-row.mine { background: #19241b; }
.leaderboard-row > * {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 12px;
  border-left: 1px solid var(--line);
}
.leaderboard-row > *:first-child { border-left: 0; }
.leaderboard-row b {
  justify-content: center;
  color: #bdbdbd;
  font-weight: 700;
}
.leaderboard-row strong { justify-content: flex-end; color: #d0d0d0; }
.leaderboard-row em {
  color: var(--muted);
  font-style: normal;
  justify-content: flex-end;
  font-size: 0.88rem;
}

.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 34px 0 14px;
}
.section-title h2, .section-title h3 {
  margin: 0;
  color: #bfbfbf;
  letter-spacing: 0;
  font-size: clamp(1.25rem, 2.3vw, 1.65rem);
  font-weight: 800;
}
.section-title p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.58;
  font-size: 0.96rem;
}

.task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.task-card {
  display: grid;
  align-content: end;
  gap: 10px;
  min-height: 260px;
  padding: 18px;
  background: #222222;
  border-color: #333333;
}
.task-card:hover { background: #2a2a2a; border-color: #4d4d4d; }
.task-card.recommended {
  border-color: #356f3f;
  background: #1b241d;
}
.task-card.recommended:hover {
  background: #203024;
}
.task-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  order: 3;
}
.task-card-head span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
}
.task-card-head small {
  min-width: 0;
  color: #6f936f;
  font-size: 0.78rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-card h3 {
  margin: 0;
  color: #7eac80;
  letter-spacing: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}
.task-card p {
  margin: 0;
  color: #8d8d8d;
  line-height: 1.55;
  font-size: 0.9rem;
}
.task-card .card-actions {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.task-card .details { margin-top: 0; font-size: 0.78rem; }

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.field { display: grid; gap: 7px; }
.field label { color: #b0b0b0; font-size: 0.9rem; font-weight: 800; }
select, input[type="number"] {
  width: 100%;
  min-height: 42px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: #d0d0d0;
  background: #111111;
  padding: 0 12px;
}
.details {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.64;
  font-size: 0.92rem;
}
.details summary {
  cursor: pointer;
  color: #bfbfbf;
  font-weight: 800;
}
.details ul { margin: 12px 0 0 20px; padding: 0; }
.details a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.result-details {
  margin-top: 18px;
}
.result-details .table-wrap {
  margin-top: 12px;
}

.chart-wrap {
  height: 260px;
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #111111;
}
canvas { width: 100%; height: 100%; display: block; }

.stats-table-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 22px;
  align-items: start;
  margin-top: 14px;
  min-width: 0;
}
.stats-table-grid > div {
  min-width: 0;
}
.table-title {
  margin: 0 0 10px;
  color: #bcbcbc;
  font-size: 1.02rem;
  font-weight: 800;
}
.compact-table { margin-top: 0; }
.compact-table table { min-width: 0; }
.compact-table th,
.compact-table td {
  padding: 9px 10px;
  font-size: 0.86rem;
  white-space: nowrap;
}
.compact-table td:first-child,
.compact-table th:first-child {
  white-space: normal;
}

.task-shell { display: grid; gap: 16px; }
.task-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.task-head h1 { margin: 6px 0 0; color: #d0d0d0; letter-spacing: 0; }
.task-head p { margin: 4px 0 0; color: var(--muted); }
.timerbar {
  position: relative;
  overflow: hidden;
  height: 10px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: #111111;
}
.timerbar > span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--accent);
}
.task-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
}
.metric-card {
  padding: 12px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  background: #171717;
}
.metric-card:first-child { border-left: 0; }
.metric-card strong { display: block; color: #d0d0d0; font-size: 1.12rem; }
.metric-card span { display: block; margin-top: 4px; color: var(--muted); font-size: 0.78rem; }

.arena {
  min-height: min(62vh, 560px);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 0;
  background: #151515;
  padding: clamp(16px, 3vw, 30px);
  position: relative;
  overflow: hidden;
  box-shadow: none;
}
.arena.compact { min-height: 420px; }
.task-symbol {
  gap: 10px;
}
.task-symbol .arena {
  min-height: min(42vh, 360px);
  padding: clamp(12px, 2vw, 20px);
}
.task-symbol .keymap {
  margin-bottom: 12px;
}
.task-symbol .stimulus {
  min-height: min(28vw, 180px);
}
.task-symbol #taskControls {
  position: sticky;
  bottom: 0;
  z-index: 12;
  padding: 8px 0 10px;
  background: linear-gradient(to bottom, rgba(8, 8, 8, 0), #080808 16px);
}
.task-symbol .response-pad {
  margin-top: 0;
}
.task-symbol .response-pad.nine {
  grid-template-columns: repeat(4, minmax(54px, 1fr));
}
.countdown {
  color: #d0d0d0;
  font-size: clamp(4rem, 15vw, 9rem);
  font-weight: 900;
  letter-spacing: 0;
}
.countdown-wrap {
  display: grid;
  place-items: center;
  gap: 10px;
  text-align: center;
}
.countdown-wrap span {
  color: #8fb393;
  font-size: 0.86rem;
  font-weight: 800;
}
.countdown-wrap p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.search-cue {
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
}
.search-cue span {
  color: #8fb393;
  font-size: 0.88rem;
  font-weight: 800;
}
.search-cue strong {
  display: grid;
  place-items: center;
  width: clamp(130px, 22vw, 190px);
  height: clamp(130px, 22vw, 190px);
  border: 1px solid #407447;
  background: #17251a;
  color: #d9f2dc;
  font-size: clamp(5rem, 16vw, 9rem);
  line-height: 1;
}
.search-cue p {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}
.choice-tutorial,
.search-tutorial {
  display: grid;
  grid-template-columns: minmax(170px, 0.45fr) minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: min(760px, 100%);
  margin: 18px auto 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #171717;
}
.choice-example-grid,
.search-example-board {
  display: grid;
  gap: 6px;
}
.choice-example-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.choice-example-grid span,
.search-example-board span {
  display: grid;
  place-items: center;
  min-height: 48px;
  border: 1px solid var(--line);
  background: #222222;
  color: #d0d0d0;
  font-size: 1.35rem;
  font-weight: 900;
}
.search-example-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.search-example-board span.target {
  border-color: #407447;
  background: #17251a;
  color: #bde8c0;
}
.preflight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  width: min(720px, 100%);
  margin: 18px auto 0;
  border: 1px solid var(--line);
  background: #171717;
}
.preflight-grid span {
  min-width: 0;
  padding: 12px 10px;
  border-left: 1px solid var(--line);
  color: #bcbcbc;
  text-align: center;
  font-size: 0.9rem;
  line-height: 1.35;
  word-break: keep-all;
}
.preflight-grid span:first-child { border-left: 0; }
.preflight-grid b {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border: 1px solid #3f7044;
  color: #9bd39f;
  background: #162319;
  font-size: 0.78rem;
}
.symbol-tutorial {
  display: grid;
  gap: 12px;
  width: min(760px, 100%);
  margin: 18px auto 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #171717;
}
.symbol-example-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.symbol-example-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 62px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #222222;
}
.symbol-example-item span {
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 850;
}
.symbol-glyph {
  display: inline-grid;
  place-items: center;
  color: #d0d0d0;
  line-height: 1;
  font-weight: 900;
}
.symbol-example-item .symbol-glyph,
.key-item .symbol-glyph {
  width: 48px;
  height: 48px;
  font-size: 2.08rem;
}
.symbol-example-item .symbol-square,
.key-item .symbol-square {
  font-size: 2.65rem;
}
.symbol-stimulus .symbol-glyph {
  width: auto;
  height: auto;
  font-size: 1em;
}
.symbol-stimulus .symbol-square {
  transform: scale(1.16);
  transform-origin: center;
}
.peripheral-tutorial {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: min(760px, 100%);
  margin: 18px auto 0;
  padding: 14px;
  border: 1px solid var(--line);
  background: #171717;
}
.peripheral-example {
  position: relative;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  border: 1px dashed var(--line);
  background: #111111;
}
.center-letter.mini {
  width: 42px;
  height: 42px;
  font-size: 1.6rem;
}
.periph-dot.mini {
  width: 28px;
  height: 28px;
  font-size: 0.86rem;
}
.tutorial-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
}
.tutorial-steps span {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #bcbcbc;
  line-height: 1.35;
  word-break: keep-all;
}
.tutorial-steps b {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border: 1px solid #3f7044;
  color: #9bd39f;
  background: #162319;
  font-size: 0.78rem;
}
.peripheral-tutorial p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.9rem;
}
.fixation {
  font-size: clamp(4rem, 13vw, 8rem);
  font-weight: 900;
  color: var(--muted);
}
.stimulus {
  display: grid;
  place-items: center;
  min-width: min(72vw, 390px);
  min-height: min(42vw, 260px);
  border-radius: 0;
  border: 1px solid var(--line);
  background: #1f1f1f;
  color: #d0d0d0;
  font-size: clamp(5rem, 20vw, 12rem);
  font-weight: 900;
  line-height: 1;
}
.symbol-stimulus { font-size: clamp(5.5rem, 18vw, 11rem); }

.response-pad {
  display: grid;
  grid-template-columns: repeat(4, minmax(66px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.response-pad.nine { grid-template-columns: repeat(3, minmax(72px, 1fr)); }
.response-pad.eight { grid-template-columns: repeat(4, minmax(58px, 1fr)); }
.response-pad.two { grid-template-columns: repeat(2, minmax(110px, 1fr)); }
.pad-btn {
  min-height: 62px;
  border-radius: 3px;
  border: 1px solid var(--line);
  color: #d0d0d0;
  background: #222222;
  font-size: 1.28rem;
  font-weight: 850;
}
.pad-btn:hover { background: #2f2f2f; }
.pad-btn.selected { outline: 2px solid rgba(66, 169, 79, 0.5); background: #1c321f; }

.keymap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 8px;
  width: min(780px, 100%);
  margin: 0 auto 18px;
}
.key-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  padding: 10px 12px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: #222222;
}
.key-item span { color: var(--muted); font-weight: 850; }

.search-board {
  width: min(86vw, 560px);
  height: min(86vw, 560px);
  display: grid;
  gap: 5px;
  border-radius: 0;
}
.search-cell {
  display: grid;
  place-items: center;
  border-radius: 0;
  border: 1px solid var(--line);
  background: #222222;
  color: #d0d0d0;
  font-size: clamp(1.2rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1;
}
.search-cell:hover { background: #2e2e2e; }
.search-cell.target { border-color: rgba(66, 169, 79, 0.7); }

.peripheral-stage {
  width: min(86vw, 560px);
  height: min(86vw, 560px);
  border-radius: 50%;
  position: relative;
  border: 1px dashed var(--line);
  background: #111111;
}
.peripheral-stimulus-wrap {
  display: grid;
  place-items: center;
  gap: 12px;
}
.task-hint {
  padding: 7px 10px;
  border: 1px solid #345f39;
  background: #142017;
  color: #a6d7aa;
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
}
.center-letter {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 92px; height: 92px;
  border-radius: 0;
  border: 1px solid var(--line);
  background: #222222;
  color: #d0d0d0;
  font-size: 3.4rem;
  font-weight: 900;
}
.periph-dot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: clamp(34px, 8vw, 56px);
  height: clamp(34px, 8vw, 56px);
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #222222;
  color: #d0d0d0;
  font-size: 1.2rem;
  font-weight: 900;
}
.periph-dot.target-dot { border-color: #4caf62; background: #1d321f; color: #7bdd85; }
.peripheral-mask {
  display: grid;
  gap: 18px;
  place-items: center;
  width: 100%;
}
.radial-pad {
  position: relative;
  width: min(78vw, 400px);
  height: min(78vw, 400px);
  border-radius: 50%;
  border: 1px dashed var(--line);
}
.radial-btn {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #d0d0d0;
  background: #222222;
  font-weight: 850;
}
.radial-btn.selected { outline: 2px solid rgba(66, 169, 79, 0.5); background: #1c321f; }

html[data-device="tablet"] .arena {
  min-height: min(56vh, 500px);
}

html[data-device="tablet"] .task-symbol .arena {
  min-height: min(40vh, 340px);
}

html[data-device="tablet"] .search-board,
html[data-device="tablet"] .peripheral-stage {
  width: min(76vw, 500px);
  height: min(76vw, 500px);
}

html[data-device="mobile"] .task-shell {
  gap: 12px;
}

html[data-device="mobile"] .task-head {
  flex-direction: column;
  gap: 10px;
}

html[data-device="mobile"] .task-head .btn {
  width: 100%;
}

html[data-device="mobile"] .task-meta {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-device="mobile"] .metric-card {
  min-width: 0;
  padding: 10px 8px;
}

html[data-device="mobile"] .metric-card:nth-child(odd) {
  border-left: 0;
}

html[data-device="mobile"] .metric-card:nth-child(n + 3) {
  border-top: 1px solid var(--line);
}

html[data-device="mobile"] .arena {
  min-height: min(58vh, 430px);
  min-height: min(calc(var(--app-vh) * 0.58), 430px);
  padding: clamp(12px, 4vw, 18px);
}

html[data-device="mobile"] .arena.compact,
html[data-device="mobile"] .task-symbol .arena {
  min-height: min(44vh, 340px);
  min-height: min(calc(var(--app-vh) * 0.44), 340px);
}

html[data-device="mobile"] .stimulus {
  min-width: min(84vw, 340px);
  min-height: min(38vw, 190px);
  font-size: clamp(4rem, 20vw, 8rem);
}

html[data-device="mobile"] .symbol-stimulus {
  font-size: clamp(4.2rem, 18vw, 7rem);
}

html[data-device="mobile"] .search-board,
html[data-device="mobile"] .peripheral-stage {
  width: clamp(260px, 82vw, 430px);
  height: clamp(260px, 82vw, 430px);
}

html[data-device="mobile"] .radial-pad {
  width: clamp(250px, 74vw, 360px);
  height: clamp(250px, 74vw, 360px);
}

html[data-device="mobile"] .response-pad {
  gap: 8px;
  margin-top: 8px;
  padding-bottom: var(--safe-bottom);
}

html[data-input="touch"] .pad-btn {
  min-height: 58px;
  touch-action: manipulation;
}

html[data-input="touch"] .search-cell,
html[data-input="touch"] .radial-btn {
  touch-action: manipulation;
}

html[data-device="mobile"] .task-symbol #taskControls {
  bottom: var(--safe-bottom);
}

@media (max-height: 560px) and (orientation: landscape) {
  html[data-device="mobile"] .topbar,
  html[data-device="tablet"] .topbar {
    position: relative;
    top: 0;
    margin-top: 6px;
  }

  html[data-device="mobile"] #main,
  html[data-device="tablet"] #main {
    min-height: auto;
    padding-top: 12px;
  }

  html[data-device="mobile"] .brand small,
  html[data-device="tablet"] .brand small {
    display: none;
  }

  html[data-device="mobile"] .site-nav,
  html[data-device="tablet"] .site-nav {
    padding-top: 6px;
  }

  html[data-device="mobile"] .top-actions .btn,
  html[data-device="tablet"] .top-actions .btn {
    min-height: 38px;
    padding: 8px 10px;
  }

  html[data-device="mobile"] .arena,
  html[data-device="tablet"] .arena {
    min-height: 260px;
  }

  html[data-device="mobile"] .search-board,
  html[data-device="mobile"] .peripheral-stage,
  html[data-device="tablet"] .search-board,
  html[data-device="tablet"] .peripheral-stage {
    width: min(58vh, 360px);
    height: min(58vh, 360px);
  }

  html[data-device="mobile"] .radial-pad,
  html[data-device="tablet"] .radial-pad {
    width: min(56vh, 330px);
    height: min(56vh, 330px);
  }
}

.feedback {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 8px 12px;
  border-radius: 3px;
  background: #111111;
  border: 1px solid var(--line);
  color: #ffffff;
  font-weight: 800;
}
.feedback.good { background: #0f6c2b; border-color: #1fa83e; }
.feedback.bad { background: #7a2525; border-color: #a14444; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  margin-top: 14px;
  border: 1px solid var(--line);
}
.summary-card {
  padding: 14px;
  border: 0;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  text-align: center;
  background: #171717;
}
.summary-card:nth-child(1),
.summary-card:nth-child(2),
.summary-card:nth-child(3),
.summary-card:nth-child(4) { border-top: 0; }
.summary-card:first-child { border-left: 0; }
.summary-card strong { display: block; color: #d0d0d0; font-size: 1.2rem; letter-spacing: 0; }
.summary-card span { display: block; color: var(--muted); margin-top: 6px; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 0;
  margin-top: 18px;
  background: #111111;
}
table { width: 100%; border-collapse: collapse; min-width: 780px; }
th, td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: left;
}
th:first-child, td:first-child { border-left: 0; }
th {
  color: #bdbdbd;
  background: #333333;
  font-size: 0.84rem;
  font-weight: 800;
}
td { color: var(--text); background: #151515; }
tr:nth-child(even) td { background: #222222; }
tr:last-child td { border-bottom: 0; }

.empty-state {
  border: 1px dashed var(--line);
  border-radius: 0;
  padding: 28px;
  color: var(--muted);
  text-align: center;
  background: #151515;
}
.empty-state.compact { padding: 18px; margin-top: 10px; }

.ad-slot {
  display: grid;
  place-items: center;
  width: min(980px, 100%);
  min-height: 112px;
  margin: 22px auto;
  border: 1px dashed #454545;
  background: #101010;
  color: #777777;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Modern tech surface pass */
::selection {
  background: rgba(77, 216, 111, 0.28);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid rgba(72, 199, 232, 0.82);
  outline-offset: 3px;
}

.record-grid,
.starter-grid,
.guide-grid,
.result-readout,
.summary-grid,
.task-meta,
.profile-stats,
.training-stats,
.achievement-strip,
.leaderboard-list {
  gap: 10px;
  border: 0;
  background: transparent;
}

.record-card,
.starter-option,
.guide-card,
.result-readout-card,
.summary-card,
.metric-card,
.daily-card,
.profile-card,
.training-main,
.training-stats,
.training-stats div,
.profile-stats span,
.achievement,
.leaderboard-tab,
.leaderboard-row,
.key-item,
.symbol-example-item,
.choice-example-grid span,
.search-example-board span,
.preflight-grid span {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    rgba(15, 20, 26, 0.86);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.035);
}

.record-card,
.starter-option,
.guide-card,
.result-readout-card,
.summary-card,
.metric-card,
.leaderboard-row > *,
.training-stats div,
.profile-stats span,
.achievement {
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.record-card:first-child,
.starter-option:first-child,
.guide-card:first-child,
.result-readout-card:first-child,
.summary-card:first-child,
.metric-card:first-child {
  border-left: 1px solid var(--line);
}

.record-card small,
.profile-card small,
.daily-card small,
.training-main small,
.result-readout-card small,
.result-poster small {
  color: #91a7b8;
  font-family: var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.record-card strong,
.summary-card strong,
.metric-card strong,
.training-stats b,
.profile-stats b,
.kpi strong {
  color: #62ed83;
}

.record-card em,
.starter-option small,
.task-card-head span,
.share-preview-main em {
  color: #76e891;
}

.starter-panel,
.guide-panel,
.momentum-panel,
.training-panel,
.record-panel,
.cloud-panel,
.status-panel {
  background: rgba(12, 16, 21, 0.76);
}

.starter-grid,
.content-guide-grid,
.guide-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.starter-option,
.guide-card {
  border-left: 1px solid var(--line);
}

.starter-option.primary,
.daily-card.done,
.result-readout-card.good,
.achievement.unlocked {
  background:
    linear-gradient(180deg, rgba(77, 216, 111, 0.105), transparent),
    rgba(13, 29, 19, 0.82);
  border-color: rgba(77, 216, 111, 0.32);
}

.starter-option:hover,
.task-card:hover,
.leaderboard-tab:hover,
.leaderboard-tab:focus-visible,
.pad-btn:hover,
.search-cell:hover {
  background:
    linear-gradient(180deg, rgba(72, 199, 232, 0.08), transparent),
    rgba(27, 35, 44, 0.94);
  border-color: rgba(148, 215, 232, 0.34);
}

.training-bars i,
.timerbar {
  height: 8px;
  border-radius: 999px;
  border-color: rgba(166, 186, 205, 0.22);
  background: rgba(8, 11, 15, 0.92);
  overflow: hidden;
}

.training-bars i {
  background:
    linear-gradient(90deg, var(--accent) var(--value), transparent 0),
    rgba(8, 11, 15, 0.92);
}

.timerbar > span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.training-rules span,
.daily-meta span,
.new-badges span,
.task-hint {
  border-radius: 999px;
  border-color: rgba(77, 216, 111, 0.28);
  background: rgba(77, 216, 111, 0.095);
  color: #b7f6c1;
}

.result-poster,
.challenge-invite {
  border-color: rgba(77, 216, 111, 0.36);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(77, 216, 111, 0.14), rgba(72, 199, 232, 0.06)),
    rgba(12, 18, 16, 0.9);
}

.share-preview {
  border-radius: var(--radius);
  border-color: rgba(77, 216, 111, 0.36);
  background:
    linear-gradient(135deg, rgba(77, 216, 111, 0.16), rgba(72, 199, 232, 0.08)),
    #0a0f12;
  box-shadow: var(--shadow);
}

.share-stat-grid {
  gap: 8px;
  border: 0;
}

.share-stat-grid div {
  border: 1px solid rgba(157, 211, 159, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.24);
}

.cloud-panel {
  max-width: 1040px;
  padding-inline: clamp(16px, 3vw, 24px);
  border-color: var(--line);
}

.cloud-pill {
  border-radius: 999px;
  background: rgba(26, 33, 41, 0.88);
}

.leaderboard-tabs {
  gap: 8px;
  border: 0;
  background: transparent;
}

.leaderboard-tab {
  min-height: 74px;
  border-left: 1px solid var(--line);
}

.leaderboard-tab.active {
  background:
    linear-gradient(180deg, rgba(77, 216, 111, 0.16), transparent),
    rgba(13, 29, 19, 0.86);
  border-color: rgba(77, 216, 111, 0.42);
  box-shadow: inset 0 3px 0 var(--good);
}

.leaderboard-row {
  grid-template-columns: 62px minmax(120px, 1fr) minmax(88px, auto) minmax(132px, auto);
  min-height: 52px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}

.leaderboard-row:nth-child(even) {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), transparent),
    rgba(19, 25, 32, 0.86);
}

.leaderboard-row.mine {
  border-color: rgba(77, 216, 111, 0.36);
  background:
    linear-gradient(180deg, rgba(77, 216, 111, 0.12), transparent),
    rgba(12, 28, 18, 0.86);
}

.leaderboard-row > * {
  min-height: 52px;
  border-left-color: rgba(153, 173, 191, 0.16);
}

.section-title h2,
.section-title h3,
.leaderboard-head h3,
.table-title {
  color: #eef3f7;
}

.task-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.task-card {
  align-content: start;
  min-height: 196px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.035), transparent),
    rgba(17, 22, 28, 0.86);
}

.task-card.recommended {
  border-color: rgba(77, 216, 111, 0.36);
  background:
    linear-gradient(180deg, rgba(77, 216, 111, 0.11), transparent),
    rgba(13, 29, 19, 0.84);
}

.task-card-head {
  order: 0;
}

.task-card h3 {
  color: #dceee0;
  font-size: 1.08rem;
}

.task-card p {
  color: #a7b2bd;
}

select,
input[type="number"] {
  border-radius: var(--radius-sm);
  border-color: rgba(166, 186, 205, 0.24);
  background: rgba(9, 13, 18, 0.88);
}

.details summary {
  color: #dce6ed;
}

.task-head {
  border-bottom-color: var(--line);
}

.task-head h1 {
  color: #f2f7fb;
}

.arena,
.stimulus,
.search-cue strong,
.choice-tutorial,
.search-tutorial,
.symbol-tutorial,
.peripheral-tutorial,
.preflight-grid,
.keymap,
.peripheral-stage,
.radial-pad,
.table-wrap,
.empty-state,
.chart-wrap {
  border-radius: var(--radius);
}

.arena {
  border-color: rgba(166, 186, 205, 0.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent),
    rgba(12, 16, 21, 0.9);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025);
}

.stimulus,
.center-letter,
.pad-btn,
.radial-btn,
.search-cell,
.key-item {
  border-radius: var(--radius-sm);
}

.stimulus {
  background:
    linear-gradient(180deg, rgba(72, 199, 232, 0.075), transparent),
    rgba(17, 22, 28, 0.92);
}

.countdown {
  color: #f4f8fb;
}

.search-cue strong,
.preflight-grid b,
.tutorial-steps b {
  border-color: rgba(77, 216, 111, 0.42);
  background: rgba(77, 216, 111, 0.12);
  color: #c8ffd0;
}

.pad-btn,
.radial-btn,
.search-cell {
  border-color: rgba(166, 186, 205, 0.24);
  background: rgba(24, 31, 39, 0.9);
  color: #eaf1f6;
}

.pad-btn.selected,
.radial-btn.selected {
  outline: 2px solid rgba(77, 216, 111, 0.42);
  background: rgba(77, 216, 111, 0.14);
}

.search-cell.target,
.periph-dot.target-dot {
  border-color: rgba(77, 216, 111, 0.64);
  background: rgba(77, 216, 111, 0.16);
  color: #baffc5;
}

.table-wrap {
  border-color: var(--line);
  background: rgba(12, 16, 21, 0.82);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  border-left-color: rgba(153, 173, 191, 0.14);
  border-bottom-color: rgba(153, 173, 191, 0.16);
}

th {
  color: #c6d4df;
  background: rgba(27, 34, 43, 0.96);
  font-family: var(--mono);
  letter-spacing: 0.02em;
}

td {
  background: rgba(14, 19, 25, 0.82);
}

tr:nth-child(even) td {
  background: rgba(20, 26, 33, 0.82);
}

.empty-state,
.ad-slot {
  border-radius: var(--radius);
  background: rgba(12, 16, 21, 0.72);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 100;
  transform: translateX(-50%) translateY(20px);
  opacity: 0;
  pointer-events: none;
  max-width: min(92vw, 520px);
  padding: 12px 16px;
  border-radius: 3px;
  background: #222222;
  border: 1px solid var(--line);
  box-shadow: none;
  color: #ffffff;
  transition: opacity 160ms ease, transform 160ms ease;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

body.update-modal-open { overflow: hidden; }
.update-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: max(18px, var(--safe-top)) max(18px, var(--safe-right)) max(18px, var(--safe-bottom)) max(18px, var(--safe-left));
  background: rgba(2, 5, 8, 0.76);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.update-modal {
  position: relative;
  width: min(100%, 440px);
  padding: 28px;
  border: 1px solid rgba(128, 221, 244, 0.38);
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(18, 29, 36, 0.98), rgba(9, 14, 19, 0.99));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(77, 216, 111, 0.08);
}
.update-modal-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 22px;
  border: 1px solid rgba(77, 216, 111, 0.42);
  border-radius: 50%;
  background: rgba(77, 216, 111, 0.12);
  color: #76ee91;
  font-size: 1.8rem;
  font-weight: 800;
}
.update-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(20, 28, 36, 0.7);
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
}
.update-modal-close:hover { color: #f4fbff; border-color: var(--line-strong); }
.update-modal-eyebrow {
  margin: 0 0 8px;
  color: #76ee91;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.update-modal h2 {
  margin: 0;
  color: #f2f8fb;
  font-size: clamp(1.55rem, 4vw, 2rem);
  line-height: 1.2;
}
.update-modal-description {
  margin: 14px 0 0;
  color: #b8c6d1;
  line-height: 1.65;
}
.update-modal-version {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 14px;
  margin-top: 20px;
  padding: 14px 15px;
  border: 1px solid rgba(153, 173, 191, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(5, 9, 13, 0.54);
}
.update-modal-version span,
.update-modal-version small { color: var(--muted); }
.update-modal-version strong { color: #baf4c8; font-family: var(--mono); font-size: 0.92rem; }
.update-modal-version small { grid-column: 1 / -1; font-size: 0.75rem; }
.update-modal-notes {
  margin: 14px 0 0;
  color: #91d9a1;
  font-size: 0.88rem;
  line-height: 1.5;
}
.update-modal-actions {
  display: grid;
  gap: 8px;
  margin-top: 24px;
}
.update-modal-actions .btn { width: 100%; }
.update-modal-actions .btn-ghost { border-color: transparent; color: var(--muted); }
@media (max-width: 480px) {
  .update-modal { padding: 24px 20px 20px; }
  .update-modal h2 { font-size: 1.45rem; }
}

@media (max-width: 980px) {
  #main { width: min(100% - 18px, 1160px); }
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .site-nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
    gap: 16px;
    padding: 10px 0 2px;
    border-top: 1px solid #1d1d1d;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .site-nav::-webkit-scrollbar { display: none; }
  .hero { margin-top: 28px; }
  .mode-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mode-chip:nth-child(odd) { border-left: 0; }
  .mode-chip:nth-child(n + 3) { border-top: 1px solid #3a3a3a; }
  .task-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .record-card:nth-child(odd) { border-left: 0; }
  .record-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .task-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .settings-grid { grid-template-columns: 1fr; }
  .stats-table-grid { grid-template-columns: 1fr; }
  .momentum-grid { grid-template-columns: 1fr; }
  .training-grid { grid-template-columns: 1fr; }
  .achievement-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .achievement:nth-child(odd) { border-left: 0; }
  .achievement:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .share-preview-main { grid-template-columns: 1fr; }
  .share-preview-main span { text-align: left; }
  .share-stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-stat-grid div:nth-child(odd) { border-left: 0; }
  .share-stat-grid div:nth-child(n + 3) { border-top: 1px solid rgba(157, 211, 159, 0.24); }
  .guide-grid { grid-template-columns: 1fr; }
  .guide-card { border-left: 0; border-top: 1px solid var(--line); }
  .guide-card:first-child { border-top: 0; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi:nth-child(odd) { border-left: 0; }
  .kpi:nth-child(n + 3) { border-top: 1px solid #334763; }
  .result-readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-readout-card:nth-child(odd) { border-left: 0; }
  .result-readout-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  #main { width: min(100% - 12px, 1160px); padding-top: 22px; }
  #main::before { top: 92px; font-size: 3.6rem; }
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 10px;
  }
  .site-nav {
    grid-column: auto;
    padding-top: 9px;
  }
  .top-actions { justify-content: stretch; }
  .top-actions .btn { flex: 1; }
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
  .site-footer nav {
    justify-content: flex-start;
  }
  .contact-box {
    grid-template-columns: 1fr;
  }
  .contact-box strong,
  .contact-box span {
    border-left: 0;
  }
  .contact-box span {
    border-top: 0;
  }
  .hero { margin-top: 22px; }
  .test-title { font-size: 1.12rem; padding-inline: 14px; }
  .attempt-strip { gap: 14px; overflow-x: auto; justify-content: flex-start; }
  .mode-strip { grid-template-columns: 1fr; }
  .mode-chip { border-left: 0; border-top: 1px solid #3a3a3a; }
  .mode-chip:first-child { border-top: 0; }
  .hero h1 { text-align: left; font-size: 1.75rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .starter-grid { grid-template-columns: 1fr; }
  .starter-option {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .starter-option:first-child { border-top: 0; }
  .task-grid { grid-template-columns: 1fr; }
  .record-grid { grid-template-columns: 1fr; }
  .record-card { border-left: 0; border-top: 1px solid var(--line); }
  .record-card:first-child { border-top: 0; }
  .achievement-strip { grid-template-columns: 1fr; }
  .achievement { border-left: 0; border-top: 1px solid var(--line); }
  .achievement:first-child { border-top: 0; }
  .profile-stats { grid-template-columns: 1fr; }
  .profile-stats span { border-left: 0; border-top: 1px solid var(--line); }
  .profile-stats span:first-child { border-top: 0; }
  .training-stats { grid-template-columns: 1fr; }
  .training-stats div { border-left: 0; border-top: 1px solid var(--line); }
  .training-stats div:first-child { border-top: 0; }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .summary-card:nth-child(odd) { border-left: 0; }
  .summary-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .task-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card:nth-child(odd) { border-left: 0; }
  .metric-card:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .task-head { flex-direction: column; }
  .task-head .btn { width: 100%; }
  .task-symbol .arena {
    min-height: 300px;
  }
  .task-symbol .keymap {
    grid-template-columns: repeat(4, minmax(54px, 1fr));
  }
  .task-symbol .symbol-stimulus {
    font-size: clamp(4.2rem, 18vw, 7rem);
  }
  .symbol-example-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .symbol-example-item .symbol-glyph,
  .key-item .symbol-glyph {
    width: 42px;
    height: 42px;
    font-size: 1.85rem;
  }
  .symbol-example-item .symbol-square,
  .key-item .symbol-square {
    font-size: 2.35rem;
  }
  .peripheral-tutorial {
    grid-template-columns: 1fr;
    justify-items: center;
  }
  .choice-tutorial,
  .search-tutorial {
    grid-template-columns: 1fr;
  }
  .peripheral-tutorial p {
    text-align: center;
  }
  .peripheral-stage {
    width: min(82vw, 430px);
    height: min(82vw, 430px);
  }
  .preflight-grid { grid-template-columns: 1fr; }
  .preflight-grid span { border-left: 0; border-top: 1px solid var(--line); }
  .preflight-grid span:first-child { border-top: 0; }
  .interpret-note { align-items: flex-start; flex-direction: column; gap: 6px; }
  .result-readout { grid-template-columns: 1fr; }
  .result-readout-card {
    border-left: 0;
    border-top: 1px solid var(--line);
  }
  .result-readout-card:first-child { border-top: 0; }
  .response-pad { grid-template-columns: repeat(2, minmax(66px, 1fr)); }
  .response-pad.eight { grid-template-columns: repeat(2, minmax(58px, 1fr)); }
  .leaderboard-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leaderboard-tab:nth-child(odd) { border-left: 0; }
  .leaderboard-tab:nth-child(n + 3) { border-top: 1px solid var(--line); }
  .leaderboard-row { grid-template-columns: 48px 1fr 74px; }
  .leaderboard-row em { grid-column: 2 / -1; justify-content: flex-start; border-top: 1px solid var(--line); }
}

@media (max-width: 640px) {
  .mode-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1px;
  }
  .mode-chip {
    min-height: 66px;
    border: 0;
    padding: 10px 8px;
  }
  .mode-chip b { font-size: 0.98rem; }
  .mode-chip small { margin-top: 3px; font-size: 0.72rem; }
  .mode-chip:nth-child(n + 3) {
    border-top: 0;
  }
  .hero h1 {
    margin-top: 22px;
    font-size: 1.58rem;
    line-height: 1.24;
  }
  .hero p {
    margin-top: 14px;
    padding-inline: 18px;
    font-size: 0.96rem;
    line-height: 1.62;
  }
  .hero-actions {
    margin-top: 20px;
    padding-bottom: 22px;
  }
  .hero-actions .btn {
    min-height: 44px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Launch information hierarchy */
* {
  letter-spacing: 0 !important;
}

#main {
  padding-top: 16px;
}

.hero {
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  max-width: 1100px;
  margin-top: 18px;
}

.hero .intro-copy {
  min-width: 0;
}

.test-title {
  padding: 17px 22px;
  background:
    linear-gradient(90deg, rgba(77, 216, 111, 0.12), rgba(72, 199, 232, 0.045)),
    rgba(10, 15, 20, 0.96);
  color: #a9f3b8;
  text-align: left;
  font-family: var(--mono);
  font-size: 0.86rem;
  text-transform: uppercase;
}

.hero h1 {
  margin: 28px 0 0;
  padding-inline: 24px;
  text-align: left;
}

.hero p {
  margin: 16px 0 0;
  padding-inline: 24px;
}

.hero-actions {
  justify-content: flex-start;
  margin-top: 24px;
  padding-inline: 24px;
}

.hero > .score-panel {
  width: 100%;
  align-self: stretch;
  padding: 22px;
}

.hero .score-panel .status-line {
  align-items: flex-start;
  flex-direction: column;
}

.hero .score-panel .status-line strong {
  text-align: left;
}

.hero .score-panel .kpi-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hero .score-panel .kpi {
  border-top: 1px solid #334763;
}

.hero .score-panel .kpi:nth-child(odd) {
  border-left: 0;
}

.hero .score-panel .kpi:nth-child(-n + 2) {
  border-top: 0;
}

.record-panel .record-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.achievement-details {
  margin-top: 14px;
}

.achievement-details .achievement-strip {
  margin-top: 12px;
}

.home-settings {
  max-width: 980px;
  margin-top: 24px;
}

.home-settings > summary {
  color: #d9e4eb;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
}

.home-settings > p {
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.6;
}

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

  .hero > .score-panel {
    width: min(780px, 100%);
  }
}

@media (max-width: 640px) {
  html[data-device="mobile"] .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 10px;
  }

  html[data-device="mobile"] .brand {
    min-width: 0;
  }

  html[data-device="mobile"] .brand small {
    display: none;
  }

  html[data-device="mobile"] .site-nav {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  html[data-device="mobile"] .top-actions {
    grid-column: 2;
    grid-row: 1;
    flex-wrap: nowrap;
  }

  html[data-device="mobile"] .top-actions .btn {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 0.8rem;
  }

  .hero {
    margin-top: 10px;
  }

  .test-title,
  .hero h1,
  .hero p,
  .hero-actions {
    padding-inline: 16px;
  }

  .hero .score-panel .details {
    font-size: 0.84rem;
  }

  .training-main,
  .daily-card,
  .profile-card {
    padding: 15px;
  }
}

/* Compact mobile shell: keep the first decision visible and move the full nav behind one control. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mobile-menu-btn {
  display: none;
  width: 40px;
  height: 40px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: rgba(20, 28, 36, 0.92);
  color: var(--text);
}

.menu-icon,
.menu-icon::before,
.menu-icon::after {
  display: block;
  width: 17px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  content: "";
}

.menu-icon {
  position: relative;
}

.menu-icon::before,
.menu-icon::after {
  position: absolute;
  left: 0;
}

.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }

@media (min-width: 981px) and (max-width: 1350px) {
  .site-nav {
    gap: 9px;
  }

  .site-nav a:nth-child(7),
  .site-nav a:nth-child(8) {
    display: none;
  }
}

@media (max-width: 640px) {
  html[data-device="mobile"]:has(#mobileMenuBtn) .topbar {
    position: sticky;
    top: 0;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 7px;
    width: calc(100% - 16px);
    margin: 0 auto 8px;
    padding: calc(9px + var(--safe-top)) 9px 9px;
    border-radius: 0 0 var(--radius) var(--radius);
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .brand {
    min-width: 0;
    gap: 8px;
    padding: 0;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .brand-mark {
    width: 34px;
    height: 34px;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .brand strong {
    overflow: hidden;
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .brand small {
    display: none;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .top-actions {
    grid-column: auto;
    grid-row: 1;
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .top-actions .btn {
    min-height: 38px;
    padding: 6px 8px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .top-actions .btn-primary {
    display: none;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .mobile-menu-btn {
    display: grid;
    grid-column: auto;
    grid-row: 1;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav {
    display: none;
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 9px 0 0;
    border-top: 1px solid var(--line);
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav.is-open {
    display: grid;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav a {
    min-width: 0;
    padding: 10px 8px;
    border: 1px solid rgba(153, 173, 191, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(18, 25, 32, 0.84);
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.2;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav .language-link {
    padding-left: 8px;
    border-left: 1px solid rgba(153, 173, 191, 0.16);
  }

  html[data-device="mobile"] #main {
    width: 100%;
    padding: 12px 8px calc(58px + var(--safe-bottom));
  }

  html[data-device="mobile"] #main[data-view="home"]::before {
    display: none;
  }

  html[data-device="mobile"] #main[data-view="home"] > .hero {
    gap: 12px;
    margin-top: 8px;
    margin-bottom: 18px;
  }

  html[data-device="mobile"] #main[data-view="home"] .intro-copy {
    border-radius: var(--radius);
  }

  html[data-device="mobile"] #main[data-view="home"] .test-title {
    padding: 14px 16px;
    font-size: 0.78rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .mode-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  html[data-device="mobile"] #main[data-view="home"] .mode-chip {
    min-height: 58px;
    padding: 8px 5px;
  }

  html[data-device="mobile"] #main[data-view="home"] .mode-chip b {
    font-size: 0.88rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .mode-chip small {
    font-size: 0.64rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .hero h1 {
    margin-top: 22px;
    padding-inline: 16px;
    font-size: clamp(1.75rem, 8vw, 2.35rem);
    line-height: 1.18;
  }

  html[data-device="mobile"] #main[data-view="home"] .hero p {
    margin-top: 13px;
    padding-inline: 16px;
    font-size: 0.91rem;
    line-height: 1.55;
  }

  html[data-device="mobile"] #main[data-view="home"] .hero-actions {
    gap: 7px;
    margin-top: 18px;
    padding: 0 16px 18px;
  }

  html[data-device="mobile"] #main[data-view="home"] .hero-actions .btn {
    min-height: 44px;
    padding: 9px 10px;
    font-size: 0.82rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .score-panel {
    padding: 14px;
  }

  html[data-device="mobile"] #main[data-view="home"] .score-panel .details,
  html[data-device="mobile"] #main[data-view="home"] > .home-guide,
  html[data-device="mobile"] #main[data-view="home"] .training-panel > .section-title p,
  html[data-device="mobile"] #main[data-view="home"] .training-main > p {
    display: none;
  }

  html[data-device="mobile"] #main[data-view="home"] .section-title h2 {
    font-size: 1.2rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .section-title p {
    max-width: 34rem;
    font-size: 0.86rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .task-card {
    min-height: 0;
    padding: 14px;
  }

  html[data-device="mobile"] #main[data-view="home"] .task-card p {
    display: none;
  }

  html[data-device="mobile"] #main[data-view="home"] .task-card .card-actions .btn:not(.btn-primary) {
    display: none;
  }

  html[data-device="mobile"] #main[data-view="home"] .site-footer,
  html[data-device="mobile"] .site-footer {
    width: calc(100% - 16px);
    margin-bottom: 8px;
    padding: 14px 16px calc(18px + var(--safe-bottom));
  }

  html[data-device="mobile"] .site-footer nav {
    gap: 8px 12px;
  }
}

/* Keep the native wrapper and first paint stable across translated labels. */
@media (max-width: 640px) {
  html[data-device="mobile"]:has(#mobileMenuBtn) .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand menu"
      "actions actions"
      "nav nav";
    align-items: center;
    gap: 9px;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .brand {
    grid-area: brand;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .top-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(88px, 0.65fr);
    width: 100%;
    gap: 7px;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .top-actions .btn,
  html[data-device="mobile"]:has(#mobileMenuBtn) .top-actions .btn-primary {
    display: inline-flex;
    min-width: 0;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.78rem;
    line-height: 1.15;
    white-space: nowrap;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) .mobile-menu-btn {
    grid-area: menu;
    display: grid;
    width: 44px;
    height: 44px;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav {
    grid-area: nav;
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    gap: 6px;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav.is-open {
    display: grid;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav > a,
  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav > .nav-group {
    min-width: 0;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav > a {
    padding: 11px 8px;
    border: 1px solid rgba(153, 173, 191, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(18, 25, 32, 0.84);
    text-align: center;
    white-space: nowrap;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav > .nav-group {
    grid-column: 1 / -1;
  }

  html[data-device="mobile"]:has(#mobileMenuBtn) #siteNav > .nav-group > summary {
    min-width: 0;
    padding: 11px 8px;
    border: 1px solid rgba(153, 173, 191, 0.16);
    border-radius: var(--radius-sm);
    background: rgba(18, 25, 32, 0.84);
    text-align: center;
    white-space: nowrap;
  }
}

/* Dedicated desktop and iPad workspaces. These rules intentionally stay outside
   the mobile shell so touch layouts keep their compact reading order. */
html[data-device="desktop"] .topbar,
html[data-device="desktop"] .site-footer {
  width: min(1360px, calc(100% - 48px));
}

html[data-device="desktop"] .topbar {
  top: 14px;
  grid-template-columns: minmax(210px, 250px) minmax(0, 1fr) auto;
  gap: 24px;
  padding: 15px 22px;
}

html[data-device="desktop"] .site-nav {
  gap: clamp(10px, 1.35vw, 22px);
}

html[data-device="desktop"] .site-nav a {
  font-size: 0.86rem;
}

html[data-device="desktop"] #main {
  width: min(1360px, calc(100% - 48px));
  padding: 40px 0 120px;
}

html[data-device="desktop"] #main[data-view="home"] > .hero {
  grid-template-columns: minmax(0, 1.28fr) minmax(360px, 0.72fr);
  max-width: none;
  margin: 22px 0 26px;
  gap: 20px;
}

html[data-device="desktop"] #main[data-view="home"] > .panel,
html[data-device="desktop"] #main[data-view="home"] > .ad-slot,
html[data-device="desktop"] #main[data-view="history"] > .panel,
html[data-device="desktop"] #main[data-view="summary"] > .panel,
html[data-device="desktop"] #main[data-view="task-info"] > .panel {
  width: 100%;
  max-width: none;
}

html[data-device="desktop"] .training-panel,
html[data-device="desktop"] .starter-panel,
html[data-device="desktop"] .momentum-panel,
html[data-device="desktop"] .guide-panel,
html[data-device="desktop"] .record-panel,
html[data-device="desktop"] .cloud-panel {
  max-width: none;
}

html[data-device="desktop"] .training-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.65fr);
}

html[data-device="desktop"] .momentum-grid {
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.9fr);
}

html[data-device="desktop"] .task-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

html[data-device="desktop"] .content-panel {
  max-width: 1180px;
}

html[data-device="desktop"] #main[data-view="task"]::before {
  display: none;
}

html[data-device="desktop"] #main[data-view="task"] .task-shell {
  grid-template-columns: minmax(0, 1.22fr) minmax(340px, 0.78fr);
  align-items: stretch;
  gap: 18px 20px;
}

html[data-device="desktop"] #main[data-view="task"] .task-head,
html[data-device="desktop"] #main[data-view="task"] .timerbar,
html[data-device="desktop"] #main[data-view="task"] .task-meta {
  grid-column: 1 / -1;
}

html[data-device="desktop"] #main[data-view="task"] .arena {
  grid-column: 1;
  min-height: min(62vh, 620px);
}

html[data-device="desktop"] #main[data-view="task"] #taskControls {
  grid-column: 2;
  align-self: center;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 16, 21, 0.78);
}

html[data-device="desktop"] #main[data-view="task"] #taskControls:empty {
  display: none;
}

html[data-device="desktop"] #main[data-view="task"] .task-shell:has(#taskControls:empty) .arena {
  grid-column: 1 / -1;
}

html[data-device="desktop"] #main[data-view="task"] #taskControls .response-pad {
  max-width: 360px;
  margin-inline: auto;
}

html[data-device="desktop"] #main[data-view="task"] .task-symbol .arena {
  min-height: 450px;
}

html[data-device="desktop"] #main[data-view="task"] .task-symbol #taskControls {
  position: static;
  padding: 18px;
  background: rgba(12, 16, 21, 0.78);
}

html[data-device="desktop"] #main[data-view="task"] .search-board,
html[data-device="desktop"] #main[data-view="task"] .peripheral-stage {
  width: min(100%, 540px);
  height: min(100%, 540px);
}

html[data-device="tablet"] .topbar,
html[data-device="tablet"] .site-footer {
  width: min(1240px, calc(100% - 32px));
}

html[data-device="tablet"] .topbar {
  top: max(10px, var(--safe-top));
  padding: 14px 16px 12px;
  gap: 12px 18px;
}

html[data-device="tablet"] .site-nav {
  gap: 18px;
  padding-top: 12px;
}

html[data-device="tablet"] .site-nav a {
  font-size: 0.88rem;
  padding: 9px 0;
}

html[data-device="tablet"] #main {
  width: min(1240px, calc(100% - 48px));
  padding: 32px 0 100px;
}

html[data-device="tablet"] #main[data-view="home"] > .hero {
  grid-template-columns: minmax(0, 1.14fr) minmax(320px, 0.86fr);
  max-width: none;
  margin: 20px 0 28px;
  gap: 18px;
}

html[data-device="tablet"] #main[data-view="home"] > .panel,
html[data-device="tablet"] #main[data-view="home"] > .ad-slot,
html[data-device="tablet"] #main[data-view="history"] > .panel,
html[data-device="tablet"] #main[data-view="summary"] > .panel,
html[data-device="tablet"] #main[data-view="task-info"] > .panel {
  width: 100%;
  max-width: none;
}

html[data-device="tablet"] .training-panel,
html[data-device="tablet"] .starter-panel,
html[data-device="tablet"] .momentum-panel,
html[data-device="tablet"] .guide-panel,
html[data-device="tablet"] .record-panel,
html[data-device="tablet"] .cloud-panel {
  max-width: none;
}

html[data-device="tablet"] .training-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
}

html[data-device="tablet"] .task-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

html[data-device="tablet"] .content-panel {
  max-width: none;
}

html[data-device="tablet"] #main[data-view="task"]::before {
  display: none;
}

html[data-device="tablet"] #main[data-view="task"] .task-shell {
  grid-template-columns: 1fr;
  gap: 16px;
}

html[data-device="tablet"] #main[data-view="task"] .task-head,
html[data-device="tablet"] #main[data-view="task"] .timerbar,
html[data-device="tablet"] #main[data-view="task"] .task-meta,
html[data-device="tablet"] #main[data-view="task"] .arena,
html[data-device="tablet"] #main[data-view="task"] #taskControls {
  grid-column: 1;
}

html[data-device="tablet"] #main[data-view="task"] .arena {
  min-height: min(54vh, 540px);
  padding: 28px;
}

html[data-device="tablet"] #main[data-view="task"] .task-symbol .arena {
  min-height: 420px;
}

html[data-device="tablet"] #main[data-view="task"] #taskControls {
  min-width: 0;
  padding: 14px 18px calc(14px + var(--safe-bottom));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(12, 16, 21, 0.78);
}

html[data-device="tablet"] #main[data-view="task"] #taskControls:empty {
  display: none;
}

html[data-device="tablet"] #main[data-view="task"] .task-shell:has(#taskControls:empty) .arena {
  grid-column: 1;
}

html[data-device="tablet"] #main[data-view="task"] .task-symbol #taskControls {
  position: static;
  padding: 14px 18px calc(14px + var(--safe-bottom));
  background: rgba(12, 16, 21, 0.78);
}

html[data-device="tablet"] #main[data-view="task"] .response-pad {
  max-width: 520px;
  margin-inline: auto;
}

html[data-device="tablet"] #main[data-view="task"] .search-board,
html[data-device="tablet"] #main[data-view="task"] .peripheral-stage {
  width: min(100%, 520px);
  height: min(100%, 520px);
}

@media (min-width: 1100px) and (orientation: landscape) {
  html[data-device="tablet"] #main[data-view="task"] .task-shell {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    gap: 16px 18px;
  }

  html[data-device="tablet"] #main[data-view="task"] .task-head,
  html[data-device="tablet"] #main[data-view="task"] .timerbar,
  html[data-device="tablet"] #main[data-view="task"] .task-meta {
    grid-column: 1 / -1;
  }

  html[data-device="tablet"] #main[data-view="task"] .arena {
    grid-column: 1;
    min-height: min(58vh, 560px);
  }

  html[data-device="tablet"] #main[data-view="task"] #taskControls {
    grid-column: 2;
    align-self: center;
  }

  html[data-device="tablet"] #main[data-view="task"] #taskControls:empty {
    display: block;
    min-height: 1px;
    padding: 0;
    border: 0;
    background: transparent;
  }

  html[data-device="tablet"] #main[data-view="task"] .task-shell:has(#taskControls:empty) .arena {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) and (min-width: 641px) {
  html[data-device="tablet"] #main[data-view="home"] > .hero {
    grid-template-columns: 1fr;
  }

  html[data-device="tablet"] #main[data-view="home"] .score-panel {
    width: 100%;
  }

  html[data-device="tablet"] .training-grid,
  html[data-device="tablet"] .momentum-grid {
    grid-template-columns: 1fr;
  }

  html[data-device="tablet"] .task-meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  html[data-device="tablet"] .metric-card:nth-child(odd) {
    border-left: 0;
  }

  html[data-device="tablet"] .metric-card:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

  html[data-device="tablet"] #main[data-view="task"] .arena {
    min-height: min(48vh, 480px);
  }
}

/* Home keeps the first decision light; deeper planning stays one deliberate tap away. */
#main[data-view="home"] .home-plan-details {
  margin-top: 24px;
  max-width: 1040px;
  background: rgba(12, 16, 21, 0.72);
}

#main[data-view="home"] .home-plan-details > summary {
  color: #dce8f0;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 800;
  list-style-position: outside;
}

#main[data-view="home"] .home-plan-content {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 20px 28px;
  align-items: center;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

#main[data-view="home"] .home-plan-content > div:first-child strong {
  display: block;
  color: #e9f2f7;
  font-size: 1.06rem;
}

#main[data-view="home"] .home-plan-content > div:first-child p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.65;
}

#main[data-view="home"] .home-plan-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid rgba(112, 146, 173, 0.24);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

#main[data-view="home"] .home-plan-stats span {
  min-width: 0;
  padding: 14px 10px;
  border-left: 1px solid rgba(112, 146, 173, 0.24);
  background: rgba(10, 15, 20, 0.5);
  color: #9ba8ba;
  font-size: 0.74rem;
  text-align: center;
}

#main[data-view="home"] .home-plan-stats span:first-child { border-left: 0; }

#main[data-view="home"] .home-plan-stats b {
  display: block;
  margin-bottom: 5px;
  color: #61e680;
  font-size: 1.2rem;
  line-height: 1;
}

#main[data-view="home"] .home-plan-actions {
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
}

@media (max-width: 900px) {
  #main[data-view="home"] .home-plan-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  html[data-device="mobile"] #main[data-view="home"] .home-plan-details {
    margin-top: 18px;
    padding: 15px;
  }

  html[data-device="mobile"] #main[data-view="home"] .home-plan-details > summary {
    font-size: 0.94rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .home-plan-content {
    gap: 15px;
    margin-top: 14px;
    padding-top: 14px;
  }

  html[data-device="mobile"] #main[data-view="home"] .home-plan-content > div:first-child p {
    font-size: 0.84rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .home-plan-stats span {
    padding: 12px 6px;
    font-size: 0.68rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .home-plan-stats b {
    font-size: 1.05rem;
  }

  html[data-device="mobile"] #main[data-view="home"] .home-plan-actions .btn {
    flex: 1 1 100%;
  }
}

/* Keep the result hierarchy intact after the shared summary styles load. */
#main[data-view="summary"] .result-hero-primary strong {
  color: #f5fbf7;
  font-size: clamp(2.35rem, 7vw, 4.2rem);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.98;
}

#main[data-view="summary"] .result-key-card strong {
  color: #e7f0f4;
  font-size: clamp(1.55rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.05;
}

#main[data-view="summary"] .result-key-card:nth-child(1) strong,
#main[data-view="summary"] .result-key-card:nth-child(3) strong {
  color: #68ed86;
}

#main[data-view="summary"] .result-record-card strong {
  color: #68ed86;
  font-size: clamp(1.55rem, 4vw, 2.35rem);
  font-weight: 900;
}

#main[data-view="summary"] .result-hero-read strong {
  font-weight: 900;
}

#main[data-view="summary"] .result-target span {
  color: #c1f7c8;
}

@media (max-width: 720px) {
  #main[data-view="summary"] .result-hero-primary strong {
    font-size: clamp(2.35rem, 13vw, 3.5rem);
  }

  #main[data-view="summary"] .result-key-card strong {
    font-size: clamp(1.45rem, 8vw, 2.2rem);
  }
}
