:root {
  color-scheme: dark;
  --bg: #080a12;
  --panel: rgba(20, 23, 37, 0.72);
  --panel-strong: rgba(24, 28, 45, 0.92);
  --line: rgba(255, 255, 255, 0.1);
  --text: #f5f6fb;
  --muted: #979caf;
  --purple: #9a7cff;
  --cyan: #67e8e3;
  --pink: #f17ebc;
  --green: #75e6a4;
  --danger: #ff718d;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --radius-lg: 28px;
  --radius-md: 20px;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 50% -15%, rgba(122, 94, 239, 0.14), transparent 36rem),
    linear-gradient(180deg, #090b14 0%, #080a12 100%);
}

button {
  color: inherit;
  font: inherit;
}

button:focus-visible {
  outline: 3px solid rgba(103, 232, 227, 0.8);
  outline-offset: 4px;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 28rem;
  height: 28rem;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.11;
  pointer-events: none;
}

.ambient-one {
  top: 18%;
  left: -16rem;
  background: #755cff;
}

.ambient-two {
  right: -18rem;
  bottom: 12%;
  background: #38d8d0;
}

.app-shell {
  width: min(1180px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header {
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  gap: 13px;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  width: 42px;
  height: 42px;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  transform: rotate(4deg);
}

.brand-mark span {
  border-radius: 5px;
}

.brand-mark span:nth-child(1) {
  background: var(--purple);
}

.brand-mark span:nth-child(2) {
  background: var(--cyan);
}

.brand-mark span:nth-child(3) {
  grid-column: 1 / 3;
  width: 53%;
  justify-self: end;
  background: var(--pink);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-copy strong {
  letter-spacing: 0.08em;
  font-size: 17px;
}

.brand-copy small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.22em;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  cursor: pointer;
  transition: 180ms ease;
}

.sound-toggle:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.07);
}

.sound-toggle svg {
  width: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-on-icon {
  display: none;
}

.sound-toggle[aria-pressed="true"] .sound-on-icon {
  display: block;
}

.sound-toggle[aria-pressed="true"] .sound-off-icon {
  display: none;
}

main {
  flex: 1;
}

.screen {
  display: none;
  animation: screen-in 420ms ease both;
}

.screen.is-active {
  display: block;
}

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

.home-screen {
  padding: 78px 0 50px;
}

.hero {
  max-width: 780px;
  margin-bottom: 80px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.eyebrow span {
  width: 24px;
  height: 1px;
  background: currentColor;
}

.hero h1 {
  margin: 0;
  font-size: clamp(50px, 7.4vw, 88px);
  line-height: 1.06;
  letter-spacing: -0.055em;
  font-weight: 800;
}

.hero h1 em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(90deg, #ae8bff 0%, #f28ac0 54%, #70e5df 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero p {
  max-width: 570px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.9;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 15px;
}

.section-heading h2 {
  margin: 0;
  font-size: 21px;
  letter-spacing: 0.02em;
}

.section-heading p {
  margin: 0;
  color: #6f7487;
  font-size: 12px;
}

.section-index {
  color: var(--purple);
  font: 700 11px/1 monospace;
  letter-spacing: 0.1em;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.mode-card {
  min-height: 292px;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    rgba(17, 20, 32, 0.86);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition:
    transform 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease;
}

.mode-card::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: auto -20% -65% 25%;
  height: 85%;
  border-radius: 50%;
  opacity: 0.13;
  filter: blur(35px);
  transition: opacity 220ms ease;
}

.mode-timed::before {
  background: var(--purple);
}

.mode-levels::before {
  background: var(--cyan);
}

.mode-lives::before {
  background: var(--pink);
}

.mode-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.22);
  box-shadow: 0 24px 45px rgba(0, 0, 0, 0.25);
}

.mode-card:hover::before {
  opacity: 0.25;
}

.mode-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  border: 1px solid currentColor;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.mode-icon svg {
  width: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mode-timed .mode-icon,
.mode-timed .mode-number {
  color: #a78cff;
}

.mode-levels .mode-icon,
.mode-levels .mode-number {
  color: var(--cyan);
}

.mode-lives .mode-icon,
.mode-lives .mode-number {
  color: var(--pink);
}

.mode-number {
  margin-bottom: 10px;
  font: 700 10px/1 monospace;
  letter-spacing: 0.15em;
}

.mode-card > strong {
  margin-bottom: 10px;
  font-size: 22px;
  letter-spacing: 0.02em;
}

.mode-description {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.mode-meta {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: auto;
  padding-top: 26px;
  color: #74798c;
  font-size: 10px;
}

.mode-meta b {
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.mode-action {
  color: #b8bdcc;
  font-size: 11px;
}

.mode-action i {
  display: inline-block;
  margin-left: 5px;
  font-style: normal;
  transition: transform 180ms ease;
}

.mode-card:hover .mode-action i {
  transform: translateX(4px);
}

.recommended {
  position: absolute;
  top: 0;
  right: 25px;
  padding: 7px 10px;
  border-radius: 0 0 8px 8px;
  background: rgba(103, 232, 227, 0.13);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.how-to {
  margin-top: 72px;
}

.section-heading.compact {
  margin-bottom: 20px;
}

.how-to ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how-to li {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 20px;
  border-top: 1px solid var(--line);
}

.how-to li > span {
  color: #565b70;
  font: 700 24px/1 monospace;
}

.how-to p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.how-to strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 13px;
}

.leaderboard-section {
  margin-top: 76px;
  scroll-margin-top: 24px;
}

.leaderboard-panel {
  overflow: hidden;
  border-radius: 22px;
}

.leaderboard-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.12);
}

.leaderboard-tab {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #777d90;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.leaderboard-tab:hover {
  color: var(--text);
}

.leaderboard-tab.is-active {
  color: var(--cyan);
  background: rgba(103, 232, 227, 0.08);
  box-shadow: inset 0 0 0 1px rgba(103, 232, 227, 0.13);
}

.leaderboard-heading {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  padding: 15px 24px 11px;
  color: #5f6578;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.leaderboard-list,
.result-leaderboard {
  margin: 0;
  padding: 0;
  list-style: none;
}

.leaderboard-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 55px;
  padding: 8px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.leaderboard-rank {
  color: #666c80;
  font: 700 14px/1 monospace;
}

.leaderboard-row:nth-child(-n + 3) .leaderboard-rank {
  color: var(--purple);
}

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

.leaderboard-player strong,
.leaderboard-player small {
  display: block;
}

.leaderboard-player strong {
  overflow: hidden;
  color: #d9dce6;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-player small {
  margin-top: 3px;
  color: #5f6578;
  font-size: 9px;
}

.leaderboard-score {
  color: var(--cyan);
  font: 700 13px/1 monospace;
  text-align: right;
}

.leaderboard-state {
  min-height: 64px;
  display: grid;
  place-items: center;
  padding: 16px;
  color: #6b7184;
  font-size: 11px;
  text-align: center;
}

.leaderboard-state[hidden] {
  display: none;
}

.game-screen {
  padding: 34px 0 60px;
}

.game-toolbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  margin-bottom: 30px;
}

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

.game-title span {
  color: var(--purple);
  font: 700 10px/1 monospace;
  letter-spacing: 0.15em;
}

.game-title h2 {
  margin: 7px 0 0;
  font-size: 20px;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.035);
  color: #b7bbca;
  cursor: pointer;
  transition: 180ms ease;
}

.icon-button:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
}

.icon-button svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbar-actions {
  display: flex;
  justify-self: end;
  gap: 9px;
}

.play-icon {
  display: none;
}

#pause-button.is-paused .play-icon {
  display: block;
}

#pause-button.is-paused .pause-icon {
  display: none;
}

.game-layout {
  display: grid;
  grid-template-columns: 190px minmax(360px, 590px) 190px;
  gap: 28px;
  justify-content: center;
  align-items: start;
}

.glass-panel {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.stats-panel {
  position: sticky;
  top: 24px;
  overflow: hidden;
  border-radius: 18px;
}

.stat-item {
  padding: 22px 23px;
}

.stat-item span {
  display: block;
  margin-bottom: 7px;
  color: #777d91;
  font-size: 10px;
  letter-spacing: 0.06em;
}

.stat-item strong {
  font: 700 26px/1.1 monospace;
  letter-spacing: -0.05em;
}

.stat-item strong small {
  margin-left: 3px;
  color: #777d91;
  font-size: 10px;
  letter-spacing: 0;
}

.accent-stat strong {
  color: var(--cyan);
}

.stat-divider {
  height: 1px;
  margin: 0 22px;
  background: var(--line);
}

.time-track {
  height: 3px;
  background: rgba(255, 255, 255, 0.04);
}

.time-track span {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--cyan));
  transform-origin: left;
  transition: width 200ms linear;
}

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  color: #c9ccda;
  font-size: 12px;
}

.board-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.board-header > span {
  color: #666c80;
  font-size: 10px;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 0 5px rgba(103, 232, 227, 0.08);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  50% {
    box-shadow: 0 0 0 9px rgba(103, 232, 227, 0);
  }
}

.board-wrap {
  min-height: 440px;
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(20px, 3.5vw, 38px);
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.color-grid {
  --grid-size: 2;
  width: 100%;
  max-width: 500px;
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(var(--grid-size), minmax(0, 1fr));
  gap: clamp(7px, 1.1vw, 13px);
}

.color-tile {
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: clamp(8px, 1.25vw, 15px);
  background: var(--tile-color);
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 8px 18px rgba(0, 0, 0, 0.09);
  transition:
    transform 110ms ease,
    box-shadow 110ms ease,
    opacity 110ms ease;
  animation: tile-in 260ms ease both;
  animation-delay: calc(var(--tile-index) * 12ms);
  -webkit-tap-highlight-color: transparent;
}

.color-tile:hover {
  transform: translateY(-2px) scale(1.018);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 12px 24px rgba(0, 0, 0, 0.18);
}

.color-tile:active {
  transform: scale(0.95);
}

.color-tile.is-correct {
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.8),
    0 0 0 5px rgba(117, 230, 164, 0.22);
  transform: scale(0.93);
}

.color-tile.is-wrong {
  animation: wrong-shake 260ms ease;
  box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.65);
}

@keyframes tile-in {
  from {
    opacity: 0;
    transform: scale(0.82);
  }
}

@keyframes wrong-shake {
  25% {
    transform: translateX(-5px);
  }
  60% {
    transform: translateX(5px);
  }
}

.pause-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 25px;
  background: rgba(9, 11, 20, 0.89);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  opacity: 0;
  visibility: hidden;
  transition: 180ms ease;
}

.pause-overlay.is-visible {
  opacity: 1;
  visibility: visible;
}

.pause-symbol {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin-bottom: 17px;
  border: 1px solid rgba(103, 232, 227, 0.35);
  border-radius: 50%;
  color: var(--cyan);
  background: rgba(103, 232, 227, 0.07);
}

.pause-symbol svg {
  width: 25px;
  fill: currentColor;
  stroke: none;
}

.pause-overlay strong {
  font-size: 21px;
}

.pause-overlay p {
  margin: 8px 0 21px;
  color: var(--muted);
  font-size: 12px;
}

.game-feedback {
  min-height: 38px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #686e81;
  font-size: 11px;
  letter-spacing: 0.03em;
}

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

.game-feedback.is-wrong {
  color: var(--danger);
}

.tip-panel {
  position: sticky;
  top: 24px;
}

.tip-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.025);
}

.tip-label {
  display: block;
  margin-bottom: 12px;
  color: var(--purple);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.15em;
}

.tip-card p {
  margin: 0;
  color: #858a9d;
  font-size: 11px;
  line-height: 1.8;
}

.mode-rule {
  margin-top: 18px;
  padding-left: 4px;
  color: #696f82;
  font-size: 10px;
  line-height: 1.9;
}

.mode-rule strong {
  color: #b7bbca;
}

.primary-button,
.secondary-button {
  min-height: 44px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: 180ms ease;
}

.primary-button {
  border: 0;
  background: linear-gradient(100deg, #8d70f7, #6acfd2);
  color: #fff;
  box-shadow: 0 10px 26px rgba(125, 106, 233, 0.24);
}

.primary-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 32px rgba(125, 106, 233, 0.34);
}

.secondary-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: #bbc0cf;
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.08);
}

footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 25px;
  min-height: 72px;
  border-top: 1px solid var(--line);
  color: #505568;
  font-size: 9px;
  letter-spacing: 0.1em;
}

footer p {
  margin: 0;
  max-width: 560px;
  text-align: right;
  line-height: 1.6;
  letter-spacing: 0.02em;
}

.result-modal {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

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

.result-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 9, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.result-card {
  width: min(480px, 100%);
  max-height: calc(100vh - 40px);
  position: relative;
  padding: 38px;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 26px;
  background:
    radial-gradient(circle at 50% 0%, rgba(145, 112, 247, 0.13), transparent 50%),
    var(--panel-strong);
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
  text-align: center;
  animation: modal-in 360ms ease both;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
}

.result-badge {
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.result-orbit {
  width: 82px;
  height: 82px;
  position: relative;
  display: grid;
  place-items: center;
  margin: 22px auto;
  border: 1px solid rgba(154, 124, 255, 0.32);
  border-radius: 50%;
}

.result-orbit::before,
.result-orbit::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(103, 232, 227, 0.12);
  border-radius: 50%;
}

.result-orbit::before {
  inset: 8px;
}

.result-orbit::after {
  inset: -8px;
}

.result-orbit span {
  width: 6px;
  height: 6px;
  position: absolute;
  border-radius: 50%;
}

.result-orbit span:nth-child(1) {
  top: -3px;
  background: var(--purple);
}

.result-orbit span:nth-child(2) {
  right: 3px;
  bottom: 10px;
  background: var(--cyan);
}

.result-orbit span:nth-child(3) {
  left: 2px;
  bottom: 14px;
  background: var(--pink);
}

.result-orbit strong {
  font-size: 28px;
}

.result-card h2 {
  margin: 0;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.result-card > p {
  margin: 10px 0 26px;
  color: var(--muted);
  font-size: 13px;
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.12);
}

.result-stats div {
  padding: 16px 8px;
}

.result-stats div + div {
  border-left: 1px solid var(--line);
}

.result-stats span {
  display: block;
  margin-bottom: 7px;
  color: #6f7487;
  font-size: 9px;
}

.result-stats strong {
  font: 700 20px/1 monospace;
}

.new-record {
  width: fit-content;
  margin: -3px auto 18px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(103, 232, 227, 0.09);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.score-submit {
  margin-bottom: 18px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.12);
  text-align: left;
}

.score-submit > label {
  display: block;
  margin-bottom: 10px;
  color: #d7dae4;
  font-size: 11px;
  font-weight: 700;
}

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

.score-submit input {
  min-width: 0;
  min-height: 44px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  outline: 0;
  background: rgba(255, 255, 255, 0.04);
  color: #fff;
  font: inherit;
  font-size: 12px;
}

.score-submit input::placeholder {
  color: #5f6578;
}

.score-submit input:focus {
  border-color: rgba(103, 232, 227, 0.55);
  box-shadow: 0 0 0 3px rgba(103, 232, 227, 0.08);
}

.score-submit input:disabled {
  opacity: 0.65;
}

.score-submit p {
  min-height: 16px;
  margin: 8px 1px 0;
  color: #6f7589;
  font-size: 9px;
  line-height: 1.6;
}

.score-submit p.is-error {
  color: var(--danger);
}

.score-submit p.is-success {
  color: var(--green);
}

.result-leaderboard {
  max-height: 188px;
  margin-top: 12px;
  overflow-y: auto;
  border-top: 1px solid var(--line);
}

.result-leaderboard .leaderboard-row {
  grid-template-columns: 30px minmax(0, 1fr) auto;
  min-height: 42px;
  padding: 6px 2px;
}

.result-leaderboard .leaderboard-player small {
  display: none;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 980px) {
  .game-layout {
    grid-template-columns: minmax(150px, 180px) minmax(340px, 560px);
  }

  .tip-panel {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 28px, 620px);
  }

  .site-header {
    height: 78px;
  }

  .home-screen {
    padding-top: 54px;
  }

  .hero {
    margin-bottom: 58px;
  }

  .hero h1 {
    font-size: clamp(46px, 14vw, 68px);
  }

  .hero p {
    font-size: 14px;
  }

  .mode-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: 250px;
  }

  .how-to ol {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .leaderboard-section {
    margin-top: 58px;
  }

  .game-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .stats-panel {
    width: 100%;
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .stat-item {
    padding: 16px 12px;
    text-align: center;
  }

  .stat-divider {
    width: 1px;
    height: auto;
    margin: 12px 0;
  }

  .time-track {
    position: absolute;
    inset: auto 0 0;
    width: 100%;
  }

  .board-column {
    width: 100%;
  }

  .board-wrap {
    min-height: auto;
  }

  .game-toolbar {
    margin-bottom: 20px;
  }

  footer {
    flex-direction: column;
    justify-content: center;
    padding: 20px 0;
    text-align: center;
  }

  footer p {
    text-align: center;
  }
}

@media (max-width: 480px) {
  .brand-copy small,
  .sound-toggle span {
    display: none;
  }

  .sound-toggle {
    width: 42px;
    padding: 0;
    justify-content: center;
  }

  .section-heading p {
    display: none;
  }

  .hero h1 {
    font-size: 45px;
  }

  .mode-card {
    padding: 23px;
  }

  .game-screen {
    padding-top: 22px;
  }

  .game-title h2 {
    font-size: 16px;
  }

  .stat-item span {
    font-size: 9px;
  }

  .stat-item strong {
    font-size: 20px;
  }

  .board-header {
    padding: 0 3px;
  }

  .board-wrap {
    padding: 15px;
    border-radius: 20px;
  }

  .color-grid {
    gap: 7px;
  }

  .result-card {
    padding: 30px 20px 24px;
  }

  .score-submit-row {
    grid-template-columns: 1fr;
  }

  .score-submit-row .primary-button {
    width: 100%;
  }

  .leaderboard-heading,
  .leaderboard-row {
    padding-right: 15px;
    padding-left: 15px;
  }

  .leaderboard-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 8px;
  }
}

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