:root {
  color: #f7f8ff;
  background: #080a12;
  font-family:
    Inter, ui-rounded, "SF Pro Rounded", "SF Pro Display", system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --panel: rgba(25, 29, 48, 0.86);
  --panel-border: rgba(255, 255, 255, 0.09);
  --muted: #9da4bc;
  --board-gap: clamp(4px, 1.5vw, 8px);
}

:root[data-theme="disco"] {
  --panel: rgba(12, 15, 22, 0.9);
  --panel-border: rgba(218, 239, 244, 0.13);
  --muted: #a8afb9;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  min-height: 100dvh;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  background:
    radial-gradient(circle at 50% -10%, rgba(102, 81, 214, 0.3), transparent 42%),
    linear-gradient(180deg, #101326 0%, #080a12 75%);
}

:root[data-theme="disco"] body {
  background-color: #030404;
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.03), rgba(0, 0, 0, 0.2)),
    url("./assets/disco-concrete.png");
  background-position: center, center top;
  background-repeat: no-repeat, repeat;
  background-size: auto, 600px 600px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: -1px;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

button {
  font: inherit;
}

#app {
  width: min(100%, 760px);
  min-height: 100dvh;
  margin: 0 auto;
  padding:
    max(22px, calc(env(safe-area-inset-top) + 12px))
    max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(12px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.game-header {
  min-width: 0;
  flex: 0 0 auto;
}

.game-utility {
  min-width: 0;
  min-height: 44px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.game-utility[hidden] {
  display: none;
}

.game-utility__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}

.game-utility__button {
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 6px 18px rgba(0, 0, 0, 0.22);
  color: #f2f4ff;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(16px);
  display: grid;
  place-items: center;
}

.game-utility__button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.game-utility__button:focus-visible {
  outline: 3px solid white;
  outline-offset: 2px;
}

.dialog-utility {
  min-width: 0;
  min-height: 48px;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dialog-utility[hidden] {
  display: none;
}

.dialog-utility .brand-logo {
  min-width: 0;
  margin: 0;
  padding: 0 2px 2px 0;
  font-size: clamp(1.05rem, 4.7vw, 1.45rem);
  line-height: 1.08;
}

.dialog-utility__actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.coin-balance {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 216, 77, 0.3);
  border-radius: 12px;
  background:
    radial-gradient(circle at 22% 20%, rgba(255, 238, 128, 0.16), transparent 45%),
    var(--panel);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 6px 18px rgba(0, 0, 0, 0.22);
  color: #ffd84d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(16px);
}

.coin-balance svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: rgba(255, 216, 77, 0.22);
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coin-balance strong {
  position: absolute;
  right: -5px;
  bottom: -6px;
  overflow: hidden;
  min-width: 21px;
  max-width: 6ch;
  height: 18px;
  padding: 0 5px;
  border: 2px solid #111426;
  border-radius: 999px;
  background: #ffd84d;
  color: #291e00;
  display: grid;
  place-items: center;
  font-size: 0.56rem;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-shortcut {
  position: relative;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 6px 18px rgba(0, 0, 0, 0.22);
  color: #f2f4ff;
  cursor: pointer;
  touch-action: manipulation;
  backdrop-filter: blur(16px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.leaderboard-shortcut svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.leaderboard-shortcut:active {
  transform: translateY(1px);
}

.leaderboard-shortcut:focus-visible {
  outline: 3px solid white;
  outline-offset: 2px;
}

.utility-rank {
  position: absolute;
  top: -7px;
  right: -6px;
  min-width: 25px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid #111426;
  border-radius: 999px;
  background: #63fff2;
  box-shadow: 0 0 12px rgba(99, 255, 242, 0.46);
  color: #061e1c;
  display: grid;
  place-items: center;
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 950;
}

.utility-rank[hidden] {
  display: none;
}

.hud {
  display: grid;
  grid-template-columns: minmax(64px, 0.78fr) minmax(140px, 1.65fr) minmax(64px, 0.78fr);
  gap: 7px;
  align-items: stretch;
}

.hud-side {
  min-width: 0;
  display: grid;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.stat {
  min-width: 0;
  padding: 6px 5px 5px;
  border: 1px solid var(--panel-border);
  border-radius: 11px;
  background: var(--panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
  text-align: center;
  backdrop-filter: blur(16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.stat__label {
  display: block;
  overflow: hidden;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: clamp(0.5rem, 2vw, 0.64rem);
  font-weight: 700;
  letter-spacing: 0.045em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.stat__value {
  display: flex;
  min-height: 1.35em;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: clamp(0.82rem, 3.5vw, 1.12rem);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat__value--small {
  font-size: clamp(0.7rem, 2.8vw, 0.9rem);
}

.color-hero {
  --player-color: #35e6df;
  position: relative;
  min-width: 0;
  overflow: hidden;
  padding: 9px 8px 10px;
  border: 2px solid color-mix(in srgb, var(--player-color) 72%, white 28%);
  border-radius: 17px;
  background:
    radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--player-color) 24%, transparent), transparent 64%),
    rgba(20, 23, 40, 0.94);
  box-shadow:
    0 0 23px color-mix(in srgb, var(--player-color) 22%, transparent),
    inset 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease;
}

.response-progress {
  position: absolute;
  right: 10px;
  bottom: 3px;
  left: 10px;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.response-progress[hidden] {
  display: none;
}

.response-progress__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 9px rgba(255, 255, 255, 0.28);
  transform: scaleX(0);
  transform-origin: left;
  will-change: transform;
}

.color-hero__label {
  margin-bottom: 5px;
  color: #e8eaff;
  font-size: clamp(0.6rem, 2.3vw, 0.72rem);
  font-weight: 900;
  letter-spacing: 0.13em;
  line-height: 1;
  text-transform: uppercase;
}

.color-value {
  min-width: 0;
  width: max-content;
  display: grid;
  grid-template-columns: clamp(38px, 11vw, 48px) 7ch;
  align-items: center;
  justify-content: center;
  gap: clamp(7px, 2vw, 11px);
  font-size: clamp(1rem, 4.6vw, 1.45rem);
  line-height: 1;
  white-space: nowrap;
}

#color-name {
  width: 7ch;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
}

.color-swatch {
  width: clamp(38px, 11vw, 48px);
  height: clamp(38px, 11vw, 48px);
  flex: 0 0 auto;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  background: #656b7d;
  box-shadow: 0 0 17px var(--player-color);
  display: grid;
  place-items: center;
  font-size: clamp(1rem, 4vw, 1.35rem);
  line-height: 1;
}

.lives {
  color: #ff5370;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(255, 83, 112, 0.45);
}

.lives .lost {
  color: #4f5364;
  text-shadow: none;
}

.game {
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding-top: clamp(6px, 1.2dvh, 10px);
}

.board-shell {
  position: relative;
  width: min(calc(100vw - 24px), calc(100dvh - 252px), 680px);
  aspect-ratio: 1;
  flex: 0 0 auto;
  padding: clamp(7px, 2vw, 11px);
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: clamp(18px, 5vw, 28px);
  background: rgba(5, 7, 14, 0.72);
  box-shadow:
    0 22px 70px rgba(0, 0, 0, 0.46),
    inset 0 1px rgba(255, 255, 255, 0.06);
}

.streak-meter {
  --streak-progress: 0;
  width: min(calc(100vw - 24px), calc(100dvh - 252px), 680px);
  min-height: 50px;
  padding: 7px 11px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(10, 13, 24, 0.8);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.05),
    0 8px 20px rgba(0, 0, 0, 0.2);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 5px;
  gap: 5px 10px;
  backdrop-filter: blur(14px);
}

:root[data-theme="disco"] .streak-meter {
  border-color: rgba(181, 205, 210, 0.17);
  background-color: rgba(7, 8, 8, 0.9);
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.025), rgba(0, 0, 0, 0.15)),
    url("./assets/disco-concrete.png");
  background-size: auto, 340px 340px;
}

.streak-meter__heading {
  min-width: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.streak-meter__heading span {
  overflow: hidden;
  color: #adb4ca;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.streak-meter__heading strong {
  color: #ffe264;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  line-height: 1;
  text-shadow: 0 0 13px rgba(255, 216, 77, 0.42);
}

.streak-meter__track {
  min-width: 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.38);
}

.streak-meter__fill {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #b77bff, #ffd84d);
  box-shadow: 0 0 11px rgba(255, 216, 77, 0.34);
  display: block;
  transform: scaleX(var(--streak-progress));
  transform-origin: left;
  transition: transform 110ms ease-out;
}

.streak-meter__count {
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  color: #8f97ad;
  font-size: 0.6rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

:root[data-theme="disco"] .board-shell {
  border-color: rgba(181, 205, 210, 0.2);
  background-color: #070808;
  background-image:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.13)),
    url("./assets/disco-concrete.png");
  background-position: center;
  background-repeat: repeat;
  background-size: auto, 340px 340px;
  box-shadow:
    0 24px 78px rgba(0, 0, 0, 0.68),
    inset 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 38px rgba(0, 0, 0, 0.5);
}

.board {
  --grid-size: 1;
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
  grid-template-rows: repeat(var(--grid-size), minmax(0, 1fr));
  gap: var(--board-gap);
  touch-action: manipulation;
}

.tile {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: clamp(11px, calc(30px / var(--grid-size)), 22px);
  outline: 0;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.035), transparent 48%),
    #181b2c;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.04),
    inset 0 -12px 30px rgba(0, 0, 0, 0.16);
  color: transparent;
  cursor: pointer;
  font-size: clamp(1.1rem, calc(14vw / var(--grid-size) + 0.7rem), 4.6rem);
  font-weight: 900;
  line-height: 1;
  touch-action: manipulation;
  transition:
    border-color 65ms linear,
    box-shadow 65ms linear,
    transform 65ms ease-out;
}

.tile__glyph {
  position: relative;
  z-index: 1;
  display: inline-block;
  pointer-events: none;
}

:root[data-theme="disco"] .tile {
  isolation: isolate;
  border-color: rgba(217, 232, 234, 0.12);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), transparent 36%, rgba(0, 0, 0, 0.28)),
    #101214;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    inset 0 -16px 34px rgba(0, 0, 0, 0.42),
    0 7px 14px rgba(0, 0, 0, 0.34);
}

:root[data-theme="disco"] .tile::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  border-radius: inherit;
  background-image: url("./assets/disco-tile-overlay.png");
  background-position: center;
  background-size: 200% 200%;
  content: "";
  filter: contrast(1.55) brightness(0.72);
  mix-blend-mode: screen;
  opacity: 0.16;
  pointer-events: none;
}

:root[data-theme="disco"] .tile:nth-child(3n + 2)::before {
  background-position: 65% 35%;
}

:root[data-theme="disco"] .tile:nth-child(3n)::before {
  background-position: 35% 68%;
}

.tile:focus-visible {
  outline: 3px solid white;
  outline-offset: -5px;
}

.tile--lit {
  border-color: color-mix(in srgb, var(--tile-color) 78%, white 22%);
  background: var(--tile-color);
  box-shadow:
    0 0 25px color-mix(in srgb, var(--tile-color) 62%, transparent),
    inset 0 1px rgba(255, 255, 255, 0.4),
    inset 0 -18px 35px rgba(0, 0, 0, 0.14);
  color: var(--tile-ink);
  text-shadow: 0 1px rgba(255, 255, 255, 0.2);
  animation: cell-on 90ms ease-out both;
}

:root[data-theme="disco"] .tile--lit {
  border-color: color-mix(in srgb, var(--tile-color) 62%, white 38%);
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.11) 34%, transparent 64%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.23), transparent 35%, rgba(0, 0, 0, 0.18)),
    var(--tile-color);
  box-shadow:
    0 0 13px color-mix(in srgb, var(--tile-color) 68%, transparent),
    0 0 30px color-mix(in srgb, var(--tile-color) 34%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.34),
    inset 0 0 28px rgba(255, 255, 255, 0.2),
    inset 0 0 34px 7px rgba(22, 17, 21, 0.42);
  animation-name: disco-cell-on;
}

:root[data-theme="disco"] .tile--lit::before {
  filter: contrast(1.45) brightness(0.9);
  opacity: 0.34;
}

.tile:active {
  transform: scale(0.96);
}

@keyframes cell-on {
  from {
    transform: scale(0.93);
  }
  to {
    transform: scale(1);
  }
}

@keyframes disco-cell-on {
  from {
    filter: brightness(1.14);
    transform: scale(0.93);
  }
  to {
    filter: brightness(1);
    transform: scale(1);
  }
}

.feedback {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  padding: 8px 13px;
  border-radius: 999px;
  opacity: 0;
  background: rgba(5, 7, 14, 0.84);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.38);
  color: white;
  font-size: clamp(0.95rem, 4vw, 1.25rem);
  font-weight: 850;
  pointer-events: none;
  transform: translate(-50%, -35%);
}

.feedback--show {
  animation: feedback-pop 520ms ease-out both;
}

.feedback--bad {
  color: #ff8ca0;
}

.speed-rating-overlay {
  --speed-rating-tilt: 0deg;
  position: fixed;
  z-index: 4;
  top: max(142px, calc(env(safe-area-inset-top) + 124px));
  max-width: 44vw;
  padding: 8px 12px;
  border: 2px solid currentColor;
  border-radius: 11px;
  opacity: 0;
  background: rgba(4, 6, 12, 0.84);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  font-size: clamp(1.2rem, 6vw, 1.7rem);
  font-style: italic;
  font-weight: 1000;
  letter-spacing: -0.045em;
  line-height: 1;
  pointer-events: none;
  text-transform: uppercase;
}

.speed-rating-overlay--left {
  --speed-rating-tilt: -6deg;
  left: max(12px, env(safe-area-inset-left));
}

.speed-rating-overlay--right {
  --speed-rating-tilt: 6deg;
  right: max(12px, env(safe-area-inset-right));
}

.speed-rating-overlay--visible {
  animation: speed-rating-pop 620ms ease-out both;
}

.speed-rating-overlay--godlike {
  color: #ffd84d;
  text-shadow: 0 0 15px rgba(255, 216, 77, 0.55);
}

.speed-rating-overlay--perfect {
  color: #c68cff;
  text-shadow: 0 0 15px rgba(198, 140, 255, 0.5);
}

.speed-rating-overlay--great {
  color: #67adff;
  text-shadow: 0 0 15px rgba(103, 173, 255, 0.5);
}

.speed-rating-overlay--good {
  color: #72e995;
  text-shadow: 0 0 15px rgba(114, 233, 149, 0.45);
}

@keyframes speed-rating-pop {
  0% {
    opacity: 0;
    transform: translateY(7px) rotate(var(--speed-rating-tilt)) scale(0.88);
  }
  14%,
  68% {
    opacity: 1;
    transform: translateY(0) rotate(var(--speed-rating-tilt)) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-8px) rotate(var(--speed-rating-tilt)) scale(0.98);
  }
}

@keyframes feedback-pop {
  0% {
    opacity: 0;
    transform: translate(-50%, -20%) scale(0.85);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  78% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -82%) scale(0.98);
  }
}

.overlay {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding:
    max(18px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(18px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
  background: rgba(5, 6, 12, 0.78);
  backdrop-filter: blur(18px);
  transition: opacity 160ms ease;
}

:root[data-theme="disco"] .overlay {
  background-color: rgba(0, 0, 0, 0.18);
  background-image:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.24)),
    url("./assets/disco-concrete.png");
  background-position: center, center top;
  background-repeat: no-repeat, repeat;
  background-size: auto, 480px 480px;
  backdrop-filter: blur(0.5px);
}

.overlay[hidden] {
  display: none;
}

.dialog {
  width: min(100%, 460px);
  max-height: 100%;
  overflow: auto;
  padding: clamp(22px, 6vw, 32px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  background: linear-gradient(155deg, rgba(34, 38, 65, 0.98), rgba(14, 16, 29, 0.98));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.55);
}

:root[data-theme="disco"] .dialog {
  border-color: rgba(185, 211, 217, 0.22);
  background-color: rgba(5, 7, 11, 0.9);
  background-image:
    linear-gradient(155deg, rgba(15, 20, 31, 0.76), rgba(5, 7, 11, 0.86)),
    url("./assets/disco-concrete.png");
  background-position: center;
  background-size: auto, 460px 460px;
  box-shadow:
    0 30px 95px rgba(0, 0, 0, 0.76),
    0 0 30px rgba(63, 232, 241, 0.055);
}

:root[data-theme="disco"] .stat,
:root[data-theme="disco"] .color-hero {
  background-color: rgba(8, 11, 15, 0.91);
}

.brand-logo {
  position: relative;
  width: max-content;
  max-width: 100%;
  margin: 0 0 13px;
  display: inline-flex;
  align-items: center;
  font-size: clamp(1.55rem, 7vw, 2.15rem);
  font-style: italic;
  font-weight: 950;
  letter-spacing: -0.075em;
  line-height: 1;
  filter: drop-shadow(0 0 15px rgba(67, 244, 255, 0.26));
  transform: skewX(-3deg);
}

.brand-logo__speedy {
  background: linear-gradient(105deg, #58fff3 8%, #84ff83 58%, #ffe659 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-logo__tapper {
  background: linear-gradient(105deg, #ffe659 0%, #ff6fc8 48%, #a58aff 100%);
  background-clip: text;
  color: transparent;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-logo__pulse {
  width: 9px;
  height: 9px;
  margin: -18px 0 0 7px;
  border: 2px solid #63fff2;
  border-radius: 50%;
  box-shadow:
    0 0 0 4px rgba(99, 255, 242, 0.13),
    0 0 14px #63fff2;
}

.brand-logo--game {
  margin: 0;
  font-size: clamp(1.1rem, 5vw, 1.45rem);
  filter: drop-shadow(0 0 11px rgba(67, 244, 255, 0.24));
}

.brand-logo--game .brand-logo__pulse {
  width: 7px;
  height: 7px;
  margin: -12px 0 0 5px;
  border-width: 1.5px;
  box-shadow:
    0 0 0 3px rgba(99, 255, 242, 0.11),
    0 0 10px #63fff2;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 3.1rem);
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.dialog__lead {
  margin: 18px 0 14px;
  color: #d6daea;
  font-size: 0.98rem;
  line-height: 1.5;
}

.result-content[hidden],
.main-menu-content[hidden],
.overlay-view[hidden] {
  display: none;
}

.overlay-view {
  display: grid;
  gap: 12px;
}

.view-back-button {
  width: auto;
  min-height: 44px;
  padding: 0 16px;
  justify-self: start;
}

.leaderboard-utility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.result-stats {
  margin: -2px 0 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.result-score {
  margin: -2px 0 12px;
  padding: 12px 14px 13px;
  border: 1px solid rgba(255, 216, 77, 0.3);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 130%, rgba(255, 216, 77, 0.17), transparent 62%),
    linear-gradient(135deg, rgba(87, 255, 243, 0.075), rgba(255, 91, 168, 0.075)),
    rgba(7, 9, 19, 0.5);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.06),
    0 10px 30px rgba(0, 0, 0, 0.18);
  text-align: center;
  display: grid;
  place-items: center;
}

.result-score span,
.result-score small {
  color: #9ca5bc;
  font-size: 0.64rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.result-score strong {
  margin: 2px 0;
  background: linear-gradient(105deg, #58fff3 5%, #ffe659 48%, #ff6fc8 95%);
  background-clip: text;
  color: transparent;
  font-size: clamp(2.35rem, 12vw, 3.35rem);
  font-variant-numeric: tabular-nums;
  font-weight: 1000;
  letter-spacing: -0.055em;
  line-height: 0.95;
  text-shadow: 0 0 28px rgba(99, 255, 242, 0.12);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.result-stats[hidden] {
  display: none;
}

.result-stat {
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(85, 245, 238, 0.28);
  border-radius: 13px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 94, 190, 0.12), transparent 48%),
    rgba(34, 223, 216, 0.065);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.result-stat span {
  overflow: hidden;
  color: #9fa8c1;
  font-size: 0.63rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.result-stat strong {
  overflow: hidden;
  color: #68fff2;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  text-shadow: 0 0 14px rgba(74, 255, 239, 0.32);
  white-space: nowrap;
}

.speed-summary,
.result-save-panel,
.profile-panel {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(7, 9, 19, 0.42);
}

.speed-summary__bar {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.3);
  display: flex;
}

.speed-summary__segment {
  flex: 0 0 0%;
  min-width: 0;
  transition: flex-basis 220ms ease;
}

.speed-summary__segment--godlike {
  background: #ffd84d;
}

.speed-summary__segment--perfect {
  background: #b77bff;
}

.speed-summary__segment--great {
  background: #5b9fff;
}

.speed-summary__segment--good {
  background: #5fd583;
}

.speed-summary__legend {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 10px;
}

.speed-summary__item {
  min-width: 0;
  color: #a5acc1;
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.speed-summary__label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.speed-summary__dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: currentColor;
}

.speed-summary__item--godlike {
  color: #ffd84d;
}

.speed-summary__item--perfect {
  color: #c68cff;
}

.speed-summary__item--great {
  color: #67adff;
}

.speed-summary__item--good {
  color: #72e995;
}

.google-signin {
  min-height: 44px;
  max-width: 100%;
  overflow: hidden;
  border-radius: 999px;
  background: transparent !important;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.google-signin > div,
.google-signin iframe {
  max-width: 100% !important;
  border-radius: 999px !important;
  background: transparent !important;
  color-scheme: light;
}

.google-signin[hidden] {
  display: none;
}

.score-form,
.leaderboard-panel {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(7, 9, 19, 0.42);
}

.score-form[hidden],
.leaderboard-panel[hidden] {
  display: none;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.section-heading span {
  color: #858da8;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.score-form label {
  display: block;
  margin-bottom: 6px;
  color: #b9bfd4;
  font-size: 0.76rem;
  font-weight: 750;
}

.score-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.score-form input {
  min-width: 0;
  min-height: 48px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font: inherit;
  font-size: 16px;
  user-select: text;
}

.score-form input:focus {
  border-color: #9ba5ff;
  box-shadow: 0 0 0 3px rgba(142, 154, 255, 0.16);
}

.score-submit {
  width: auto;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 13px;
}

.result-restart-button {
  min-height: 48px;
  margin-top: 8px;
}

.result-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.score-submit:disabled,
.leaderboard-tab:disabled,
.result-navigation button:disabled {
  cursor: default;
  opacity: 0.58;
}

.form-status,
.leaderboard-status {
  min-height: 1.25em;
  margin: 8px 0 0;
  color: #9da5bf;
  font-size: 0.74rem;
  line-height: 1.35;
}

.form-status.is-error,
.leaderboard-status.is-error {
  color: #ff94a6;
}

.action-stack {
  display: grid;
  gap: 9px;
}

.menu-spacer {
  height: 9px;
}

.mode-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.mode-group legend {
  margin-bottom: 7px;
  padding: 0;
  color: #929ab3;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mode-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
}

.mode-actions button {
  min-width: 0;
  font-size: 0.9rem;
}

.settings-toggle {
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.settings-toggle[aria-expanded="true"] {
  border-color: rgba(92, 238, 242, 0.42);
  background: rgba(71, 221, 228, 0.085);
}

.settings-toggle__value {
  color: #aab2c9;
  font-size: 0.76rem;
  font-weight: 800;
}

.settings-panel {
  min-width: 0;
  margin: 0;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  background: rgba(5, 7, 14, 0.54);
  display: grid;
  gap: 9px;
}

.settings-panel[hidden] {
  display: none;
}

.profile-panel {
  margin: 0;
}

.profile-signed-out h2 {
  margin: 0;
  font-size: 1.15rem;
}

.profile-signed-out p {
  color: #adb4c9;
  font-size: 0.82rem;
  line-height: 1.45;
}

.profile-signed-in[hidden],
.profile-signed-out[hidden] {
  display: none;
}

.profile-form label {
  display: block;
  margin-bottom: 6px;
  color: #b9bfd4;
  font-size: 0.76rem;
  font-weight: 750;
}

.profile-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.profile-form input {
  min-width: 0;
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 13px;
  outline: 0;
  background: rgba(255, 255, 255, 0.07);
  color: white;
  font: inherit;
  font-size: 16px;
  user-select: text;
}

.profile-form input:focus {
  border-color: #9ba5ff;
  box-shadow: 0 0 0 3px rgba(142, 154, 255, 0.16);
}

.profile-form button {
  width: auto;
  min-height: 46px;
  padding: 0 15px;
  border-radius: 13px;
}

.profile-mode-tabs {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.profile-rank-card {
  min-height: 70px;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(104, 255, 242, 0.22);
  border-radius: 13px;
  background: rgba(104, 255, 242, 0.07);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.profile-rank-card__metric span {
  display: block;
  color: #8e97b0;
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.profile-rank-card__metric strong {
  display: block;
  margin-top: 3px;
  color: #68fff2;
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
}

.profile-neighbors {
  max-height: 230px;
}

.profile-logout {
  margin-top: 8px;
}

.settings-section {
  min-width: 0;
}

.settings-section__label {
  display: block;
  margin: 0 4px 7px;
  color: #929ab3;
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.settings-switches {
  display: grid;
  gap: 8px;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.theme-choice {
  position: relative;
  min-width: 0;
  cursor: pointer;
}

.theme-choice__input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-choice__surface {
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.035);
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #e8eaff;
  text-align: center;
  transition:
    border-color 120ms ease,
    box-shadow 120ms ease,
    transform 120ms ease;
}

.theme-choice__surface strong {
  font-size: 0.76rem;
  font-weight: 850;
}

.theme-choice__input:checked + .theme-choice__surface {
  border-color: #50e9ef;
  box-shadow:
    0 0 0 1px rgba(80, 233, 239, 0.22),
    0 0 17px rgba(80, 233, 239, 0.13);
}

.theme-choice__input:focus-visible + .theme-choice__surface {
  outline: 3px solid white;
  outline-offset: 2px;
}

.theme-choice:active .theme-choice__surface {
  transform: scale(0.98);
}

.theme-preview {
  width: 100%;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: #101425;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.theme-preview[data-theme-preview="disco"] {
  border-color: rgba(207, 230, 234, 0.24);
  background-color: #080909;
  background-image: url("./assets/disco-concrete.png");
  background-position: center;
  background-size: cover;
}

.theme-preview__tile {
  --preview-color: #35e6df;
  --preview-ink: #11151a;
  position: relative;
  isolation: isolate;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--preview-color) 70%, white 30%);
  border-radius: 6px;
  background: var(--preview-color);
  box-shadow:
    0 0 8px color-mix(in srgb, var(--preview-color) 46%, transparent),
    inset 0 1px rgba(255, 255, 255, 0.4),
    inset 0 -6px 11px rgba(0, 0, 0, 0.17);
  color: var(--preview-ink);
  display: grid;
  place-items: center;
  font-size: clamp(0.56rem, 2.8vw, 0.78rem);
  font-weight: 950;
}

.theme-preview__tile:nth-child(1) {
  --preview-color: #35e6df;
}

.theme-preview__tile:nth-child(2) {
  --preview-color: #ffd84d;
}

.theme-preview__tile:nth-child(3) {
  --preview-color: #ff5ba8;
}

.theme-preview__tile:nth-child(4) {
  --preview-color: #8ee85a;
}

.theme-preview__tile:nth-child(5) {
  --preview-color: #ff914d;
}

.theme-preview__tile:nth-child(6) {
  --preview-color: #a987ff;
}

[data-theme-preview="disco"] .theme-preview__tile:nth-child(1) {
  --preview-color: #65e9f1;
}

[data-theme-preview="disco"] .theme-preview__tile:nth-child(2) {
  --preview-color: #ffe681;
}

[data-theme-preview="disco"] .theme-preview__tile:nth-child(3) {
  --preview-color: #ff86bc;
}

[data-theme-preview="disco"] .theme-preview__tile:nth-child(4) {
  --preview-color: #b2ee7c;
}

[data-theme-preview="disco"] .theme-preview__tile:nth-child(5) {
  --preview-color: #ffb06f;
}

[data-theme-preview="disco"] .theme-preview__tile:nth-child(6) {
  --preview-color: #c3a8ff;
}

[data-theme-preview="disco"] .theme-preview__tile {
  border-color: color-mix(in srgb, var(--preview-color) 55%, white 45%);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.2), transparent 36%, rgba(0, 0, 0, 0.18)),
    var(--preview-color);
  box-shadow:
    0 0 8px color-mix(in srgb, var(--preview-color) 44%, transparent),
    inset 0 0 0 1px rgba(255, 255, 255, 0.3),
    inset 0 0 9px 2px rgba(25, 19, 22, 0.36);
}

[data-theme-preview="disco"] .theme-preview__tile::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background-image: url("./assets/disco-tile-overlay.png");
  background-position: center;
  background-size: 180% 180%;
  content: "";
  filter: contrast(1.45) brightness(0.88);
  mix-blend-mode: screen;
  opacity: 0.32;
}

.theme-preview__glyph {
  position: relative;
  z-index: 1;
}

:root[data-glyphs="off"] .theme-preview__glyph {
  visibility: hidden;
}

.setting-row {
  min-height: 61px;
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.045);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}

.setting-row__copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.setting-row__copy strong {
  color: white;
  font-size: 0.87rem;
  line-height: 1.15;
}

.setting-row__title {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.setting-badge {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(102, 245, 238, 0.42);
  border-radius: 999px;
  background: rgba(61, 224, 218, 0.1);
  color: #7ff9f1;
  font-size: 0.52rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.setting-row__copy small {
  color: #9ca4ba;
  font-size: 0.68rem;
  line-height: 1.25;
}

.setting-toggle {
  position: relative;
  width: 50px;
  height: 29px;
  flex: 0 0 auto;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  appearance: none;
  background: #353b4c;
  cursor: pointer;
  transition:
    background-color 130ms ease,
    border-color 130ms ease;
}

.setting-toggle::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #f7f8ff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  content: "";
  transition: transform 130ms ease;
}

.setting-toggle:checked {
  border-color: rgba(118, 245, 248, 0.68);
  background: #29dbe2;
}

.setting-toggle:checked::after {
  transform: translateX(21px);
}

.setting-toggle:focus-visible {
  outline: 3px solid white;
  outline-offset: 3px;
}

.primary-button,
.secondary-button,
.install-button,
.leaderboard-toggle {
  width: 100%;
  min-height: 51px;
  border-radius: 15px;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

.primary-button {
  border: 0;
  background: #f4f5ff;
  box-shadow: 0 8px 25px rgba(204, 208, 255, 0.17);
  color: #111322;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.install-button {
  margin-top: 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: transparent;
  color: #c5cadb;
}

.leaderboard-toggle {
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: white;
}

.leaderboard-panel {
  margin-top: 9px;
  margin-bottom: 0;
}

.overlay-view .leaderboard-panel {
  margin-top: 0;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.leaderboard-tab {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.04);
  color: #aeb5cb;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
}

.leaderboard-tab.is-active {
  border-color: rgba(155, 165, 255, 0.58);
  background: rgba(137, 148, 255, 0.17);
  color: white;
}

.leaderboard-player-position {
  margin: 8px 0 0;
  padding: 7px 10px;
  border: 1px solid rgba(104, 255, 242, 0.18);
  border-radius: 10px;
  background: rgba(104, 255, 242, 0.07);
  color: #a7fff8;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  line-height: 1.3;
  text-align: center;
}

.leaderboard-list {
  max-height: min(320px, 42dvh);
  margin: 10px 0 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.leaderboard-entry {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 54px;
  padding: 8px 2px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
}

.leaderboard-entry.is-current {
  margin: 2px 0;
  padding-right: 7px;
  padding-left: 7px;
  border: 1px solid rgba(104, 255, 242, 0.32);
  border-radius: 11px;
  background: rgba(104, 255, 242, 0.08);
}

.leaderboard-entry__rank {
  color: #858da8;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.leaderboard-entry__player {
  min-width: 0;
}

.leaderboard-entry__name-line {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.leaderboard-entry__name {
  overflow: hidden;
  color: #e8eaff;
  font-size: 0.82rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-entry__current {
  flex: 0 0 auto;
  padding: 2px 5px;
  border-radius: 999px;
  background: rgba(104, 255, 242, 0.14);
  color: #8efff6;
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.leaderboard-entry__meta {
  margin-top: 2px;
  color: #777f99;
  font-size: 0.66rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.leaderboard-entry__speed-bar {
  width: min(100%, 150px);
  height: 5px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  display: flex;
}

.leaderboard-entry__speed-segment {
  min-width: 0;
  flex: 0 0 0%;
}

.leaderboard-entry__speed-segment--godlike {
  background: #ffd84d;
}

.leaderboard-entry__speed-segment--perfect {
  background: #b77bff;
}

.leaderboard-entry__speed-segment--great {
  background: #5b9fff;
}

.leaderboard-entry__speed-segment--good {
  background: #5fd583;
}

.leaderboard-entry__score {
  color: #f4f5ff;
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  white-space: nowrap;
}

.leaderboard-empty {
  padding: 18px 4px 6px;
  color: #858da8;
  font-size: 0.78rem;
  text-align: center;
}

.leaderboard-gap {
  padding: 2px 0 4px 38px;
  color: #69718a;
  font-size: 1rem;
  letter-spacing: 0.12em;
}

.leaderboard-note {
  margin: 10px 0 0;
  color: #707890;
  font-size: 0.64rem;
  line-height: 1.35;
  text-align: center;
}

.primary-button:active,
.secondary-button:active,
.install-button:active,
.leaderboard-toggle:active {
  transform: translateY(1px);
}

.install-note {
  margin: 14px 4px 0;
  color: #848ba3;
  font-size: 0.74rem;
  line-height: 1.4;
  text-align: center;
}

.copyright-footer {
  margin: 16px 0 -4px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.075);
  color: #69718a;
  font-size: 0.62rem;
  letter-spacing: 0.025em;
  line-height: 1.35;
  text-align: center;
}

@media (max-height: 650px) {
  .board-shell,
  .streak-meter {
    width: min(calc(100vw - 24px), calc(100dvh - 225px), 680px);
  }
}

@media (max-width: 350px) {
  .overlay {
    padding-right: max(10px, env(safe-area-inset-right));
    padding-left: max(10px, env(safe-area-inset-left));
  }

  .dialog {
    padding-right: 16px;
    padding-left: 16px;
  }

  .dialog-utility {
    gap: 6px;
  }

  .dialog-utility .brand-logo {
    font-size: 1rem;
  }

  .dialog-utility__actions {
    gap: 6px;
  }

  .settings-toggle {
    padding-right: 12px;
    padding-left: 12px;
    gap: 8px;
  }

  .settings-toggle__value {
    min-width: 0;
    font-size: 0.68rem;
    white-space: nowrap;
  }

  .hud {
    grid-template-columns: minmax(58px, 0.72fr) minmax(138px, 1.72fr) minmax(58px, 0.72fr);
    gap: 6px;
  }

  .hud-side {
    gap: 6px;
  }

  .stat__label {
    font-size: 0.5rem;
  }

  .stat__value {
    font-size: 0.86rem;
  }

  .color-value {
    gap: 6px;
    font-size: 1rem;
  }

  .color-swatch {
    width: 38px;
    height: 38px;
  }

}

@media (orientation: landscape) and (max-height: 560px) {
  #app {
    width: 100%;
    padding-top: max(8px, env(safe-area-inset-top));
    display: grid;
    grid-template-columns: minmax(250px, 0.62fr) 1fr;
    grid-template-rows: 1fr;
    gap: 14px;
  }

  .game {
    min-width: 0;
    padding-top: 0;
  }

  .board-shell,
  .streak-meter {
    width: min(calc(100dvh - 84px), calc(100vw - 290px), 680px);
  }
}

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

  .speed-rating-overlay--visible {
    animation: none !important;
    opacity: 1;
    transform: rotate(var(--speed-rating-tilt));
  }
}
