:root {
  color-scheme: light;
  --ink: #101520;
  --muted: #465466;
  --deep-blue: #203d53;
  --focus: #264d75;
  --canvas: #f0eff4;
  --glass: linear-gradient(132deg, rgba(220, 230, 240, .91), rgba(251, 250, 253, .95));
  --glass-subtle: linear-gradient(127deg, rgba(219, 231, 240, .78), rgba(246, 245, 250, .89));
  --edge: rgba(255, 255, 255, .76);
  --shadow: 0 16px 38px rgba(34, 57, 91, .095), inset 0 1px 0 rgba(255, 255, 255, .58);
  --radius-large: 36px;
  --radius-medium: 26px;
  --radius-small: 16px;
  --pill: 999px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 98% 43%, rgba(244, 246, 250, .81), transparent 49%),
    radial-gradient(ellipse at 3% 39%, #526da0 0, transparent 48%),
    linear-gradient(164deg, #769fb4 0%, #5d8fa8 20%, #84aabe 44%, #cbd0e1 69%, var(--canvas) 96%);
  background-color: var(--canvas);
  background-repeat: no-repeat;
  background-size: 100% clamp(60rem, 102vh, 78rem);
  color: var(--ink);
  font: 400 1rem/1.48 -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

header, main, footer {
  width: min(100% - 48px, 1120px);
  margin-inline: auto;
}

header { display: flex; align-items: center; gap: 14px; padding-block: 22px 10px; }
main { min-height: 60vh; padding-block: 18px 34px; }
#app > h1:first-child { margin-block: 9px 22px; color: #0e2334; }

a { color: inherit; text-decoration: none; }
:is(a, button, select, input, summary):focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.brand {
  color: #101e2b;
  font-size: 1.65rem;
  font-weight: 720;
  line-height: 1.1;
  letter-spacing: -.055em;
  white-space: nowrap;
}
.brand span { color: #203d53; }

nav {
  display: flex;
  gap: 2px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, .41);
  border-radius: var(--pill);
  background: rgba(225, 238, 245, .67);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24);
}
nav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 5px 15px;
  border-radius: var(--pill);
  color: #192e40;
  font-size: .92rem;
  font-weight: 570;
}
nav a[aria-current="page"] { color: var(--ink); background: rgba(255, 255, 255, .66); }

select, input, button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(84, 106, 128, .32);
  border-radius: var(--radius-small);
  background: rgba(253, 253, 255, .74);
  color: var(--ink);
  font: inherit;
}
.language-picker summary, .rank-controls select {
  appearance: none;
  padding-right: 32px;
  border-radius: var(--pill);
  background:
    linear-gradient(45deg, transparent 49%, #38546a 50%) right 17px center / 5px 5px no-repeat,
    linear-gradient(135deg, #38546a 49%, transparent 50%) right 12px center / 5px 5px no-repeat,
    rgba(235, 244, 249, .79);
}
button { cursor: pointer; font-weight: 620; }
button:disabled { cursor: default; }
a, button, select, input, summary { -webkit-tap-highlight-color: transparent; }

/* A dialog or game screen may receive focus so it can be announced. */
:is(main, .stage, h1, h2)[tabindex="-1"]:focus,
html[data-pointer-focus] :is(a, button, select, input, summary):focus { outline: none; }

h1, h2, h3 { margin-top: 0; color: var(--ink); line-height: 1.12; letter-spacing: -.037em; font-weight: 650; }
h1 { font-size: clamp(2.05rem, 5vw, 3.8rem); overflow-wrap: anywhere; hyphens: auto; }
h2 { font-size: clamp(1.48rem, 3vw, 2rem); margin-block: 30px 14px; }
h3 { font-size: 1.25rem; }
p { margin-block: 0 1em; }
small, .muted { color: var(--muted); }
#app > .muted, footer { color: #23384b; }
small { font-size: .875rem; }
.eyebrow {
  margin: 0 0 13px;
  color: #344c60;
  font-size: .94rem;
  line-height: 1.35;
  font-weight: 560;
}

.hero, .panel, .tile {
  border: 1px solid var(--edge);
  background: var(--glass);
  box-shadow: var(--shadow);
}
.hero {
  position: relative;
  padding: clamp(22px, 5vw, 60px);
  margin-bottom: 32px;
  border-radius: var(--radius-large);
  box-shadow: 0 20px 46px rgba(34, 57, 91, .13), inset 0 1px 0 rgba(255, 255, 255, .78);
}
.hero h1 {
  max-width: 17ch;
  margin-block: 10px 17px;
  font-size: clamp(2.2rem, 6vw, 4.65rem);
  line-height: 1.01;
  letter-spacing: -.054em;
  font-weight: 650;
}
.hero p:not(.eyebrow) { max-width: 46ch; color: #334455; font-size: clamp(1rem, 2vw, 1.18rem); }
.hero small { display: inline-block; margin-top: 15px; }
.main-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(10rem, .42fr);
  align-items: center;
  gap: clamp(18px, 5vw, 66px);
  background:
    radial-gradient(ellipse at 95% 0, rgba(255, 255, 255, .69), transparent 68%),
    linear-gradient(135deg, rgba(205, 222, 235, .92), rgba(245, 244, 250, .96) 74%);
}
.hero-skills, .skill-list { margin: 0; padding: 0; list-style: none; }
.hero-skills {
  display: grid;
  gap: 4px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 255, 255, .59);
  border-radius: var(--radius-medium);
  background: linear-gradient(135deg, rgba(145, 180, 203, .43), rgba(225, 226, 238, .57));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .44);
}
.hero-skills a { display: flex; align-items: center; gap: 9px; color: #24374a; font-size: .95rem; font-weight: 560; }
.hero-skills span, .game-category :is(h2,h3) span {
  display: inline-grid;
  place-items: center;
  width: 1.65em;
  height: 1.65em;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(249, 251, 255, .62);
  color: #2b5069;
  line-height: 1;
}
.game-category :is(h2,h3) span { margin-right: 3px; }

.actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 22px; }
.primary, .secondary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--pill);
  font-size: .96rem;
  font-weight: 620;
  line-height: 1.25;
  text-align: center;
}
.primary { background: #08090d; color: white; box-shadow: 0 2px 6px rgba(20, 33, 51, .12); }
.primary:disabled { opacity: .63; }
.secondary { background: rgba(249, 250, 253, .68); color: #2c4052; border-color: rgba(255, 255, 255, .75); }

.game-categories { display: grid; gap: 14px; margin-bottom: 32px; }
.game-category { scroll-margin-top: 16px; }
.game-category .grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.game-category :is(h2,h3) { margin: 10px 0; }
.panel, .tile { border-radius: var(--radius-medium); padding: 21px; }
.tile { display: block; min-height: 104px; overflow-wrap: anywhere; background: var(--glass-subtle); }
.tile strong { display: block; margin-top: 6px; font-size: clamp(1rem, 3.4vw, 1.18rem); font-weight: 640; letter-spacing: -.02em; }
.tile-category { color: #38536a !important; font-size: .88rem; font-weight: 540; }

.skill-list { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-list li {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .71);
  border-radius: var(--pill);
  background: rgba(235, 241, 247, .65);
  color: #263d51;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.play-heading a, .game-title a { color: #21394b; text-decoration: underline; text-underline-offset: .17em; }
.arena-panel, .solo-panel, .result-panel, .profile { max-width: 750px; border-radius: var(--radius-large); }
.arena-meta { margin-bottom: 8px; color: #33495b; font-size: .95rem; }
.arena-meta strong { color: var(--ink); font-variant-numeric: tabular-nums; }
progress {
  width: 100%;
  height: 9px;
  overflow: hidden;
  border: 0;
  border-radius: var(--pill);
  accent-color: #254760;
  color: #254760;
  background: #c1ccda;
}
progress::-webkit-progress-bar { background: #c1ccda; }
progress::-webkit-progress-value { border-radius: var(--pill); background: #254760; }
progress::-moz-progress-bar { border-radius: var(--pill); background: #254760; }
.arena-panel h1 { margin: 16px 0 8px; }
.arena-prompt { margin: 0 0 12px; color: #23384b; font-size: clamp(1rem, 4vw, 1.38rem); }
.arena-stage { display: grid; min-height: min(56vw, 290px); align-items: center; }
.arena-stage .cells, .arena-stage .choices { justify-self: center; }
.stage {
  display: flex;
  min-height: 280px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.stage h2 { margin: 0; font-size: clamp(1.35rem, 4.5vw, 2rem); }
.choices, .cells { display: grid; gap: 8px; }
.choices { grid-template-columns: repeat(2, minmax(0, 1fr)); width: min(100%, 420px); }
.cells { grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(100%, 350px); }
.cells.arena-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); width: min(100%, 265px); }
.cells button { min-height: 42px; aspect-ratio: 1; padding: 0; font-size: 1.33rem; line-height: 1; }
.cells button:disabled:not(.lit) { color: #566476; background: rgba(240, 244, 250, .54); }
.cells .lit { background: #345b78; border-color: #345b78; color: #fff; }

.signal { width: 100%; min-height: clamp(155px, 38vw, 245px); border-radius: var(--radius-medium); background: #e7c7d7; color: #482438; font-size: clamp(1.4rem, 5vw, 2rem); }
.signal.is-decoy { background: #eed9bd; color: #5a3920; }
.signal.is-ready { background: #b8dfc7; color: #183e30; }

.breakdown { max-width: 750px; margin: 16px 0 20px; padding: 0; list-style: none; }
.breakdown li {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) minmax(0, 2fr) 4.25rem;
  gap: 12px;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid #bec9d6;
}
.breakdown strong { text-align: right; font-variant-numeric: tabular-nums; }
.result-panel h1 { margin: 0 0 12px; font-size: clamp(2rem, 5vw, 3rem); }
.score { color: #121b27; font-size: 3.6rem; font-weight: 680; line-height: 1.08; letter-spacing: -.045em; }
.score span { margin-left: .2em; color: #506275; font-size: .43em; letter-spacing: -.01em; }
.rank-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 15px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px; border-bottom: 1px solid #bec9d6; text-align: left; }
.your-rank { color: #254764; font-weight: 700; }
.game-title h1 { margin-block: 10px; }
.game-form { display: flex; flex-wrap: wrap; width: min(100%, 520px); gap: 8px; }
.game-form input { flex: 1 1 12rem; min-width: 0; }
.guide-links, .locale-links { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 0; list-style: none; }
.guide-links a, footer a, [role="status"] a { text-decoration: underline; text-underline-offset: .17em; }
.timing-track { width: min(90%, 430px); height: 23px; position: relative; border-radius: var(--pill); background: #c1ccda; }
.timing-track span { position: absolute; left: 45%; width: 10%; height: 100%; background: #8ab3ca; }
.timing-track i { position: absolute; width: 4px; height: 100%; background: #1d3448; transform: translateX(-50%); }
[role="status"] a { overflow-wrap: anywhere; }
[role="status"] span:not(:empty) + a { display: block; margin-top: 6px; }
[hidden] { display: none !important; }

.ad-placement {
  margin: 24px auto;
  min-height: 108px;
  width: 100%;
  max-width: 760px;
  text-align: center;
}
.ad-placement.ad-result,
.ad-placement.ad-arena { margin-block-start: 32px; }
.ad-caption {
  color: #465b6e;
  font-size: 0.8rem;
  margin: 0 0 8px;
}
.ad-demo-creative {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 110px;
  padding: 14px 18px;
  border: 1px solid #cedccd;
  border-radius: 12px;
  background: linear-gradient(115deg, #eef6d7, #e3f4f5);
  color: #19372d;
  text-align: left;
}
.ad-demo-creative strong { font-size: clamp(1rem, 3vw, 1.4rem); }
.ad-preview-break {
  width: min(30rem, calc(100% - 2rem));
  padding: 20px;
  border: 1px solid var(--edge);
  border-radius: 16px;
  color: var(--ink);
  background: #f6fbff;
}
.ad-preview-break::backdrop { background: #13233a9c; }
.ad-preview-break h2 { margin-top: 0; }
.ad-preview-break button { margin-top: 16px; }

footer { margin-top: 22px; padding: 18px 0 24px; border-top: 1px solid rgba(68, 87, 107, .25); font-size: .875rem; }

@media (max-width: 760px) {
  header { width: calc(100% - 40px); flex-wrap: wrap; gap: 9px; padding-top: 14px; }
  .language-picker { margin-left: auto; }
  .language-picker summary {
    height: 34px;
    min-height: 34px;
    padding-block: 4px;
    font-size: .875rem;
    line-height: 1.2;
  }
  nav { order: 3; width: 100%; flex-wrap: wrap; justify-content: space-between; padding-inline: 13px; }
  nav a { min-height: 41px; padding-inline: 8px; font-size: .88rem; }
}

@media (max-width: 650px) {
  main, footer { width: calc(100% - 32px); }
  main { padding-top: 10px; }
  .main-hero { grid-template-columns: 1fr; }
  .hero { border-radius: 32px; margin-bottom: 26px; }
  .hero-skills { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game-category .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .tile { min-height: 91px; padding: 14px; border-radius: 21px; }
  .game-form input { flex-basis: 100%; }
  .stage { min-height: 260px; }
}

@media (max-width: 360px) {
  main, footer { width: calc(100% - 24px); }
  header { width: calc(100% - 32px); }
  nav { padding-inline: 11px; }
  .hero, .panel { padding: 17px; }
  .tile { padding: 12px; }
  .cells { gap: 5px; }
  .breakdown li { gap: 7px; }
  nav a { padding-inline: 5px; font-size: .83rem; }
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}
.brand .wordmark { color: #122437; }
.brand .wordmark span { color: #244b6a; }
.brand-mark {
  display: block;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
}
.seo-guide {
  max-width: 49rem;
  margin-top: 34px;
  padding: clamp(17px, 4vw, 30px);
  border: 1px solid var(--edge);
  border-radius: var(--radius-medium);
  background: var(--glass-subtle);
}
.seo-guide h2:first-child { margin-top: 0; }
.practical-guide { overflow-wrap: anywhere; }
.practical-guide h2 { hyphens: auto; }
.practical-guide section + section { margin-top: 1.4rem; }
.seo-guide dt { margin-top: .75em; font-weight: 700; }
.seo-guide dd { margin-inline-start: 0; }
.timed-quote { font-size: 1.2rem; margin-block: 12px; }
.timed-test [role="timer"] { font-variant-numeric: tabular-nums; }
.round-measure { font-size: .9em; font-weight: 500; }
.editorial-article { max-width: 78ch; margin-inline: auto; }
.cps-panel { margin-block-end: 24px; }
.cps-panel [data-target] { touch-action: manipulation; user-select: none; }
.reference-table { margin-block: 18px; }
.seo-guide a { text-decoration: underline; text-underline-offset: .17em; }
.seo-guide details { border-top: 1px solid #b9c8d6; }
.seo-guide details:last-child { border-bottom: 1px solid #b9c8d6; }
.seo-guide summary { cursor: pointer; padding-block: 10px; color: var(--deep-blue); font-weight: 650; }
.seo-guide summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

@media (hover: hover) and (pointer: fine) {
  html:not([data-touch-input]) a:hover { color: var(--deep-blue); }
  html:not([data-touch-input]) nav a:hover { color: var(--ink); background: rgba(255, 255, 255, .66); }
  html:not([data-touch-input]) button:hover:not(:disabled) { border-color: #667d94; }
  html:not([data-touch-input]) .primary:hover:not(:disabled) { background: #253443; color: white; border-color: transparent; }
  html:not([data-touch-input]) .secondary:hover:not(:disabled) { background: #fff; color: var(--ink); border-color: #91a5b7; }
  html:not([data-touch-input]) .tile:hover { border-color: #a4b8c8; background: rgba(255, 255, 255, .95); color: var(--ink); }
}

:is(button:not(:disabled), nav a, .primary, .secondary, .tile, summary):active {
  filter: brightness(.95);
}

@media (min-width: 651px) {
  .main-hero {
    grid-template-columns: minmax(0, 1.19fr) minmax(0, 1fr);
    gap: clamp(18px, 4.2vw, 56px);
  }
  .hero-skills {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-self: stretch;
    align-content: stretch;
    gap: 9px;
    padding: 10px;
  }
  .hero-skills li { min-width: 0; }
  .hero-skills li:nth-child(3n + 2) { --skill-surface: #ece9f4; }
  .hero-skills li:nth-child(3n + 3) { --skill-surface: #e9f1f4; }
  .hero-skills a {
    min-height: 74px;
    height: 100%;
    padding: 10px clamp(8px, 1.4vw, 16px);
    border: 1px solid rgba(255, 255, 255, .66);
    border-radius: var(--radius-small);
    background: linear-gradient(145deg, rgba(255, 255, 255, .68), var(--skill-surface, #e0edf6));
    font-size: clamp(.83rem, 1.18vw, 1.02rem);
    overflow-wrap: anywhere;
  }
  .hero-skills a span { width: 2rem; height: 2rem; }
}
@media (min-width: 651px) and (hover: hover) and (pointer: fine) {
  html:not([data-touch-input]) .hero-skills a:hover { background: #fff; border-color: #a4b8c8; }
}

.main-hero h1 { hyphens: manual; text-wrap: balance; }

:is(.arena-stage, .stage) button { touch-action: manipulation; }
.skip-link { position: absolute; z-index: 5; top: .75rem; left: .75rem; }
.skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.round-feedback { margin: 0; font-weight: 650; }
.stage .choices { overflow-wrap: anywhere; }

.game-guide h3 { margin: 1.45rem 0 .55rem; }
.game-guide p { max-width: 65ch; }

#main-content:focus { outline: none; }
.language-picker { position: relative; }
.language-picker summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-left: 14px;
  border: 1px solid rgba(84, 106, 128, .32);
  cursor: pointer;
  list-style: none;
}
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker ul {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  min-width: 10rem;
  max-height: min(70vh, 28rem);
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  border: 1px solid var(--edge);
  border-radius: var(--radius-small);
  background: #f3f6fb;
  box-shadow: var(--shadow);
  list-style: none;
}
.language-picker a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  border-radius: 9px;
}
.language-picker a[aria-current="page"] { font-weight: 700; background: #e1eaf3; }
@media (max-width: 760px) {
  .language-picker summary { min-height: 34px; }
}

.category-guide { display: inline-block; margin-top: .65rem; color: var(--deep-blue); text-decoration: underline; text-underline-offset: .17em; }
.hub-hero p { max-width: 62ch; }
.hub-games ul { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; }
.hub-games .tile { height: 100%; overflow-wrap: anywhere; }
.hub-guide .breadcrumbs, .game-guide .breadcrumbs {
  display: flex; flex-wrap: wrap; gap: .35rem .65rem; padding: 0; margin: 1.2rem 0 .75rem;
  list-style: none; font-size: .875rem; color: var(--muted);
}
.breadcrumbs li + li::before { content: "/"; margin-inline-end: .65rem; }
@media (max-width: 650px) { .hub-games ul { grid-template-columns: 1fr; } }
