:root {
  --color-bg: #1f1f21;
  --color-surface: rgba(255, 255, 255, 0.08);
  --color-text: #f3f5f7;
  --color-muted: rgba(243, 245, 247, 0.72);
  --color-border: rgba(255, 255, 255, 0.12);
  --shadow-soft: 0 24px 60px rgba(0, 0, 0, 0.28);
  --radius-lg: 14px;
  --color-accent-main: #98f6ff;
  --color-accent-yellow: #fff478;
  --result-gradient-stop-1: rgba(125, 244, 193, 0.5);
  --result-gradient-stop-2: rgba(110, 236, 215, 0.46);
  --result-gradient-stop-3: rgba(110, 216, 255, 0.44);
  --result-gradient-stop-4: rgba(154, 201, 255, 0.48);
}

/* Normalize-like reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  line-height: 1.15;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  tab-size: 4;
  scroll-behavior: smooth;
  scrollbar-color: rgba(243, 245, 247, 0.42) rgba(255, 255, 255, 0.08);
}

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote,
figure,
dl,
dd {
  margin: 0;
}

body {
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

main {
  display: block;
}

img,
picture,
video,
canvas {
  display: block;
  max-width: 100%;
}

img {
  border-style: none;
}

button,
input,
optgroup,
select,
textarea {
  font: inherit;
  color: inherit;
  margin: 0;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  appearance: button;
}

button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

textarea {
  resize: vertical;
}

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

ul[role="list"],
ol[role="list"] {
  list-style: none;
  padding: 0;
}

a {
  color: inherit;
  text-decoration: none;
  background-color: transparent;
}

[hidden] {
  display: none !important;
}

body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: "Google Sans", "Google Sans Text", "Helvetica Neue", Arial,
    sans-serif;
  position: relative;
  overflow-x: hidden;
  transition: background-color 420ms ease, color 420ms ease;
}

body::after {
  content: "";
  position: fixed;
  inset: -8%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.45;
  background:
    radial-gradient(circle at 18% 24%, rgba(88, 170, 255, 0.13), transparent 24%),
    radial-gradient(circle at 76% 20%, rgba(110, 255, 214, 0.11), transparent 22%),
    radial-gradient(circle at 62% 66%, rgba(255, 118, 177, 0.1), transparent 26%),
    radial-gradient(circle at 34% 74%, rgba(127, 110, 255, 0.09), transparent 24%);
  filter: blur(42px) saturate(115%);
  transition: opacity 420ms ease;
}

body.playing:not(.results)::after {
  opacity: 0;
}

body.playing.returning-home:not(.results)::after {
  opacity: 0.45;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
.results-shell::-webkit-scrollbar {
  width: 12px;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
.results-shell::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
}

html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb,
.results-shell::-webkit-scrollbar-thumb {
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(243, 245, 247, 0.42);
}

html::-webkit-scrollbar-thumb:hover,
body::-webkit-scrollbar-thumb:hover,
.results-shell::-webkit-scrollbar-thumb:hover {
  background: rgba(243, 245, 247, 0.58);
}

.site-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 14px 28px 16px;
  background: transparent;
  color: rgba(243, 245, 247, 0.5);
  transform: translateY(var(--intro-footer-release-offset, 0px));
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    filter 420ms ease;
}

body.playing:not(.results):not(.returning-home) .site-footer,
body.playing.returning-home.revealing-home .site-footer {
  opacity: 0;
  transform: translateY(calc(10px + var(--intro-footer-release-offset, 0px)));
  filter: blur(4px);
  pointer-events: none;
}

body.results > .site-footer {
  opacity: 0;
  pointer-events: none;
}

.site-footer-copy,
.site-footer-version {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.site-footer-nav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
}

.site-footer-nav a {
  color: inherit;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  transition:
    color 160ms ease,
    opacity 160ms ease;
}

.site-footer-nav a:hover {
  color: rgba(243, 245, 247, 0.62);
}

.site-footer-nav a:focus-visible {
  outline: 2px solid rgba(152, 246, 255, 0.45);
  outline-offset: 3px;
}

.content-page {
  min-height: 100vh;
}

.page-shell {
  position: relative;
  z-index: 2;
  width: min(100% - 32px, 920px);
  margin: 0 auto;
  padding: 0 0 32px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 18px;
  padding: 20px 0;
}

.page-brand {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
}

.page-brand-link {
  display: inline-block;
}

.page-brand-link:hover {
  color: var(--color-text);
}

.page-brand-link:focus-visible {
  outline: 2px solid rgba(152, 246, 255, 0.5);
  outline-offset: 4px;
}

.page-card {
  padding: 28px 28px 30px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.page-title {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1.02;
  letter-spacing: -0.01em;
}

.page-lead {
  max-width: 42rem;
  margin-top: 16px;
  color: rgba(243, 245, 247, 0.84);
  font-size: 1.08rem;
  line-height: 1.7;
}

.page-section {
  margin-top: 28px;
}

.page-section h2 {
  margin: 0 0 12px;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.page-section p,
.page-section li,
.page-contact-list li {
  color: rgba(243, 245, 247, 0.84);
  font-size: 1rem;
  line-height: 1.7;
}

.page-section ul,
.page-contact-list {
  margin: 0;
  padding-left: 18px;
}

.page-section li + li,
.page-contact-list li + li {
  margin-top: 6px;
}

.page-contact-list {
  margin-top: 16px;
}

.page-contact-list a,
.page-section a {
  color: #29d1ab;
}

.page-section a.page-inline-link {
  color: var(--color-accent-main);
}

.page-section a.page-inline-link:hover {
  color: #c8fbff;
}

.page-contact-list a:hover,
.page-section a:hover {
  color: #54e6c1;
}

.site-footer-static {
  position: static;
  justify-content: center;
  margin-top: 22px;
  padding: 0;
  color: rgba(243, 245, 247, 0.5);
}

.title {
  position: relative;
  z-index: 3;
  --pull-x: 0px;
  --pull-y: 0px;
  --wiggle-r-x: 0px;
  --wiggle-r-y: 0px;
  --wiggle-g-x: 0px;
  --wiggle-g-y: 0px;
  --wiggle-b-x: 0px;
  --wiggle-b-y: 0px;
  --wiggle-y-x: 0px;
  --wiggle-y-y: 0px;
  margin: 0;
  font-size: 5.5rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.05em;
  margin: 0 0 22px;
  text-align: center;
  isolation: isolate;
  user-select: none;
  pointer-events: none;
}

.intro-lockup {
  position: fixed;
  top: 44%;
  left: 50%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  width: min(100% - 48px, 760px);
  transform: translate(-50%, -50%);
  text-align: center;
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    filter 420ms ease;
}

body.entering-game .intro-note-line,
body.entering-game .intro-lockup,
body.entering-game > .site-footer {
  display: none;
}

body.playing:not(.returning-home) .intro-note-line,
body.playing.returning-home.revealing-home .intro-note-line {
  opacity: 0;
  transform: translate(-50%, -12px);
  filter: blur(4px);
  pointer-events: none;
}

body.playing:not(.returning-home) .intro-lockup,
body.playing.returning-home.revealing-home .intro-lockup {
  opacity: 0;
  transform: translate(-50%, calc(-50% - 12px));
  filter: blur(4px);
  pointer-events: none;
}

.intro-kicker,
.intro-copy,
.enter-cta {
  text-align: center;
}

.intro-note-line {
  position: fixed;
  top: 30px;
  left: 50%;
  z-index: 3;
  transform: translateX(-50%);
  display: block;
  width: max-content;
  max-width: calc(100% - 48px);
  margin: 0;
  color: var(--color-accent-yellow);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
  text-align: center;
  user-select: text;
  transition:
    opacity 420ms ease,
    transform 420ms ease,
    filter 420ms ease;
}

.intro-badge-old {
  color: inherit;
}

.intro-badge-new {
  color: inherit;
}

.intro-kicker {
  margin: 0 0 8px;
  color: var(--color-text);
  font-size: 1.25rem;
  line-height: 1.55;
  user-select: text;
}

.intro-edition {
  margin: -31px 0 18px;
  color: var(--color-accent-main);
  font-size: 0.8rem;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  user-select: text;
}

.intro-copy {
  width: 100%;
  margin: 0 0 60px;
  user-select: text;
}

.intro-copy p {
  margin: 0;
  color: var(--color-text);
  font-size: 1.25rem;
  line-height: 1.55;
  text-wrap: balance;
}

.intro-copy p + p {
  margin-top: 8px;
}

.ui-pill-button {
  min-width: 148px;
  padding: 14px 28px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 6px;
  background: transparent;
  color: var(--color-text);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(8px) saturate(120%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.18);
  transition:
    background-color 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.ui-pill-button:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.ui-pill-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 4px;
}

.enter-cta {
  margin: 0;
  width: min(100%, 286px);
}

.game-shell {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 420ms ease,
    transform 420ms ease;
  transform: translateY(12px);
}

body.playing:not(.results) .game-shell {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

body.playing.returning-home:not(.results) .game-shell {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

body.results .game-shell {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}

.game-hud {
  position: relative;
  z-index: 3;
  display: grid;
  gap: 0;
  padding: 10px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--color-bg);
}

.game-hud-row {
  display: grid;
  align-items: center;
  gap: 24px;
}

.game-hud-row-main {
  grid-template-columns: auto 1fr;
  position: relative;
}

.game-hud-center {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 80px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.game-brand,
.game-stat,
.game-metric {
  margin: 0;
}

.game-brand {
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
  color: var(--color-text);
  text-align: center;
}

.game-brand-button {
  justify-self: start;
  border-radius: 6px;
  transition:
    background-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.game-brand-button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 4px;
}

.game-stat,
.game-metric {
  color: rgba(243, 245, 247, 0.72);
  font-size: 1rem;
  line-height: 1.3;
}

.game-stat strong,
.game-metric strong {
  color: var(--color-accent-main);
  font-weight: 600;
}

.game-stat-round {
  text-align: center;
}

.game-stat-score {
  text-align: right;
}

.game-stat-score strong {
  color: #ef5c76;
}

.game-metric {
  text-align: center;
}

.game-metric-pair {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.game-metric-separator {
  color: rgba(243, 245, 247, 0.48);
  font-size: 1rem;
  line-height: 1;
}

.game-score-block {
  position: relative;
  display: inline-grid;
  text-align: right;
  justify-self: end;
}

.game-score-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  color: rgba(243, 245, 247, 0.88);
  box-shadow: none;
  cursor: pointer;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.game-score-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(152, 246, 255, 0.34);
  color: var(--color-text);
}

.game-score-toggle:active {
  transform: translateY(1px);
}

.game-score-toggle:focus-visible {
  outline: 2px solid rgba(152, 246, 255, 0.7);
  outline-offset: 3px;
}

.game-score-toggle[aria-expanded="true"] {
  background: rgba(152, 246, 255, 0.12);
  border-color: rgba(152, 246, 255, 0.42);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  color: var(--color-text);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.game-score-toggle strong {
  color: var(--color-accent-main);
  font-weight: 600;
}

.game-score-toggle-icon {
  display: inline-block;
  color: rgba(243, 245, 247, 0.72);
  font-size: 0.8rem;
  line-height: 1;
  transition:
    transform 160ms ease,
    color 160ms ease;
}

.game-score-toggle[aria-expanded="true"] .game-score-toggle-icon {
  transform: rotate(180deg);
  color: var(--color-text);
}

.game-score-panel {
  position: absolute;
  top: calc(100% - 1px);
  right: 0;
  width: 100%;
  min-width: 100%;
  padding: 12px 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  background: rgba(20, 20, 20, 0.84);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.game-score-toggle[aria-expanded="true"] + .game-score-panel {
  border-color: rgba(152, 246, 255, 0.42);
  background: rgba(152, 246, 255, 0.12);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
}

.game-score-list {
  margin: 0 0;
  padding: 0;
  list-style: none;
}

.game-score-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: rgba(243, 245, 247, 0.72);
  font-size: 0.95rem;
}

.game-score-list li + li {
  margin-top: 9px;
}

.game-score-list strong {
  color: var(--color-accent-main);
  font-weight: 600;
}

.game-metric-best-inline {
  justify-self: end;
  text-align: right;
}

.draw-stage {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  background: none;
  overflow: hidden;
}

.perfect-rainbow {
  position: absolute;
  inset: -18%;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  mix-blend-mode: screen;
  background:
    radial-gradient(circle at 22% 28%, rgba(255, 66, 156, 0.98), transparent 20%),
    radial-gradient(circle at 76% 24%, rgba(255, 157, 45, 0.94), transparent 22%),
    radial-gradient(circle at 82% 58%, rgba(255, 241, 59, 0.88), transparent 24%),
    radial-gradient(circle at 58% 76%, rgba(65, 255, 151, 0.86), transparent 22%),
    radial-gradient(circle at 26% 74%, rgba(42, 225, 255, 0.88), transparent 21%),
    radial-gradient(circle at 50% 48%, rgba(120, 88, 255, 0.86), transparent 28%),
    radial-gradient(circle at 42% 42%, rgba(255, 255, 255, 0.34), transparent 34%);
  filter: blur(58px) saturate(185%) contrast(118%);
  transform: rotate(0deg) scale(1.12);
  transition:
    opacity 520ms ease,
    transform 520ms ease;
}

.perfect-rainbow.is-active {
  opacity: 1;
  animation: perfect-rainbow-spin 9s linear infinite;
}

@keyframes perfect-rainbow-spin {
  0% {
    transform: rotate(0deg) scale(1.12);
  }

  50% {
    transform: rotate(180deg) scale(1.22);
  }

  100% {
    transform: rotate(360deg) scale(1.12);
  }
}

.restart-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10, 10, 12, 0.48);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.restart-dialog {
  width: min(100%, 420px);
  padding: 24px 24px 22px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: none;
  text-align: center;
}

.restart-dialog-kicker {
  margin: 0 0 10px;
  color: var(--color-accent-main);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.restart-dialog-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: min(100%, 286px);
  margin-inline: auto;
}

.restart-dialog-actions button {
  min-width: 0;
  width: 100%;
  padding: 14px 20px;
}

.restart-dialog-actions button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 3px;
}

.draw-canvas {
  width: 100%;
  height: 100%;
  background: none;
  cursor: crosshair;
  touch-action: none;
}

.draw-crosshair {
  display: none;
}

body.input-touch-primary .draw-canvas {
  cursor: default;
}

body.input-touch-primary .draw-crosshair {
  opacity: 0 !important;
}

.mobile-crosshair,
.mobile-controls {
  display: none;
}

.mobile-crosshair {
  position: absolute;
  z-index: 3;
  width: 1px;
  height: 1px;
  pointer-events: none;
}

.mobile-crosshair::before,
.mobile-crosshair::after {
  content: "";
  position: absolute;
  background: rgba(243, 245, 247, 0.68);
}

.mobile-crosshair::before {
  top: 0;
  left: -12px;
  width: 25px;
  height: 1px;
}

.mobile-crosshair::after {
  top: -12px;
  left: 0;
  width: 1px;
  height: 25px;
}

body.handheld-like.playing:not(.results):not(.round-result-open):not(.restart-open) .mobile-crosshair,
body.handheld-like.playing:not(.results):not(.round-result-open):not(.restart-open) .mobile-controls {
  display: block;
}

.mobile-controls {
  --mobile-pad-guide-size: 90px;
  --mobile-pad-guide-radius: calc(var(--mobile-pad-guide-size) / 2);
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 4;
  padding: 0px 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--color-bg);
}

.mobile-controls-row {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.mobile-control-button {
  position: absolute;
  top: 50%;
  min-height: 44px;
  min-width: 0;
  max-width: 170px;
  padding: 12px 16px;
  border: 0;
  background: transparent;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  color: var(--color-accent-main);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  transform: translateY(-50%);
  pointer-events: auto;
}

.mobile-control-button.ui-pill-button,
.mobile-control-button.ui-pill-button:hover,
.mobile-control-button.ui-pill-button:active,
.mobile-control-button.ui-pill-button:focus-visible {
  border: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
}

.mobile-control-button:disabled,
.mobile-control-button[aria-disabled="true"] {
  color: rgba(243, 245, 247, 0.34);
  cursor: default;
  pointer-events: none;
}

.mobile-primary-action {
  left: calc(25% - (var(--mobile-pad-guide-radius) / 2));
  transform: translate(-50%, -50%);
}

.mobile-reset-action {
  left: calc(75% + (var(--mobile-pad-guide-radius) / 2));
  transform: translate(-50%, -50%);
}

.mobile-pad {
  position: relative;
  height: 144px;
  overflow: hidden;
  border-radius: 14px;
  background: transparent;
  touch-action: none;
}

.mobile-pad::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--mobile-pad-guide-size);
  height: var(--mobile-pad-guide-size);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(
      circle,
      rgba(243, 245, 247, 0) 58%,
      rgba(243, 245, 247, 0.08) 68%,
      rgba(243, 245, 247, 0.05) 76%,
      rgba(243, 245, 247, 0.015) 86%,
      rgba(243, 245, 247, 0) 100%
    );
  opacity: 0.85;
  pointer-events: none;
}

.mobile-pad-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-accent-main);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.round-result-layer {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
}

.round-result-user-rect,
.round-result-system-rect {
  position: absolute;
  pointer-events: none;
}

.round-result-user-rect {
  background: linear-gradient(
    124.78deg,
    var(--result-gradient-stop-1) 0%,
    var(--result-gradient-stop-2) 34%,
    var(--result-gradient-stop-3) 66%,
    var(--result-gradient-stop-4) 100%
  );
}

.round-result-system-rect {
  background-size: 6px 1px, 6px 1px, 1px 6px, 1px 6px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-image:
    linear-gradient(to right, #ffffff 50%, transparent 50%),
    linear-gradient(to right, #ffffff 50%, transparent 50%),
    linear-gradient(to bottom, #ffffff 50%, transparent 50%),
    linear-gradient(to bottom, #ffffff 50%, transparent 50%);
  transition:
    left 180ms ease-out,
    top 180ms ease-out,
    width 180ms ease-out,
    height 180ms ease-out;
  animation: marching-ants-rect 5.5s linear infinite;
}

.round-feedback-panel {
  position: relative;
  z-index: 5;
  width: min(100% - 32px, 560px);
  text-align: center;
  pointer-events: auto;
}

.round-feedback-emoji {
  margin: 0 0 12px;
  font-size: 4.5rem;
  line-height: 1;
}

.round-feedback-message {
  margin: 0;
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.round-feedback-signoff {
  display: inline-block;
  margin-top: 12px;
  font-size: 24px;
  font-style: normal;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.round-feedback-score {
  margin: 42px 0 0;
  font-size: 1.2rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
}

.round-feedback-score-value,
.round-feedback-accuracy strong {
  color: var(--color-accent-main);
  font-weight: 600;
}

.round-feedback-score-breakdown {
  margin-left: 6px;
  color: var(--color-text);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.5;
}

.round-feedback-accuracy {
  margin: 10px 0 0;
  color: var(--color-text);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.5;
}

.round-feedback-time {
  margin: 10px 0 0;
  color: var(--color-text);
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.5;
}

.round-feedback-time strong {
  color: var(--color-accent-main);
  font-weight: 600;
}

.round-feedback-action,
.results-dialog-action {
  width: min(100%, 286px);
  min-width: 286px;
  margin-top: 42px;
  font-weight: 700;
  text-align: center;
}

.round-feedback-action:focus-visible,
.results-dialog-action:focus-visible {
  outline-offset: 4px;
}

.results-shell {
  position: fixed;
  inset: 0;
  z-index: 4;
  height: 100dvh;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 48px 24px 24px;
  background: var(--color-bg);
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

body.results .results-shell {
  opacity: 1;
  pointer-events: auto;
}

.results-page {
  width: min(100%, 680px);
  margin: 0 auto;
  text-align: center;
  transition:
    opacity 420ms ease,
    transform 420ms ease;
  transform: translateY(16px);
  opacity: 0;
}

body.results .results-page {
  transform: translateY(0);
  opacity: 1;
}

.results-page-title {
  margin: 10px 0 0;
  font-size: 3rem;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.results-dialog-total,
.results-dialog-best,
.results-dialog-width-accuracy,
.results-dialog-height-accuracy,
.results-dialog-average-time {
  margin: 14px 0 0;
  color: rgba(243, 245, 247, 0.78);
  line-height: 1.55;
}

.results-dialog-total {
  margin-top: 18px;
  font-size: 1.2rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: rgba(243, 245, 247, 0.7);
}

.results-page > .results-dialog-best {
  margin-top: 16px;
  font-size: 1.2rem;
  font-weight: 400;
  color: rgba(243, 245, 247, 0.7);
}

.results-dialog-total strong,
.results-dialog-best strong,
.results-dialog-width-accuracy strong,
.results-dialog-average-width-off strong,
.results-dialog-height-accuracy strong,
.results-dialog-average-height-off strong,
.results-dialog-average-time strong {
  color: var(--color-accent-main);
  font-weight: 600;
}

.results-dialog-total strong {
  display: block;
  margin-top: 8px;
  font-size: 3rem;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.results-page > .results-dialog-best strong {
  font-size: inherit;
  line-height: inherit;
  letter-spacing: inherit;
}

.results-dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(220px, 0.88fr);
  gap: 40px;
  align-items: start;
  margin-top: 46px;
  text-align: left;
}

.results-dialog-rounds,
.results-dialog-stats {
  min-width: 0;
}

.results-dialog-list {
  width: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.results-dialog-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(243, 245, 247, 0.72);
  font-size: 0.88rem;
}

.results-dialog-list li strong {
  color: var(--color-accent-main);
  font-weight: 600;
}

.results-dialog-round-meta {
  display: inline-flex;
  align-items: baseline;
  min-width: 0;
  gap: 0.3em;
}

.results-dialog-round-label {
  color: var(--color-text);
}

.results-dialog-round-size {
  color: rgba(243, 245, 247, 0.5);
}

.results-dialog-list li:first-child {
  border-top: 0;
}

.results-dialog-best,
.results-dialog-width-accuracy,
.results-dialog-average-width-off,
.results-dialog-height-accuracy,
.results-dialog-average-height-off,
.results-dialog-average-time {
  margin-top: 0;
}

.results-dialog-stats {
  display: grid;
  gap: 4px;
  align-content: start;
}

.results-dialog-width-accuracy,
.results-dialog-average-width-off,
.results-dialog-height-accuracy,
.results-dialog-average-height-off,
.results-dialog-average-time {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 0;
  font-size: 0.95rem;
  color: var(--color-text);
}

.results-dialog-height-accuracy,
.results-dialog-average-time {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.results-dialog-width-accuracy strong,
.results-dialog-average-width-off strong,
.results-dialog-height-accuracy strong,
.results-dialog-average-height-off strong,
.results-dialog-average-time strong {
  flex-shrink: 0;
}

.results-dialog-action {
  min-width: 220px;
  margin-top: 58px;
}

.results-socials {
  display: flex;
  justify-content: center;
  justify-items: center;
  margin-top: 36px;
}

.results-projects {
  width: min(100%, 860px);
  margin: 42px auto 0;
  padding-top: 26px;
  border-top: 1px solid rgba(243, 245, 247, 0.08);
}

.results-projects-heading {
  text-align: center;
}

.results-projects-title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.results-projects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-top: 22px;
}

.results-project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  color: var(--color-text);
  text-decoration: none;
  overflow: hidden;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.results-project-card::before,
.results-project-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.results-project-card:hover {
  border-color: rgba(152, 246, 255, 0.3);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.22);
  transform: none;
}

.results-project-card:focus-visible {
  outline: 2px solid rgba(152, 246, 255, 0.7);
  outline-offset: 3px;
}

.results-project-card > * {
  position: relative;
  z-index: 1;
}

.results-project-card-name {
  color: var(--color-text-strong);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.results-project-card-brand {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
}

.results-project-card-brand-centered {
  justify-content: center;
  width: 100%;
}

.results-project-card-brand-nuoy {
  justify-content: center;
  width: 100%;
  gap: 8px;
}

.results-project-card-logo {
  display: block;
  width: auto;
  height: 24px;
}

.results-project-card-logo-nuoy {
  height: 26px;
}

.results-project-card-brand-invista .results-project-card-logo {
  filter: invert(1);
}

.results-project-card-copy {
  max-width: 28ch;
  color: rgba(243, 245, 247, 0.76);
  font-size: 1rem;
  line-height: 1.55;
}

.results-project-card-nuoy::before {
  inset: 0;
  background:
    radial-gradient(circle at 78% 12%, rgba(54, 132, 198, 0.12), transparent 22%),
    radial-gradient(circle at 14% 100%, rgba(4, 76, 30, 0.32), transparent 54%),
    linear-gradient(155deg, rgba(1, 8, 20, 0.99) 0%, rgba(9, 48, 92, 0.95) 42%, rgba(4, 28, 62, 0.84) 100%);
}

.results-project-card-nuoy::after {
  inset: -12% auto -12% -52%;
  width: 48%;
  opacity: 0.34;
  background:
    linear-gradient(
      90deg,
      rgba(103, 215, 255, 0) 0%,
      rgba(103, 215, 255, 0.06) 18%,
      rgba(103, 215, 255, 0.22) 48%,
      rgba(103, 215, 255, 0.06) 82%,
      rgba(103, 215, 255, 0) 100%
    );
  transform: skewX(-18deg);
  will-change: transform;
  animation: nuoy-card-scan 6.5s ease-in-out infinite;
}

.results-project-card-invista {
  border-color: rgba(255, 255, 255, 0.12);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@keyframes nuoy-card-scan {
  0% {
    transform: translateX(0) skewX(-18deg);
  }

  48% {
    transform: translateX(335%) skewX(-18deg);
  }

  100% {
    transform: translateX(335%) skewX(-18deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .results-project-card-nuoy::before,
  .results-project-card-nuoy::after {
    animation: none;
  }
}

.results-footer {
  margin-top: 44px;
  color: rgba(243, 245, 247, 0.5);
}

.results-footer .site-footer-copy,
.results-footer .site-footer-version {
  color: inherit;
}

.results-footer .site-footer-nav a {
  color: inherit;
  opacity: 1;
}

.results-footer .site-footer-nav a:hover {
  color: rgba(243, 245, 247, 0.62);
  opacity: 1;
}

.results-socials-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.results-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  padding: 10px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--color-text);
  text-decoration: none;
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.results-social-link:hover {
  background: transparent;
  box-shadow: none;
  transform: none;
}

.results-social-link:focus-visible {
  outline: 2px solid rgba(152, 246, 255, 0.7);
  outline-offset: 3px;
}

.results-social-link-icon {
  min-width: 0;
  width: 54px;
  height: 54px;
  padding: 0;
  border-radius: 14px;
}

.results-social-link-icon img {
  display: block;
  width: 22px;
  height: 22px;
}

.results-socials-kofi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  transition:
    border-color 180ms ease,
    background-color 180ms ease,
    transform 180ms ease;
}

.results-socials-kofi:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  transform: none;
}

.results-socials-kofi:focus-visible {
  outline: 2px solid rgba(152, 246, 255, 0.7);
  outline-offset: 3px;
}

@keyframes marching-ants-rect {
  0% {
    background-position: 0 0, 0 100%, 0 0, 100% 0;
  }

  100% {
    background-position: 40px 0, -40px 100%, 0 -40px, 100% 40px;
  }
}

.title-layer,
.title-underlay,
.title-main {
  display: block;
  grid-area: 1 / 1;
}

.title {
  display: grid;
  place-items: center;
}

.title-main {
  position: relative;
  z-index: 3;
  color: var(--color-text);
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.title-underlay {
  display: none;
}

.title-layer {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 1;
  mix-blend-mode: screen;
  filter: blur(0.6px);
  will-change: transform;
}

.title-layer-r {
  color: #fb203b;
  mix-blend-mode: normal;
  transform: translate(
    calc(-1.3px + var(--pull-x) * 0.4 + var(--wiggle-r-x)),
    calc(-0.4px + var(--pull-y) * 0.28 + var(--wiggle-r-y))
  );
}

.title-layer-g {
  color: #39ff14;
  opacity: 0.78;
  transform: translate(
    calc(-0.5px + var(--pull-x) * 0.28 + var(--wiggle-g-x)),
    calc(0.9px + var(--pull-y) * 0.34 + var(--wiggle-g-y))
  );
}

.title-layer-b {
  color: #0c2ffb;
  transform: translate(
    calc(1.4px + var(--pull-x) * 0.46 + var(--wiggle-b-x)),
    calc(-0.5px + var(--pull-y) * 0.32 + var(--wiggle-b-y))
  );
}

.title-layer-y {
  color: #fefc4b;
  opacity: 0.46;
  transform: translate(
    calc(0.5px + var(--pull-x) * 0.26 + var(--wiggle-y-x)),
    calc(0.8px + var(--pull-y) * 0.32 + var(--wiggle-y-y))
  );
}

.pixel-field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.98;
  transition: opacity 420ms ease;
}

body.playing:not(.results) .pixel-field {
  opacity: 0;
}

body.playing.returning-home:not(.results) .pixel-field {
  opacity: 0.98;
}

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

  body,
  body::after,
  .intro-shell,
  .game-shell,
  .enter-cta,
  .game-score-toggle-icon,
  .draw-crosshair,
  .pixel-field,
  .title-layer,
  .game-brand-button,
  .restart-dialog-actions button,
  .round-feedback-action,
  .results-dialog-action {
    transition: none !important;
  }

  .title-layer {
    transform: none;
  }

  .round-result-user-rect {
    animation: none;
  }

  .round-result-system-rect {
    animation: none;
  }
}

@media (min-width: 641px) and (max-width: 960px) {
  .page-shell {
    width: min(100% - 48px, 920px);
    padding-top: 0;
    padding-bottom: 28px;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding-right: 24px;
    padding-left: 24px;
  }

  .site-footer-copy,
  .site-footer-version {
    white-space: normal;
    text-align: center;
  }

  .site-footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
  }

  .title {
    font-size: 5rem;
  }

  .game-hud-row-main {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
  }

  .game-hud-center {
    position: static;
    left: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    justify-self: center;
    width: auto;
    gap: 40px;
    transform: none;
  }

  .game-stat-round {
    text-align: center;
    white-space: nowrap;
  }

  .game-metric-pair {
    white-space: nowrap;
  }

  .round-feedback-panel {
    width: min(100% - 48px, 420px);
  }

  .results-shell {
    padding: 40px 24px 24px;
  }

  .results-page {
    width: min(100%, 760px);
  }

  .results-dialog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .mobile-primary-action {
    left: calc(50% - (var(--mobile-pad-guide-radius) + 100px));
  }

  .mobile-reset-action {
    left: calc(50% + (var(--mobile-pad-guide-radius) + 100px));
  }
}

@media (max-width: 640px) {
  .restart-dialog-backdrop {
    padding: 30px;
  }

  .restart-dialog {
    width: 100%;
    padding: 0;
  }

  .page-shell {
    width: min(100% - 60px, 920px);
    padding-top: 0;
    padding-bottom: 30px;
  }

  .page-header {
    padding: 18px 0 16px;
    justify-content: flex-start;
    margin-bottom: 22px;
  }

  .page-card {
    padding: 24px 22px 26px;
    border-radius: 16px;
  }

  .page-lead,
  .page-section p,
  .page-section li,
  .page-contact-list li {
    font-size: 0.98rem;
  }

  .site-footer {
    flex-wrap: wrap;
    gap: 10px 16px;
    padding-right: 30px;
    padding-left: 30px;
  }

  .site-footer-copy,
  .site-footer-version {
    white-space: normal;
    text-align: center;
  }

  .site-footer-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 14px;
  }

  .intro-lockup {
    top: 42%;
    width: min(100% - 60px, 560px);
  }

  .title {
    font-size: min(4.8rem, 17vw);
    margin-bottom: 8px;
  }

  .intro-note-line {
    top: 22px;
    max-width: calc(100% - 60px);
    font-size: 1.08rem;
    font-weight: 500;
    line-height: 1.35;
  }

  .intro-kicker {
    font-size: 1.22rem;
    margin-bottom: 4px;
  }

  .intro-copy {
    max-width: 34rem;
    margin-bottom: 60px;
  }

  .intro-copy p {
    font-size: 1.18rem;
    line-height: 1.5;
    text-wrap: pretty;
  }

  .enter-cta {
    width: 100%;
    min-width: 0;
    max-width: 420px;
    padding: 12px 20px;
    font-size: 1.1rem;
  }

  .game-hud {
    padding: 20px 30px 30px;
  }

  .game-hud-row-main {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "brand score"
      "center center";
    align-items: center;
    gap: 12px;
  }

  .game-brand-button {
    grid-area: brand;
    justify-self: start;
  }

  .game-hud-center {
    grid-area: center;
    position: static;
    left: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    transform: none;
    width: 100%;
    gap: 18px;
    align-items: center;
  }

  .game-stat-round {
    grid-column: 1;
  }

  .game-metric-pair {
    grid-column: 2;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    justify-self: end;
    gap: 8px;
  }

  .game-metric-separator {
    display: inline;
  }

  .game-metric-width {
    grid-column: auto;
  }

  .game-metric-height {
    grid-column: auto;
  }

  .game-stat-round,
  .game-metric,
  .game-score-block {
    text-align: center;
  }

  .game-stat-round {
    text-align: left;
  }

  .game-brand {
    font-size: 1.65rem;
  }

  .restart-dialog-actions {
    width: 100%;
    max-width: none;
  }

  .restart-dialog-actions button {
    width: 100%;
  }

  .game-score-block {
    grid-area: score;
    width: auto;
    justify-self: end;
  }

  .game-score-toggle {
    justify-content: center;
    width: auto;
  }

  .game-score-panel {
    left: 0;
    right: 0;
    transform: none;
  }

  .round-feedback-panel {
    width: min(100% - 60px, 420px);
  }

  .results-shell {
    padding: 40px 30px 30px;
  }

  .round-feedback-action,
  .results-dialog-action {
    min-width: 0;
    width: 100%;
  }

  .results-page {
    width: 100%;
  }

  .results-dialog-total {
    font-size: 1.18rem;
    line-height: 1.5;
  }

  .results-page > .results-dialog-best {
    font-size: 1.18rem;
    line-height: 1.5;
  }

  .results-dialog-total strong {
    font-size: 2.8rem;
  }

  .results-page-title {
    font-size: 2.8rem;
  }

  .results-dialog-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .results-dialog-list li {
    font-size: 1.02rem;
    padding: 12px 16px;
  }

  .results-dialog-width-accuracy,
  .results-dialog-average-width-off,
  .results-dialog-height-accuracy,
  .results-dialog-average-height-off,
  .results-dialog-average-time {
    font-size: 1.04rem;
    padding: 6px 0;
  }

  .results-socials-links {
    display: inline-flex;
    width: auto;
    align-items: center;
    justify-content: center;
    gap: 36px;
  }

  .results-social-link {
    width: auto;
    min-width: 0;
  }

  .results-socials-kofi {
    width: auto;
    min-height: 40px;
    padding: 0 18px;
    font-size: 0.98rem;
  }

  .results-projects {
    margin-top: 34px;
  }

  .results-projects-title {
    font-size: 1.1rem;
  }

  .results-projects-grid {
    grid-template-columns: 1fr;
  }

  .results-project-card {
    min-height: 0;
    padding: 20px 18px;
    border-radius: 22px;
  }

  .results-project-card-name {
    font-size: 1.34rem;
  }

  .results-project-card-logo {
    height: 22px;
  }

  .results-project-card-logo-nuoy {
    height: 24px;
  }

  .results-project-card-copy {
    max-width: none;
    font-size: 0.96rem;
  }

}
