:root {
  color-scheme: dark;
  --ink: #f5f2e8;
  --muted: #a6afbf;
  --panel: #1b2230;
  --panel-soft: #232c3d;
  --well: #111722;
  --line: #354052;
  --gold: #ffc83d;
  --gold-dark: #b87b18;
  --violet: #a38aff;
  --teal: #62d5cc;
  --danger: #ff7c77;
  --mono: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  background: #111722;
  color: var(--ink);
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  min-height: 100vh;
  background:
    url("/background-grain.svg") repeat,
    radial-gradient(ellipse at 50% 0, #202a39, #111722 70%);
  background-blend-mode: soft-light, normal;
  -webkit-user-select: none;
  user-select: none;
}
/* Editing, troubleshooting, and inspecting player data remain copyable. */
input:is(
  :not([type]),
  [type="text"],
  [type="email"],
  [type="password"],
  [type="search"],
  [type="number"],
  [type="url"],
  [type="tel"]
),
textarea,
[contenteditable]:not([contenteditable="false"]),
.selectable,
.notice-error,
.admin-shell .notice,
.technical-grid,
.implementation-note,
.controls-help p,
.admin-shell table,
#detail-profile,
#detail-title,
.storage-details,
#restore-summary,
pre,
code {
  -webkit-user-select: text;
  user-select: text;
}
button,
a,
summary,
label,
img,
svg,
[contenteditable="false"] {
  -webkit-user-select: none;
  user-select: none;
}
button,
input {
  font: inherit;
}
button {
  color: inherit;
}
:where(a[href], button, input, select, textarea, summary, [tabindex]):focus-visible,
:root[data-focus-input="keyboard"]
  :where(a[href], button, input, select, textarea, summary, [tabindex]):not(
    main,
    dialog,
    .notice
  ):focus {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
:focus:not(:focus-visible),
:root[data-focus-input="pointer"] :focus,
:where(html, body, main, dialog, .notice):focus {
  outline: none;
}
.skip-link {
  position: fixed;
  top: 10px;
  left: 20px;
  z-index: 20;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--gold);
  color: var(--well);
  font-weight: 700;
  transform: translateY(-200%);
}
.skip-link:focus {
  transform: translateY(0);
}
.shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: auto;
  display: flex;
  flex-direction: column;
}
.site-header {
  min-height: 80px;
  padding-block: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
}
.header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  gap: 10px;
  margin-inline-start: auto;
}
.site-header .button {
  min-height: 44px;
}
.brand {
  color: var(--ink);
  display: flex;
  gap: 11px;
  align-items: center;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-mark {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 auto;
}
.icon {
  display: inline-block;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.nav-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.nav-icon {
  display: none;
}
.nav-username {
  max-width: 20ch;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  unicode-bidi: isolate;
  color: var(--muted);
  font-size: 14px;
}
/* Native selector keeps every language discoverable by its own name. */
.language-selector {
  position: relative;
  margin: 0;
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  color: var(--muted);
}
.language-selector select {
  appearance: none;
  field-sizing: content;
  width: auto;
  min-width: 128px;
  max-width: 184px;
  height: 44px;
  margin: 0;
  padding-block: 10px;
  padding-inline: 38px 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--well);
  color-scheme: dark;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  text-overflow: ellipsis;
  transition:
    background 0.15s,
    border-color 0.15s;
}
/* Native popups can use a light system background instead of the control's. */
.language-selector option {
  background: var(--well);
  color: var(--ink);
}
.language-selector .icon {
  position: absolute;
  top: 12px;
  width: 20px;
  height: 20px;
  pointer-events: none;
}
.language-icon {
  inset-inline-start: 12px;
}
.language-chevron {
  inset-inline-end: 8px;
}
.language-selector:focus-within .language-icon {
  color: var(--teal);
}
.button {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 11px 18px;
  background: var(--gold);
  color: #302108;
  font-weight: 750;
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s,
    border-color 0.15s;
}
.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.button-small {
  padding: 9px 14px;
}
.button-block {
  width: 100%;
  margin-top: 16px;
}
.button-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
main {
  flex: 1;
}
.loading-view {
  min-height: 500px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  color: var(--muted);
  text-align: center;
}
.loading-view p {
  margin: 0;
}
.loading-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-view > * {
  animation: loading-reveal 0.15s 0.15s both;
}
.loading-view .loading-spinner {
  animation:
    loading-reveal 0.15s 0.15s both,
    spin 0.8s linear infinite;
}
@keyframes loading-reveal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.home {
  min-height: 510px;
  padding: 56px 0 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.home h1,
.game-heading h1,
.auth-card h1 {
  margin: 0;
  letter-spacing: -0.045em;
  line-height: 1.1;
}
.home h1 {
  font-size: clamp(42px, 7vw, 64px);
}
.home-greeting {
  color: var(--muted);
  font-size: 15px;
  margin: 16px 0 8px;
  line-height: 1.5;
}
.home-signup {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
}
.text-link,
.form-switch button,
.back-button {
  border: 0;
  background: none;
  cursor: pointer;
}
.text-link,
.form-switch button {
  color: var(--violet);
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.eyebrow {
  color: var(--gold);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin: 0 0 15px;
}
.auth-layout {
  padding: 32px 0 60px;
}
.back-button {
  color: var(--muted);
  min-height: 44px;
  padding: 0 10px;
  margin: 0 0 20px -10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.back-button .icon {
  width: 18px;
  height: 18px;
}
.card {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 18px;
}
.auth-card {
  max-width: 470px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 42px);
}
.auth-card h1 {
  font-size: 36px;
}
.auth-symbol {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid #62d5cc40;
  border-radius: 12px;
  background: #62d5cc0b;
  color: var(--teal);
  margin-bottom: 22px;
}
.account-note {
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.account-note summary {
  cursor: pointer;
}
.account-note p {
  margin-bottom: 0;
}
.muted {
  color: var(--muted);
  line-height: 1.55;
}
label {
  display: block;
  margin: 21px 0 7px;
  font-size: 13px;
  font-weight: 700;
}
label span {
  color: var(--muted);
  font-weight: 500;
}
input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--well);
  color: var(--ink);
  padding: 13px 14px;
}
input:focus {
  border-color: var(--gold);
}
.password-field {
  position: relative;
}
.password-field input {
  padding-right: 68px;
}
.password-toggle {
  position: absolute;
  inset: 3px 3px 3px auto;
  min-width: 58px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.password-toggle:hover {
  color: var(--gold);
  background: var(--panel-soft);
}
.field-hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
.form-switch {
  color: var(--muted);
  text-align: center;
  font-size: 14px;
  margin: 23px 0 0;
}
.notice {
  padding: 11px 13px;
  margin: 17px 0;
  border-radius: 8px;
  font-size: 14px;
}
.notice-error {
  color: #ffdad5;
  border: 1px solid #7d484c;
  background: #36232e;
}
.notice-offline {
  color: #ffe4a6;
  border: 1px solid #80652c;
  background: #332b1d;
}
.game {
  padding: 24px 0 30px;
  max-width: 1000px;
  margin: auto;
}
.connection {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  padding: 8px 2px;
  white-space: nowrap;
}
.connection-label {
  color: var(--muted);
  font-size: 11px;
}
#ping {
  direction: ltr;
  unicode-bidi: isolate;
  width: 9ch;
  min-width: 9ch;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  font: 12px var(--mono);
  font-variant-numeric: tabular-nums;
}
.connection-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--teal);
}
.connection.is-loading {
  color: var(--muted);
}
.connection.is-error {
  color: var(--danger);
}
.connection.is-loading .connection-dot {
  background: var(--gold);
}
.connection.is-error .connection-dot {
  background: var(--danger);
}
.connection.is-limited {
  color: #ffab68;
}
.connection.is-limited .connection-dot {
  background: #ffab68;
}
.play-layout {
  display: grid;
  gap: 12px;
}
.counter-card {
  text-align: center;
  min-width: 0;
}
.counter-card[aria-busy="true"] {
  opacity: 0.7;
}
.counter-label {
  margin: 0;
  color: var(--muted);
  font: 11px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.counter-value {
  margin: 6px 0 0;
  font-size: clamp(48px, 8vw, 68px);
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.counter-total {
  position: relative;
  unicode-bidi: isolate;
}
.pending-count {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 9px;
  border-radius: 99px;
  color: var(--gold);
  background: #ffc83d12;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
/* The canvas renders one solid. The transparent native button supplies focus,
   keyboard activation, and a hit surface projected with the same camera. */
.button-stage {
  position: relative;
  width: min(340px, 100%);
  height: 240px;
  margin: 6px auto 24px;
  display: grid;
  place-items: center;
  perspective: 850px;
}
.button-scene {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  visibility: hidden;
}
.button-power {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}
.outlet-shadow {
  fill: #080c13;
  filter: drop-shadow(2px 5px 5px #0009);
}
.outlet-plate {
  fill: #303846;
  stroke: #687281;
  stroke-width: 1;
}
.outlet-inset {
  fill: #202733;
  stroke: #141b25;
}
.outlet-socket {
  fill: #39424d;
  stroke: #59636e;
}
.outlet-screw {
  fill: #92999e;
}
.outlet-screw-slot {
  stroke: #232a33;
  stroke-width: 1;
}
.outlet-slots {
  fill: none;
  stroke: #090e16;
  stroke-width: 3;
  stroke-linecap: round;
}
.outlet-ground {
  fill: #090e16;
}
.outlet-led {
  fill: var(--teal);
  filter: drop-shadow(0 0 3px #62d5cc99);
}
.power-cord {
  fill: none;
  stroke-linecap: round;
}
.cord-shadow {
  stroke: #080c13;
  stroke-width: calc(12px * var(--cord-scale, 1));
  transform: translate(2px, 4px);
  filter: blur(2px);
  opacity: 0.65;
}
.cord-body {
  stroke: #080d15;
  stroke-width: calc(8px * var(--cord-scale, 1));
}
.cord-highlight {
  stroke: #48515d;
  stroke-width: calc(2px * var(--cord-scale, 1));
  transform: translate(-1px, -1px);
  opacity: 0.7;
}
.plug-grommet {
  fill: #080d15;
  stroke: #59636e;
  stroke-width: 1.5;
}
.plug-body {
  fill: #151c26;
  stroke: #505967;
  stroke-width: 1;
}
.plug-ridges {
  fill: none;
  stroke: #343e4c;
  stroke-width: 1.5;
}
.button-stage.is-rendered .button-scene {
  visibility: visible;
}
.game .button-stage {
  width: min(680px, 100%);
  height: clamp(290px, 35vh, 370px);
  margin: 10px auto 12px;
}
.game .button-rig {
  width: clamp(260px, 42vw, 420px);
  max-width: 78%;
}
.game .button-label {
  font-size: clamp(38px, 5vw, 60px);
}
.button-rig {
  position: relative;
  width: 260px;
  max-width: 88%;
  aspect-ratio: 65 / 36;
  transform-style: preserve-3d;
  transform: translate3d(var(--shift-x, 0px), var(--shift-y, 0px), var(--lift, 0px))
    rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(var(--button-pop, 1));
}
.click-button {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 11% / 20%;
  padding: 0;
  background: linear-gradient(135deg, #ffe094, #ffc83d);
  color: #432d0d;
  transform: translateZ(calc(18px - var(--press, 0) * 24px));
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.button-stage:not(.is-rendered) .click-button {
  background: linear-gradient(
    120deg,
    color-mix(in srgb, #ffe094, #bc633b calc(var(--copper, 0) * 100%)) 4%,
    color-mix(in srgb, #ffdc7c, #f8c09a calc(var(--copper, 0) * 100%)) 28%,
    color-mix(in srgb, #ffd367, #e99b6d calc(var(--copper, 0) * 100%)) 34%,
    color-mix(in srgb, #ffc83d, #c57245 calc(var(--copper, 0) * 100%)) 64%,
    color-mix(in srgb, #ffca44, #efb78c calc(var(--copper, 0) * 100%))
  );
  box-shadow:
    inset 0 2px 4px rgb(255 241 220 / calc(var(--copper, 0) * 0.73)),
    inset 0 -1px 2px rgb(67 45 13 / calc(var(--copper, 0) * 0.3));
}
.button-stage:not(.is-rendered) .click-button::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: url("/button-material.svg") center / 100% 100% no-repeat;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.button-stage:not(.is-rendered) .click-button::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: color-mix(in srgb, var(--glow-color, #38b875), white 20%);
  mask: url("/button-glow.svg") center / 100% 100% no-repeat;
  opacity: calc(var(--glow-intensity, 0) * 1.8);
  pointer-events: none;
}
.button-label {
  position: relative;
  z-index: 1;
  display: block;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: -0.035em;
  pointer-events: none;
  transform: translateY(var(--label-shift, 0px))
    scale(var(--label-scale-x, 1), var(--label-scale-y, 1));
  color: color-mix(
    in srgb,
    color-mix(
      in srgb,
      color-mix(in srgb, #684d1f, #214b34 calc(var(--copper, 0) * 100%)),
      var(--glow-color, #38b875) calc(var(--label-ink, 0) * 100%)
    ),
    #fff2b8 calc(var(--label-light, 0) * 100%)
  );
  -webkit-text-stroke: calc(0.25px + var(--label-charge, 0) * 0.2px) #432d0d;
  text-shadow:
    0 0 calc(var(--label-light, 0) * 8px) #fff2b8,
    -0.5px -0.5px 0 #fff0b4aa,
    0 1px 0 #b88d34,
    1px 2px 0 #604414,
    2px 3px 1px #35230ccc;
}
.button-stage.is-rendered .click-button {
  background: transparent;
}
.button-stage.is-rendered .button-label {
  opacity: 0;
}
.click-button:focus-visible,
:root[data-focus-input="keyboard"] .click-button:focus {
  outline-offset: 5px;
}
.click-button:disabled {
  cursor: wait;
}
.button-stage:has(.click-button:disabled) .button-scene {
  opacity: 0.65;
}
.button-effects {
  position: absolute;
  inset: -20px 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}
.click-particle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--spark-color, var(--gold));
  box-shadow: 0 0 5px var(--spark-color, var(--gold));
}
.last-click {
  color: var(--muted);
  font: 11px/1.5 var(--mono);
  margin: 0;
}
.refresh-counter {
  width: 44px;
}
.retry-game {
  margin: 0 0 16px;
}
.streak-panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px 18px;
  min-width: 0;
}
.streak-heading {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.streak-heading h2 {
  font-size: 11px;
  margin: 0;
  font-weight: 500;
}
.time-zone {
  font: 9px var(--mono);
  color: var(--muted);
}
.streak-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 20px;
}
.streak-card {
  display: flex;
  align-items: center;
  gap: 6px;
}
.streak-icon {
  display: flex;
  color: var(--violet);
}
.streak-icon .icon {
  width: 15px;
  height: 15px;
}
.streak-card:nth-child(2) .streak-icon {
  color: var(--teal);
}
.streak-card:nth-child(3) .streak-icon {
  color: var(--gold);
}
.streak-card div {
  display: flex;
  align-items: baseline;
  gap: 4px;
}
.streak-card strong {
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.streak-card div span {
  color: var(--muted);
  font-size: 11px;
}
.technical-notes {
  max-width: 1000px;
  margin: 20px 0 0;
  border-block: 1px solid var(--line);
}
.technical-notes > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  padding: 19px 0;
  font-size: 13px;
}
.technical-notes > summary::-webkit-details-marker {
  display: none;
}
.technical-notes > summary::after {
  content: "+";
  margin-left: auto;
  font: 18px var(--mono);
  color: var(--gold);
}
.technical-notes[open] > summary::after {
  content: "−";
}
.technical-notes > summary .icon {
  width: 18px;
  height: 18px;
}
.technical-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 40px;
  padding: 6px 0 22px;
}
.technical-grid h2 {
  color: var(--ink);
  font-size: 13px;
  margin: 0 0 8px;
  font-weight: 650;
}
.technical-grid p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
  margin: 0;
}
.implementation-note {
  color: var(--muted);
  font: 10px/1.8 var(--mono);
  margin: 0 0 22px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.implementation-note .icon {
  width: 17px;
  height: 17px;
}
footer {
  min-height: 54px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 12px;
}
footer span:first-child {
  color: var(--muted);
}
footer a {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 5px 10px 3px;
  border: 1px solid #ffc83d38;
  border-radius: 99px;
  background: #ffc83d08;
  color: #d4bd87;
  font: 10px/1 var(--mono);
  letter-spacing: 0.035em;
  text-decoration: none;
  transition:
    color 0.15s,
    border-color 0.15s,
    background 0.15s;
}
.noscript-notice {
  position: fixed;
  inset: 16px;
  z-index: 10;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 24px;
  border: 1px solid var(--danger);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  text-align: center;
}
@media (hover: hover) {
  .language-selector:hover select {
    border-color: var(--muted);
    background: var(--panel);
  }
  .button:not(:disabled):hover {
    background: #ffdb72;
  }
  .button-quiet:not(:disabled):hover {
    background: var(--panel-soft);
  }
  .text-link:hover,
  .form-switch button:hover,
  .back-button:hover {
    color: var(--gold);
  }
  .counter-action-button:not(:disabled):hover {
    color: var(--ink);
    background: #f5f2e80a;
  }
  footer a:hover {
    border-color: #ffc83d70;
    background: #ffc83d12;
    color: var(--gold);
  }
}
@media (max-width: 600px) {
  .shell {
    width: calc(100% - 28px);
  }
  .site-header {
    min-height: 72px;
    align-items: flex-start;
  }
  .header-actions {
    flex-basis: 100%;
    gap: 7px;
  }
  .language-selector {
    margin-inline-end: auto;
  }
  .connection-label {
    max-width: 18ch;
    white-space: normal;
  }
  .nav-username {
    display: none;
  }
  .nav-actions {
    gap: 7px;
  }
  .nav-actions .button {
    padding: 9px 10px;
    font-size: 13px;
  }
  .nav-actions .nav-icon {
    display: block;
    width: 22px;
    height: 22px;
  }
  .nav-actions .button:has(.nav-icon) {
    padding: 10px;
    min-width: 44px;
    min-height: 44px;
  }
  .nav-actions .nav-label {
    display: none;
  }
  .home {
    min-height: 475px;
    padding: 36px 0 24px;
  }
  .game {
    padding: 22px 0;
  }
  .connection {
    padding: 8px 2px;
    gap: 6px;
  }
  #ping {
    font-size: 11px;
  }
  .button-stage {
    height: 215px;
  }
  .button-rig {
    max-width: 83%;
  }
  .game .button-stage {
    height: 290px;
  }
  .streak-panel {
    gap: 8px;
  }
  .streak-grid {
    gap: 12px;
  }
  .technical-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}
@media (max-width: 360px) {
  .site-header {
    gap: 10px;
  }
  .brand {
    gap: 8px;
    font-size: 14px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  .site-header .button {
    padding: 9px 8px;
    font-size: 12px;
    line-height: 18px;
    white-space: nowrap;
  }
}

.options-button,
.sound-toggle {
  display: grid;
  place-items: center;
  padding: 10px;
  min-height: 44px;
  min-width: 44px;
}
.options-button .icon,
.sound-toggle .icon {
  width: 21px;
  height: 21px;
}
.sound-toggle {
  color: var(--muted);
}
.sound-toggle[aria-pressed="true"] {
  color: var(--teal);
  border-color: var(--teal);
}
.sound-toggle[aria-pressed="false"] .sound-waves,
.sound-toggle[aria-pressed="true"] .sound-muted {
  display: none;
}
.motion-shortcut {
  display: grid;
  place-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 10px;
  color: var(--muted);
}
.motion-shortcut .icon {
  width: 20px;
  height: 20px;
}
.local-badge {
  color: var(--teal);
  font: 12px var(--mono);
}
.local-mode-note {
  color: var(--teal);
  font-size: 12px;
  margin: -6px 0 20px;
  line-height: 1.6;
}

.click-button {
  -webkit-touch-callout: none;
}
.score-effects {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}
.click-bonus {
  position: absolute;
  display: grid;
  justify-items: center;
  gap: 1px;
  color: #ffe3a0;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 3px #0008;
  transform: translate(-50%, -115%);
  white-space: nowrap;
}
.click-bonus strong {
  font-size: 26px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.04em;
}
.click-bonus small {
  font: 9px/1.5 var(--mono);
  letter-spacing: 0;
  opacity: 0.8;
}
.click-bonus[data-state="saved"] {
  color: #59abf0;
}
.click-bonus[data-state="fast"] {
  color: var(--teal);
}
.click-bonus[data-state="error"] {
  color: var(--danger);
}
.counter-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 16px;
  margin-top: 10px;
}
.counter-actions .connection {
  min-height: 44px;
  box-sizing: border-box;
}
.counter-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    color 0.15s,
    background 0.15s;
}
.counter-action-button .icon {
  width: 19px;
  height: 19px;
}
.counter-action-button:disabled {
  opacity: 1;
  color: var(--muted);
  cursor: default;
}
.share-stats {
  gap: 7px;
  padding-inline: 12px;
  font-size: 12px;
}
.controls-help > summary {
  min-height: 44px;
  margin: 0;
  padding: 12px 0;
  font-size: 12px;
}
.controls-help {
  font-size: 12px;
  color: var(--muted);
}
.controls-help summary {
  cursor: pointer;
  list-style: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.controls-help p {
  text-align: left;
  line-height: 1.7;
  margin: 4px 0 14px;
}
.options-dialog {
  overscroll-behavior: contain;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 26px;
  width: min(560px, calc(100% - 28px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}
.options-dialog::backdrop {
  background: #080d17c9;
}
body:has(.options-dialog[open]) {
  overflow: hidden;
}
.options-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: -26px;
  z-index: 2;
  background: var(--panel);
  margin: -26px -26px 0;
  padding: 20px 26px;
  border-bottom: 1px solid var(--line);
}
.options-heading h1 {
  margin: 0;
  font-size: 27px;
}
.options-dialog h2 {
  margin: 0 0 8px;
  font-size: 17px;
}
#options-dialog {
  width: min(1040px, calc(100% - 32px));
}
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
  padding-top: 24px;
}
.options-section {
  min-width: 0;
}
.options-section > h2:not(:first-child) {
  margin-top: 28px;
}
.options-attribution {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.options-attribution a {
  color: var(--violet);
}
.options-dialog .technical-grid h2 {
  font-size: 13px;
}
#options-dialog > .controls-help {
  margin-top: 20px;
}
.options-dialog .muted {
  font-size: 13px;
}
select {
  width: 100%;
  padding: 12px;
  color: var(--ink);
  background: var(--well);
  border: 1px solid var(--line);
  border-radius: 9px;
  font: inherit;
}
.replace-local {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}
.replace-local input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.local-save-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}
.local-save-actions .button {
  font-size: 12px;
}
.import-local {
  position: relative;
  margin: 0;
  cursor: pointer;
  overflow: hidden;
}
.import-local input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  padding: 0;
}
:root:not([data-focus-input="pointer"]) .import-local:has(input:focus-visible),
:root[data-focus-input="keyboard"] .import-local:has(input:focus) {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}
#options-status {
  color: var(--teal);
  border: 1px solid #62d5cc66;
}
#options-status.notice-error {
  color: var(--danger);
  border-color: #ff7c7766;
}
@media (max-width: 600px) {
  #guest-nav [data-view="signup"] {
    display: none;
  }
  .options-button {
    padding: 8px;
  }
  .options-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .options-dialog {
    padding: 20px;
  }
  .options-heading {
    top: -20px;
    margin: -20px -20px 0;
    padding: 16px 20px;
  }
  .local-badge {
    display: none;
  }
}
:root[data-reduced-motion="true"] *,
:root[data-reduced-motion="true"] *::before,
:root[data-reduced-motion="true"] *::after {
  scroll-behavior: auto !important;
  transition: none !important;
  animation: none !important;
}
:root[data-reduced-motion="true"] .loading-spinner {
  border-color: var(--gold);
}

.share-status {
  min-height: 1.5em;
  margin: 8px 0 0;
  color: var(--teal);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.35s;
}
.share-status[data-visible="true"] {
  opacity: 1;
}
.share-dialog textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--well);
  color: var(--ink);
  font: 13px/1.7 var(--mono);
}
.share-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
}
.share-options legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 12px;
}
.share-options label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  width: max-content;
  min-height: 44px;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}
.share-options input[type="checkbox"] {
  appearance: auto;
  width: 18px;
  min-width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  background: transparent;
  accent-color: var(--gold);
}
.share-data-note {
  margin-bottom: 14px;
}
.share-preview-label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 12px;
}
.share-dialog-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}
@media (max-width: 600px) {
  .share-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.play-status {
  color: #ffab68;
  font: 11px/1.5 var(--mono);
  margin: 8px 0 0;
}
.click-bonus[data-state="limited"] {
  color: #ffab68;
}

.game .button-label:lang(ja) {
  /* Keep the longest translation inside the CSS fallback face. */
  font-size: clamp(26px, 4vw, 48px);
  line-height: 1.25;
  white-space: nowrap;
}
.button-label:lang(ar) {
  letter-spacing: normal;
}
[dir="rtl"] .streak-heading .time-zone {
  margin-left: 0;
  margin-inline-start: auto;
}
.share-dialog[dir="rtl"] textarea {
  text-align: start;
}
[lang="ar"] .counter-label,
[lang="ar"] .last-click,
[lang="ar"] .local-mode-note,
[lang="ar"] .streak-heading h2 {
  letter-spacing: normal;
}
