:root {
  color-scheme: light;
  --paper: #f5eddb;
  --paper-deep: #eadfca;
  --paper-light: #fffaf0;
  --ink: #181817;
  --muted: #565149;
  --coral: #f15a43;
  --coral-dark: #c83e2d;
  --blue: #165dff;
  --blue-dark: #0b42bd;
  --yellow: #f6c945;
  --green: #247a56;
  --line: 2px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --radius: 8px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 16% 18%, rgb(24 24 23 / 0.045) 0 1px, transparent 1.5px),
    radial-gradient(circle at 78% 70%, rgb(24 24 23 / 0.035) 0 1px, transparent 1.5px);
  background-size: 17px 17px, 23px 23px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgb(22 93 255 / 0.18);
}

button {
  color: inherit;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

button:not(:disabled),
select:not(:disabled) {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 0.75rem;
  left: 0.75rem;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border: var(--line);
  background: var(--paper-light);
  font-weight: 800;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.site-shell {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  flex-direction: column;
  overflow: hidden;
}

.site-header {
  display: flex;
  width: min(100% - 1.5rem, var(--max-width));
  min-height: 72px;
  margin: 0 auto;
  padding-top: max(0.75rem, env(safe-area-inset-top));
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: var(--line);
}

.dashboard-page .dashboard-header {
  position: relative;
  z-index: 40;
  width: 100%;
  margin: 0;
  padding: max(0.75rem, env(safe-area-inset-top)) max(0.75rem, calc((100% - var(--max-width)) / 2)) 0.75rem;
  border-bottom-color: var(--coral);
  color: var(--paper-light);
  background: var(--ink);
}

.dashboard-header .brand {
  color: var(--paper-light);
}

.dashboard-header .brand-mark {
  border-color: var(--paper-light);
  box-shadow: 3px 3px 0 var(--coral);
  color: var(--ink);
}

.dashboard-header .connection-pill {
  border-color: rgb(255 250 240 / 0.4);
  color: #e8e0d3;
  background: rgb(255 255 255 / 0.08);
}

.dashboard-header .nav-button {
  color: var(--paper-light);
}

.dashboard-nav {
  min-width: 0;
  gap: 0.5rem;
}

.dashboard-nav > .dashboard-guest-home {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--paper-light);
}

.user-nav {
  position: relative;
  min-width: 0;
}

.user-menu-trigger {
  display: flex;
  min-height: 48px;
  max-width: min(270px, 52vw);
  padding: 0.3rem 0.45rem;
  border: 1px solid rgb(255 250 240 / 0.42);
  border-radius: 999px;
  align-items: center;
  gap: 0.55rem;
  color: var(--paper-light);
  background: rgb(255 255 255 / 0.08);
}

.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
  border-color: var(--yellow);
  background: rgb(255 255 255 / 0.16);
}

.user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
  color: var(--ink);
  background: var(--yellow);
  font-size: 0.76rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.user-nav-copy {
  display: none;
  min-width: 0;
  text-align: left;
}

.user-nav-copy strong,
.user-nav-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-nav-copy strong {
  font-size: 0.78rem;
}

.user-nav-copy small {
  color: #cfc7ba;
  font-size: 0.66rem;
}

.user-menu-chevron {
  flex: 0 0 auto;
  font-size: 1rem;
  transition: transform 140ms ease;
}

.user-menu-trigger[aria-expanded="true"] .user-menu-chevron {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.6rem);
  right: 0;
  display: grid;
  width: min(280px, calc(100vw - 1.5rem));
  padding: 0.45rem;
  border: var(--line);
  overscroll-behavior: contain;
  background: var(--paper-light);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.user-menu > a,
.user-menu > button {
  display: flex;
  min-height: 46px;
  padding: 0.7rem 0.8rem;
  border: 0;
  align-items: center;
  color: var(--ink);
  background: transparent;
  font-weight: 800;
  text-align: left;
  text-decoration: none;
}

.user-menu > a:hover,
.user-menu > button:hover {
  background: var(--paper-deep);
}

.user-menu > .user-menu-signout {
  margin-top: 0.25rem;
  border-top: 1px solid rgb(24 24 23 / 0.28);
  color: var(--coral-dark);
}

.site-nav > .public-user-chip {
  display: inline-flex;
  min-height: 46px;
  min-width: 0;
  padding: 0.25rem 0.55rem 0.25rem 0.25rem;
  border: 1px solid rgb(24 24 23 / 0.35);
  border-radius: 999px;
  align-items: center;
  gap: 0.5rem;
  background: var(--paper-light);
  text-decoration: none;
}

.public-user-chip:hover {
  border-color: var(--blue);
  box-shadow: 2px 2px 0 var(--blue);
  text-decoration: none;
}

.public-user-avatar {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  place-items: center;
  color: var(--paper-light);
  background: var(--blue);
  font-size: 0.74rem;
  font-weight: 950;
  letter-spacing: 0.04em;
}

.public-user-copy {
  display: none;
  min-width: 0;
  max-width: 150px;
}

.public-user-copy strong,
.public-user-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-user-copy strong {
  color: var(--ink);
  font-size: 0.76rem;
}

.public-user-copy small {
  color: var(--muted);
  font-size: 0.64rem;
}

.brand {
  display: inline-flex;
  min-height: 44px;
  min-width: 0;
  padding: 0;
  border: 0;
  align-items: center;
  gap: 0.65rem;
  background: transparent;
  font-size: 0.84rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand:hover .brand-mark {
  transform: rotate(2deg);
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  border: var(--line);
  place-items: center;
  background: var(--coral);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 1.1rem;
  line-height: 1;
  transform: rotate(-3deg);
}

.brand-mark span {
  color: var(--paper-light);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav > a,
.nav-button {
  display: none;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  border: 0;
  background: transparent;
  font-size: 0.83rem;
  font-weight: 800;
  text-decoration: none;
}

.site-nav > a:hover,
.nav-button:hover,
.text-button:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.connection-pill {
  display: inline-flex;
  min-height: 32px;
  padding: 0.35rem 0.55rem;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid rgb(24 24 23 / 0.35);
  border-radius: 999px;
  background: rgb(255 250 240 / 0.55);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.connection-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cf9121;
}

.connection-pill.is-online .connection-dot {
  background: var(--green);
}

.connection-pill.is-offline .connection-dot {
  background: var(--coral-dark);
}

main {
  width: 100%;
  min-width: 0;
  flex: 1;
}

.connection-alert {
  width: min(100% - 1.5rem, var(--max-width));
  margin: 0.75rem auto 0;
  padding: 0.8rem 1rem;
  border: 2px solid var(--coral-dark);
  background: #fff1e8;
  color: #731f16;
  box-shadow: 3px 3px 0 var(--ink);
  overflow-wrap: anywhere;
}

.connection-alert strong {
  margin-right: 0.35rem;
}

.screen {
  width: min(100% - 1.5rem, var(--max-width));
  margin: 0 auto;
  padding: 2.25rem 0 4rem;
}

.compact-screen {
  width: min(100% - 1.5rem, 880px);
}

.eyebrow {
  margin: 0 0 0.65rem;
  color: var(--coral-dark);
  font-size: 0.75rem;
  font-weight: 950;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  overflow-wrap: anywhere;
  scroll-margin-top: 1rem;
  text-wrap: balance;
}

p {
  overflow-wrap: anywhere;
  text-wrap: pretty;
}

h1,
h2,
h3,
.word-card strong,
.clue-card strong,
.answer-card strong {
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", ui-sans-serif, sans-serif;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.landing-screen {
  display: grid;
  min-height: calc(100dvh - 72px);
  align-content: center;
  gap: 3.25rem;
}

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

.hero-copy h1,
.section-heading h1,
.game-topline h1,
.room-masthead h1 {
  margin-bottom: 1.25rem;
  font-size: clamp(3.25rem, 14vw, 7.7rem);
  line-height: 0.85;
  text-transform: uppercase;
}

.hero-copy h1 em {
  color: var(--blue);
  font-style: normal;
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 3px 3px 0 var(--ink);
}

.hero-intro {
  max-width: 600px;
  margin-bottom: 1.5rem;
  color: #393631;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 3vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
}

.returning-player {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.button {
  display: inline-flex;
  min-height: 48px;
  padding: 0.72rem 1.15rem;
  border: var(--line);
  border-radius: 3px;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: var(--paper-light);
  font-weight: 900;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.button:not(:disabled):hover {
  transform: translate(-2px, -2px);
}

.button:not(:disabled):active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.button-primary {
  background: var(--coral);
  box-shadow: 4px 4px 0 var(--ink);
}

.button-primary:hover {
  background: #ff725c;
}

.button-dark {
  color: var(--paper-light);
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--coral);
}

.button-light {
  color: var(--ink);
  background: var(--paper-light);
  box-shadow: 4px 4px 0 var(--ink);
}

.button[aria-busy="true"] {
  cursor: progress;
  box-shadow: 1px 1px 0 var(--ink);
  transform: translate(2px, 2px);
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  box-shadow: none;
}

.button-small {
  min-height: 44px;
  padding: 0.55rem 0.8rem;
}

.text-button {
  min-height: 44px;
  padding: 0.5rem;
  border: 0;
  background: transparent;
  color: inherit;
  font-weight: 850;
  text-underline-offset: 0.25em;
}

.word-demo {
  position: relative;
  display: grid;
  padding: 1.25rem 0.9rem 1.5rem;
  border: var(--line);
  gap: 0.65rem;
  background: var(--paper-light);
  box-shadow: var(--shadow);
  transform: rotate(0.5deg);
}

.demo-label {
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.88rem;
  font-style: italic;
  text-align: center;
}

.word-card,
.answer-card {
  position: relative;
  display: flex;
  min-height: 92px;
  padding: 1rem;
  border: var(--line);
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--ink);
  text-align: center;
}

.word-card-coral {
  background: var(--coral);
  transform: rotate(-1.2deg);
}

.word-card-blue {
  color: white;
  background: var(--blue);
  transform: rotate(1.2deg);
}

.word-card strong {
  font-size: clamp(1.8rem, 9vw, 3.4rem);
  line-height: 0.9;
}

.word-number {
  position: absolute;
  top: 0.4rem;
  left: 0.5rem;
  font-size: 0.65rem;
  font-weight: 900;
}

.operator {
  display: block;
  height: 38px;
  font-family: Georgia, serif;
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 0.8;
  text-align: center;
}

.answer-card {
  min-height: 108px;
  flex-direction: column;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  transform: rotate(-0.6deg);
}

.answer-card span {
  font-family: Georgia, serif;
  font-size: 0.8rem;
  font-style: italic;
}

.answer-card strong {
  font-size: clamp(2.8rem, 14vw, 5rem);
  line-height: 0.9;
}

.scribble {
  position: absolute;
  z-index: -1;
  border: 3px solid var(--blue);
  border-radius: 50%;
}

.scribble-one {
  top: -25px;
  right: -20px;
  width: 80px;
  height: 80px;
}

.scribble-two {
  bottom: -18px;
  left: -16px;
  width: 55px;
  height: 55px;
  border-color: var(--coral);
  border-radius: 0;
  transform: rotate(18deg);
}

.how-strip {
  display: grid;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border-top: var(--line);
  border-bottom: var(--line);
  list-style: none;
}

.how-strip li {
  display: grid;
  min-height: 68px;
  padding: 0.8rem;
  grid-template-columns: 32px auto 1fr;
  align-items: center;
  gap: 0.55rem;
  border-bottom: 1px solid rgb(24 24 23 / 0.45);
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 0.94rem;
}

.how-strip li:last-child {
  border-bottom: 0;
}

.how-strip li > span {
  display: grid;
  width: 28px;
  height: 28px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  place-items: center;
  color: var(--ink);
  font-family: ui-sans-serif, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
}

.how-strip strong {
  color: var(--ink);
  font-family: ui-sans-serif, sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 2rem;
}

.section-heading h1,
.game-topline h1,
.room-masthead h1 {
  margin-bottom: 0.8rem;
  font-size: clamp(2.7rem, 10vw, 5.8rem);
}

.section-heading > p:last-child,
.game-topline p,
.room-masthead p {
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 1.05rem;
}

.section-heading-row,
.game-topline,
.room-masthead {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.paper-panel {
  border: var(--line);
  border-radius: var(--radius);
  background: var(--paper-light);
  box-shadow: var(--shadow);
}

.form-panel {
  display: grid;
  padding: clamp(1.1rem, 5vw, 2.25rem);
  gap: 1.25rem;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label,
.answer-form label {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field label span {
  color: var(--muted);
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.field-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 0.75rem 0.9rem;
  border: 2px solid var(--ink);
  border-radius: 2px;
  color: var(--ink);
  background: #fffdf8;
}

input::placeholder {
  color: #8b857a;
}

input:focus,
select:focus {
  border-color: var(--blue);
}

.field-label-row {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.detect-country-button {
  min-height: 44px;
  padding: 0.35rem 0;
  border: 0;
  color: var(--blue-dark);
  background: transparent;
  font-size: 0.76rem;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

.detect-country-button:hover {
  color: var(--coral-dark);
  text-decoration-thickness: 2px;
}

.country-combobox {
  position: relative;
}

.country-combobox input {
  padding-right: 3.25rem;
}

.country-toggle {
  position: absolute;
  top: 2px;
  right: 2px;
  display: grid;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-left: 1px solid rgb(24 24 23 / 0.25);
  place-items: center;
  background: var(--paper-deep);
  font-size: 1.3rem;
}

.country-toggle:hover {
  background: var(--yellow);
}

.country-combobox:focus-within input {
  border-color: var(--blue);
}

.country-options {
  position: absolute;
  z-index: 30;
  top: calc(100% + 0.35rem);
  right: 0;
  left: 0;
  max-height: min(320px, 45vh);
  margin: 0;
  padding: 0.35rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: var(--line);
  border-radius: 3px;
  background: var(--paper-light);
  box-shadow: var(--shadow);
  list-style: none;
}

.country-option {
  display: grid;
  min-height: 44px;
  padding: 0.65rem 0.75rem;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  border-radius: 2px;
  cursor: pointer;
}

.country-option:hover,
.country-option[aria-selected="true"] {
  color: white;
  background: var(--blue);
}

.country-option-code {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.country-empty {
  padding: 0.8rem;
  color: var(--muted);
  font-family: Georgia, serif;
}

.dashboard-overview {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.dashboard-welcome {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
}

.dashboard-welcome > div {
  min-width: 0;
}

.dashboard-welcome h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(3rem, 11vw, 6.5rem);
  line-height: 0.86;
  text-transform: uppercase;
}

.dashboard-welcome h1 span {
  color: var(--blue);
  -webkit-text-stroke: 1px var(--ink);
  text-shadow: 3px 3px 0 var(--ink);
}

.dashboard-welcome > div > p:last-child {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.dashboard-grid {
  display: grid;
  min-width: 0;
  gap: 1.5rem;
}

.dashboard-start-card,
.dashboard-stats-card {
  position: relative;
  min-width: 0;
  padding: clamp(1.25rem, 5vw, 2.25rem);
  border: var(--line);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.dashboard-start-card {
  display: flex;
  min-height: 350px;
  flex-direction: column;
  align-items: flex-start;
  background: var(--coral);
}

.dashboard-start-card .eyebrow {
  position: relative;
  color: var(--ink);
}

.dashboard-start-card h2 {
  position: relative;
  max-width: 520px;
  margin: auto 0 0.8rem;
  font-size: clamp(3rem, 11vw, 6rem);
  line-height: 0.88;
  text-transform: uppercase;
}

.dashboard-start-card > p:not(.eyebrow) {
  position: relative;
  max-width: 48ch;
  margin-bottom: 1.4rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.05rem;
}

.dashboard-card-number {
  position: absolute;
  top: 0.25rem;
  right: 0.5rem;
  color: rgb(255 250 240 / 0.34);
  font-family: Georgia, serif;
  font-size: clamp(8rem, 28vw, 15rem);
  font-weight: 900;
  line-height: 0.8;
  transform: rotate(8deg);
}

.dashboard-stats-card {
  background: var(--paper-light);
}

.dashboard-stats-grid {
  display: grid;
  margin: 1rem 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: var(--line);
}

.dashboard-stats-grid > div {
  min-width: 0;
  padding: 0.9rem;
  border-right: 1px solid rgb(24 24 23 / 0.35);
  border-bottom: 1px solid rgb(24 24 23 / 0.35);
}

.dashboard-stats-grid > div:nth-child(even) {
  border-right: 0;
}

.dashboard-stats-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.dashboard-stats-grid dt {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dashboard-stats-grid dd {
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", ui-sans-serif, sans-serif;
  font-size: clamp(1.8rem, 7vw, 3rem);
  font-variant-numeric: tabular-nums;
}

.dashboard-stats-status {
  min-height: 48px;
  margin: 0 0 0.75rem;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
}

.dashboard-leaderboard-link {
  color: var(--blue-dark);
}

.section-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mode-grid {
  display: grid;
  gap: 1.5rem;
}

.mode-card {
  position: relative;
  display: flex;
  min-height: 390px;
  padding: clamp(1.25rem, 5vw, 2rem);
  border: var(--line);
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.mode-card-solo {
  background: var(--yellow);
}

.mode-card-room {
  color: white;
  background: var(--blue);
}

.mode-card-room p,
.mode-card-room .mode-index,
.mode-card-room h2,
.mode-card-room h3 {
  color: white;
}

.mode-card-room .button-light,
.mode-card-room .button-light * {
  color: var(--ink);
}

.mode-index {
  font-size: 0.73rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.mode-symbol {
  position: absolute;
  top: 2.2rem;
  right: -0.25rem;
  color: rgb(255 250 240 / 0.38);
  font-family: Georgia, serif;
  font-size: 11rem;
  font-weight: 900;
  line-height: 0.8;
  transform: rotate(8deg);
}

.mode-card-solo .mode-symbol {
  color: rgb(24 24 23 / 0.12);
}

.mode-symbol-plus {
  right: 0.75rem;
  font-size: 12rem;
}

.mode-card h2,
.mode-card h3 {
  position: relative;
  max-width: 420px;
  margin: auto 0 0.75rem;
  overflow-wrap: anywhere;
  font-size: clamp(2.25rem, 9vw, 4rem);
  line-height: 0.92;
  text-transform: uppercase;
}

.mode-card p {
  position: relative;
  max-width: 420px;
  margin-bottom: 1.35rem;
  overflow-wrap: anywhere;
  font-family: Georgia, serif;
  font-size: 1rem;
}

.game-screen,
.room-screen {
  padding-top: 1.5rem;
}

.game-topline,
.room-masthead {
  margin-bottom: 1.25rem;
}

.stat-ribbon {
  display: grid;
  margin-bottom: 1.5rem;
  border: var(--line);
  grid-template-columns: repeat(2, 1fr);
  background: var(--ink);
  color: white;
}

.stat-ribbon > div {
  display: flex;
  min-height: 70px;
  padding: 0.65rem;
  border-right: 1px solid rgb(255 255 255 / 0.35);
  border-bottom: 1px solid rgb(255 255 255 / 0.35);
  flex-direction: column;
  justify-content: center;
}

.stat-ribbon > div:nth-child(even) {
  border-right: 0;
}

.stat-ribbon span {
  color: #cfcac1;
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stat-ribbon strong {
  font-size: 1.45rem;
  line-height: 1.1;
}

.stat-ribbon .timer-stat {
  color: var(--yellow);
}

.game-layout,
.room-layout,
.room-game-layout {
  display: grid;
  gap: 1.5rem;
}

.puzzle-panel,
.history-panel,
.players-panel,
.scoreboard-panel {
  border: var(--line);
  background: var(--paper-light);
}

.puzzle-panel {
  padding: clamp(1rem, 4vw, 2rem);
  box-shadow: var(--shadow);
}

.puzzle-meta {
  display: flex;
  margin-bottom: 1.15rem;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.puzzle-meta span {
  max-width: 100%;
  min-width: 0;
  padding: 0.25rem 0.55rem;
  overflow-wrap: anywhere;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.clue-equation {
  display: grid;
  align-items: center;
  gap: 0.6rem;
}

.clue-card {
  display: flex;
  min-height: 126px;
  padding: 1rem;
  border: var(--line);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.clue-card-coral {
  background: var(--coral);
  transform: rotate(-0.7deg);
}

.clue-card-blue {
  color: white;
  background: var(--blue);
  transform: rotate(0.7deg);
}

.clue-card span {
  margin-bottom: 0.35rem;
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.clue-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 10vw, 4rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.clue-operator {
  display: grid;
  height: 34px;
  place-items: center;
  font-family: Georgia, serif;
  font-size: 2.4rem;
  font-weight: 900;
}

.definition {
  max-width: 680px;
  margin: 1.4rem auto;
  color: #3d3933;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 3vw, 1.25rem);
  font-style: italic;
  text-align: center;
}

.answer-form {
  display: grid;
  gap: 0.45rem;
}

.answer-row {
  display: grid;
  gap: 0.7rem;
}

.answer-row input {
  min-height: 56px;
  font-size: 1.05rem;
  font-weight: 800;
}

.feedback {
  min-height: 32px;
  margin-top: 0.75rem;
  padding: 0.35rem 0;
  color: #45413b;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.feedback.is-correct {
  color: var(--green);
}

.feedback.is-wrong {
  color: #a52f22;
}

.puzzle-footer {
  display: flex;
  margin-top: 0.75rem;
  flex-direction: column-reverse;
  gap: 0.9rem;
}

.progress-wrap {
  display: grid;
  flex: 1;
  gap: 0.35rem;
}

.progress-wrap label {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

progress {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: var(--paper-deep);
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--paper-deep);
}

progress::-webkit-progress-value {
  background: var(--blue);
}

progress::-moz-progress-bar {
  background: var(--blue);
}

.history-panel,
.players-panel,
.scoreboard-panel {
  padding: 1.15rem;
}

.aside-heading {
  display: flex;
  padding-bottom: 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: var(--line);
}

.aside-heading h2 {
  margin: 0;
  font-size: 1.65rem;
  text-transform: uppercase;
}

.aside-heading span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.history-list,
.player-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-list li,
.player-list li {
  display: grid;
  min-height: 52px;
  padding: 0.7rem 0;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 1px solid rgb(24 24 23 / 0.22);
}

.list-rank {
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 0.8rem;
  font-style: italic;
}

.list-primary {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 850;
}

.list-secondary {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
  font-size: 0.76rem;
  font-weight: 800;
  text-align: right;
}

.history-list li.is-correct .list-secondary {
  color: var(--green);
}

.history-list li.is-wrong .list-secondary {
  color: var(--coral-dark);
}

.empty-note {
  margin: 1.1rem 0 0;
  padding: 0.8rem;
  border: 1px dashed rgb(24 24 23 / 0.5);
  color: #45413b;
  background: var(--paper-deep);
  font-family: Georgia, serif;
  font-size: 0.9rem;
  font-style: italic;
}

.player-list .empty-list-item {
  display: block;
  min-height: 0;
  padding: 1rem 0;
  color: #45413b;
  overflow-wrap: anywhere;
  font-family: Georgia, serif;
  font-style: italic;
}

.end-panel {
  max-width: 760px;
  margin: 2rem auto 0;
  padding: clamp(1.5rem, 6vw, 3rem);
  border: var(--line);
  background: var(--yellow);
  box-shadow: var(--shadow);
  text-align: center;
}

.end-kicker {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.end-panel h2 {
  margin: 0.55rem 0 0.75rem;
  font-size: clamp(2.5rem, 10vw, 5rem);
  line-height: 0.9;
  text-transform: uppercase;
}

.end-panel > p {
  font-family: Georgia, serif;
  font-size: 1.05rem;
}

.centered-actions {
  justify-content: center;
}

.room-setup {
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: var(--line);
}

.tabs button {
  min-height: 54px;
  padding: 0.7rem;
  border: 0;
  background: var(--paper-deep);
  font-weight: 900;
}

.tabs button + button {
  border-left: var(--line);
}

.tabs button[aria-selected="true"] {
  color: white;
  background: var(--blue);
}

.room-form {
  display: grid;
  padding: clamp(1.1rem, 5vw, 2.1rem);
  gap: 1.15rem;
}

.code-input {
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.back-button,
.room-leave-button {
  margin-top: 1.25rem;
}

.room-code-block {
  display: grid;
  width: fit-content;
  min-width: 150px;
  padding: 0.7rem 1rem;
  border: var(--line);
  justify-items: start;
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(1deg);
}

.room-code-block > span {
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-code-block strong {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-size: 1.55rem;
  letter-spacing: 0.12em;
}

.room-code-block .text-button {
  min-height: 44px;
  padding: 0.2rem 0;
  font-size: 0.78rem;
}

.lobby-panel {
  position: relative;
  padding: clamp(1.25rem, 5vw, 2.3rem);
  overflow: hidden;
}

.lobby-panel h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(2.4rem, 10vw, 4.5rem);
  text-transform: uppercase;
}

.lobby-panel > p {
  max-width: 510px;
  color: var(--muted);
  font-family: Georgia, serif;
}

.lobby-stamp {
  position: absolute;
  top: 1.5rem;
  right: -1.1rem;
  padding: 0.3rem 1.5rem;
  border: 3px solid var(--coral-dark);
  color: var(--coral-dark);
  font-size: 0.8rem;
  font-weight: 950;
  letter-spacing: 0.1em;
  transform: rotate(14deg);
}

.room-details {
  display: grid;
  margin: 1.5rem 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: var(--line);
  border-bottom: var(--line);
}

.room-details div {
  padding: 0.9rem;
}

.room-details div + div {
  border-left: var(--line);
}

.room-details dt {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.room-details dd {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 900;
}

.host-note {
  margin: 1rem 0 0;
  font-size: 0.86rem;
}

.room-game-main {
  min-width: 0;
}

.room-stat-ribbon {
  grid-template-columns: repeat(3, 1fr);
}

.room-stat-ribbon > div,
.room-stat-ribbon > div:nth-child(even) {
  border-right: 1px solid rgb(255 255 255 / 0.35);
  border-bottom: 0;
}

.room-stat-ribbon > div:last-child {
  border-right: 0;
}

.final-scoreboard {
  max-width: 480px;
  margin: 1.25rem auto;
  border-top: var(--line);
}

.how-dialog {
  width: min(calc(100% - 1.5rem), 620px);
  max-height: min(86vh, 720px);
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: var(--line);
  border-radius: var(--radius);
  background: var(--paper-light);
  box-shadow: 8px 8px 0 var(--ink);
  color: var(--ink);
}

.how-dialog::backdrop {
  background: rgb(24 24 23 / 0.72);
  backdrop-filter: blur(2px);
}

.how-dialog form {
  position: relative;
  padding: clamp(1.4rem, 6vw, 2.5rem);
}

.how-dialog h2 {
  margin-bottom: 0.7rem;
  font-size: clamp(2.6rem, 11vw, 4.8rem);
  line-height: 0.88;
  text-transform: uppercase;
}

.how-dialog > form > p:not(.eyebrow),
.how-dialog li {
  font-family: Georgia, serif;
}

.how-dialog ol {
  display: grid;
  margin: 1.2rem 0;
  padding-left: 1.35rem;
  gap: 0.65rem;
}

.dialog-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  place-items: center;
  background: transparent;
  font-size: 1.8rem;
}

.mini-equation {
  display: flex;
  margin: 1.25rem 0;
  padding: 0.8rem;
  border: var(--line);
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  background: var(--yellow);
}

.mini-equation strong {
  font-size: 1.05rem;
}

.toast {
  position: fixed;
  z-index: 90;
  right: max(0.75rem, env(safe-area-inset-right));
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  left: max(0.75rem, env(safe-area-inset-left));
  display: flex;
  min-height: 54px;
  padding: 0.65rem 0.65rem 0.65rem 1rem;
  border: var(--line);
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--ink);
  box-shadow: 4px 4px 0 var(--coral);
  color: white;
  font-weight: 750;
}

.toast button {
  display: grid;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid rgb(255 255 255 / 0.5);
  place-items: center;
  background: transparent;
  color: white;
  font-size: 1.3rem;
}

.support-screen {
  display: grid;
  max-width: 980px;
  gap: clamp(1.25rem, 4vw, 2.5rem);
}

.support-screen .section-heading {
  max-width: 760px;
}

.content-panel {
  display: grid;
  gap: 1.25rem;
}

.content-panel > p,
.mode-card > p:not(.eyebrow),
.callout p {
  max-width: 68ch;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--muted);
}

.mode-card-room > p:not(.eyebrow) {
  color: white;
}

.content-grid {
  margin: 0;
}

.callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  background: var(--yellow);
}

.callout h2,
.leaderboard-panel h2 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 3rem);
  line-height: 0.95;
  text-transform: uppercase;
}

.callout p {
  margin: 0.4rem 0 0;
  color: var(--ink);
}

.leaderboard-panel {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1rem, 4vw, 2rem);
}

.leaderboard-panel .status {
  min-height: 52px;
  margin: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
}

.leaderboard-panel .status--success {
  border-color: var(--green);
  background: rgb(36 122 86 / 0.12);
}

.leaderboard-panel .status--error {
  border-color: var(--coral-dark);
  background: rgb(241 90 67 / 0.12);
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: var(--line);
  background: var(--paper-light);
}

.leaderboard-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.leaderboard-table caption {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgb(24 24 23 / 0.28);
  text-align: left;
  white-space: nowrap;
}

.leaderboard-table thead th {
  background: var(--ink);
  color: var(--paper-light);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.leaderboard-table tbody tr:nth-child(even) {
  background: var(--paper-deep);
}

.leaderboard-table tbody tr:hover {
  background: rgb(246 201 69 / 0.35);
}

.leaderboard-table .player-cell {
  max-width: 220px;
  overflow: hidden;
  font-weight: 850;
  text-overflow: ellipsis;
}

.leaderboard-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.site-footer {
  display: flex;
  width: min(100% - 1.5rem, var(--max-width));
  margin: auto auto 0;
  padding: 1.25rem 0 max(1.25rem, env(safe-area-inset-bottom));
  border-top: var(--line);
  flex-direction: column;
  gap: 0.8rem;
  color: var(--muted);
  font-size: 0.77rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.site-footer div,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.marketing-header {
  flex-wrap: wrap;
  padding-bottom: 0.65rem;
}

.marketing-nav {
  width: 100%;
  justify-content: space-between;
}

.marketing-nav > a {
  display: inline-flex;
  min-height: 44px;
  padding: 0.65rem 0.45rem;
  align-items: center;
}

.marketing-hero {
  min-height: auto;
}

.editorial-band {
  display: grid;
  width: 100%;
  padding: clamp(2.5rem, 8vw, 6rem) max(0.75rem, calc((100% - var(--max-width)) / 2));
  gap: 1.5rem;
  background: var(--ink);
  color: var(--paper-light);
}

.editorial-intro,
.editorial-copy {
  min-width: 0;
}

.editorial-band h2,
.marketing-modes .section-heading h2,
.marketing-cta h2 {
  margin-bottom: 1rem;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", ui-sans-serif, sans-serif;
  font-size: clamp(2.8rem, 10vw, 6.2rem);
  font-weight: 900;
  letter-spacing: -0.025em;
  line-height: 0.9;
  text-transform: uppercase;
}

.editorial-band .eyebrow {
  color: var(--yellow);
}

.editorial-copy p {
  max-width: 56ch;
  color: #eee7da;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.05rem, 2.5vw, 1.3rem);
}

.text-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 0.6rem;
  color: var(--yellow);
  font-weight: 900;
}

.marketing-modes {
  padding-block: clamp(3rem, 8vw, 6rem);
}

.marketing-cta {
  display: grid;
  margin-bottom: clamp(2rem, 6vw, 5rem);
  padding: clamp(2rem, 8vw, 5rem);
  border: var(--line);
  justify-items: center;
  background: var(--yellow);
  box-shadow: var(--shadow);
  text-align: center;
}

.marketing-cta .button {
  width: fit-content;
}

@media (min-width: 520px) {
  .site-nav > a,
  .nav-button {
    display: inline-flex;
    align-items: center;
  }

  .answer-row {
    grid-template-columns: 1fr auto;
  }

  .answer-row .button {
    min-width: 120px;
  }

  .puzzle-footer {
    flex-direction: row;
    align-items: end;
    justify-content: space-between;
  }

  .progress-wrap {
    max-width: 280px;
  }

  .room-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-wide {
    grid-column: 1 / -1;
  }

  .site-footer {
    flex-direction: row;
    justify-content: space-between;
  }

  .marketing-header {
    flex-wrap: nowrap;
    padding-bottom: 0;
  }

  .marketing-nav {
    width: auto;
    justify-content: flex-end;
  }

  .toast {
    left: auto;
    width: min(420px, calc(100% - 1.5rem));
  }
}

@media (min-width: 700px) {
  .user-nav-copy,
  .public-user-copy {
    display: block;
  }

  .site-header,
  .screen,
  .site-footer {
    width: min(100% - 3rem, var(--max-width));
  }

  .screen {
    padding-top: 3.5rem;
  }

  .section-heading-row,
  .game-topline,
  .room-masthead {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .dashboard-welcome {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
  }

  .word-demo {
    padding: 1.5rem;
    grid-template-columns: 1fr 42px 1fr;
  }

  .demo-label,
  .answer-card {
    grid-column: 1 / -1;
  }

  .word-card {
    min-height: 135px;
  }

  .operator {
    align-self: center;
  }

  .equals {
    grid-column: 1 / -1;
  }

  .answer-card {
    min-height: 130px;
  }

  .how-strip {
    grid-template-columns: repeat(3, 1fr);
  }

  .how-strip li,
  .how-strip li:last-child {
    border-right: 1px solid rgb(24 24 23 / 0.45);
    border-bottom: 0;
  }

  .how-strip li:last-child {
    border-right: 0;
  }

  .mode-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-ribbon {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .stat-ribbon > div,
  .stat-ribbon > div:nth-child(even) {
    border-right: 1px solid rgb(255 255 255 / 0.35);
    border-bottom: 0;
  }

  .stat-ribbon > div:last-child {
    border-right: 0;
  }

  .clue-equation {
    grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  }

  .clue-card {
    min-height: 190px;
  }

  .clue-operator {
    height: auto;
  }

  .room-stat-ribbon {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 940px) {
  .dashboard-grid {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
    align-items: stretch;
  }

  .landing-screen {
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.75fr);
    column-gap: clamp(3rem, 7vw, 7rem);
  }

  .hero-copy h1 {
    font-size: clamp(5.4rem, 8.7vw, 7.7rem);
  }

  .editorial-band {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.75fr);
    align-items: end;
    gap: clamp(3rem, 8vw, 8rem);
  }

  .game-layout {
    grid-template-columns: minmax(0, 2.15fr) minmax(260px, 0.85fr);
  }

  .room-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(290px, 0.8fr);
  }

  .room-game-layout {
    grid-template-columns: minmax(0, 2fr) minmax(250px, 0.72fr);
  }

  .history-panel,
  .scoreboard-panel {
    align-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
