:root {
  color-scheme: dark;
  font-family: 'DM Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --bg: #0b0d10;
  --surface: #12161a;
  --surface-2: #191e23;
  --line: rgba(255, 255, 255, 0.09);
  --muted: #8e999f;
  --text: #f4f7f5;
  --accent: #c9ff6b;
  --accent-light: #f3ffc9;
  --accent-deep: #8fcf25;
  --accent-rgb: 201, 255, 107;
  --danger: #ff6b6b;
  --warning: #ffcf66;
  --radius-lg: 28px;
  --radius-md: 18px;
  --shadow: 0 32px 90px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 15% -10%, rgba(var(--accent-rgb), 0.09), transparent 32rem),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 22rem;
  height: 22rem;
  border: 1px solid rgba(var(--accent-rgb), 0.08);
  border-radius: 50%;
  pointer-events: none;
}

.ambient::before,
.ambient::after {
  position: absolute;
  inset: 17%;
  content: '';
  border: inherit;
  border-radius: inherit;
}

.ambient::after {
  inset: 34%;
}

.ambient-one {
  top: 9%;
  right: -11rem;
}

.ambient-two {
  bottom: -14rem;
  left: -8rem;
  transform: scale(1.4);
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 24px clamp(20px, 4vw, 64px) 34px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  padding: 0;
  background: transparent;
  border: 0;
  text-decoration: none;
  cursor: pointer;
}

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

.brand-mark {
  position: relative;
  width: 30px;
  height: 30px;
  border: 8px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.24);
}

.brand-mark::after {
  position: absolute;
  top: -15px;
  left: 50%;
  width: 2px;
  height: 12px;
  content: '';
  background: var(--accent);
}

.brand-text {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.19em;
}

.topbar-actions,
.game-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.language-button {
  display: inline-flex;
  height: 44px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  transition: 160ms ease;
}

.language-button:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.language-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.icon-button,
.back-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: 160ms ease;
}

.icon-button:hover,
.back-button:hover {
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.08);
  border-color: rgba(var(--accent-rgb), 0.28);
  transform: translateY(-1px);
}

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

.home-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(370px, 0.94fr);
  gap: clamp(36px, 6vw, 90px);
  align-items: end;
  padding: 32px 0 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 20px;
  height: 1px;
  content: '';
  background: currentColor;
}

.hero-title {
  max-width: 720px;
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(64px, 9vw, 132px);
  font-weight: 800;
  line-height: 0.82;
  letter-spacing: -0.075em;
}

.hero-title span {
  display: block;
  margin-left: 0.48em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(244, 247, 245, 0.55);
}

.hero-copy {
  max-width: 540px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button {
  display: inline-flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 24px;
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  transition: 160ms ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  color: #0b0d10;
  background: var(--accent);
  box-shadow: 0 14px 42px rgba(var(--accent-rgb), 0.18);
}

.button-primary:hover {
  background: var(--accent-light);
  box-shadow: 0 18px 48px rgba(var(--accent-rgb), 0.25);
}

.button-secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--line);
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.18);
}

.button-primary span,
.button-primary small {
  display: block;
}

.button-primary small {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 700;
  opacity: 0.65;
}

.button-lobby {
  min-height: 44px;
  padding: 0 8px;
  color: var(--muted);
  border-color: transparent;
  font-size: 12px;
}

.button-lobby:hover {
  color: var(--text);
}

.button-danger {
  color: var(--danger);
  background: rgba(255, 107, 107, 0.08);
  border-color: rgba(255, 107, 107, 0.2);
}

.home-stats {
  display: flex;
  gap: 34px;
  margin-top: 42px;
}

.stat strong {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 24px;
  letter-spacing: -0.04em;
}

.stat span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.hero-art {
  position: relative;
  display: grid;
  min-height: min(52vw, 560px);
  place-items: center;
}

.orbit-visual {
  position: relative;
  width: min(36vw, 450px);
  aspect-ratio: 1;
}

.orbit-ring,
.orbit-ring::before {
  position: absolute;
  inset: 0;
  content: '';
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.orbit-ring::before {
  inset: 12%;
  border-style: dashed;
  border-color: rgba(var(--accent-rgb), 0.18);
}

.core-visual {
  position: absolute;
  inset: 31%;
  display: grid;
  place-items: center;
  color: #0d1110;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 18px rgba(var(--accent-rgb), 0.04), 0 0 80px rgba(var(--accent-rgb), 0.19);
  font-family: 'Manrope', sans-serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 800;
}

.visual-pin {
  --angle: 0deg;
  position: absolute;
  inset: 50% auto auto 50%;
  width: 2px;
  height: 49%;
  background: linear-gradient(var(--text) 0 60%, transparent 60%);
  transform: translate(-50%, 0) rotate(var(--angle));
  transform-origin: top;
}

.visual-pin::after {
  position: absolute;
  right: 50%;
  bottom: 0;
  width: 12px;
  height: 12px;
  content: '';
  background: var(--text);
  border-radius: 50%;
  transform: translate(50%, 40%);
}

.visual-pin:nth-child(2) { --angle: 28deg; }
.visual-pin:nth-child(3) { --angle: 83deg; }
.visual-pin:nth-child(4) { --angle: 137deg; }
.visual-pin:nth-child(5) { --angle: 194deg; }
.visual-pin:nth-child(6) { --angle: 252deg; }
.visual-pin:nth-child(7) { --angle: 320deg; }

.art-level-card {
  position: absolute;
  right: 0;
  bottom: 13%;
  padding: 16px 18px;
  background: rgba(18, 22, 26, 0.88);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.art-level-card strong,
.art-level-card span {
  display: block;
}

.art-level-card strong {
  margin-bottom: 4px;
  font-family: 'Manrope', sans-serif;
  font-size: 20px;
}

.art-level-card span {
  color: var(--muted);
  font-size: 12px;
}

.announcement {
  display: grid;
  width: 100%;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 16px;
  align-items: center;
  padding: 17px 20px;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 17px;
  transition: 160ms ease;
}

.announcement:hover {
  background: rgba(var(--accent-rgb), 0.045);
  border-color: rgba(var(--accent-rgb), 0.24);
}

.announcement-label {
  padding: 6px 10px;
  color: var(--accent);
  background: rgba(var(--accent-rgb), 0.1);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.announcement-copy {
  display: grid;
  min-width: 0;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.announcement-copy strong {
  font-size: 13px;
  white-space: nowrap;
}

.announcement-copy span {
  overflow: hidden;
  color: #c3c9c6;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.announcement time {
  color: var(--muted);
  font-size: 12px;
}

.announcement-arrow {
  color: var(--accent);
  font-size: 18px;
}

.page {
  padding-top: 28px;
}

.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin: 24px 0 30px;
}

.page-heading h1 {
  margin: 0 0 8px;
  font-family: 'Manrope', sans-serif;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 1;
  letter-spacing: -0.065em;
}

.page-heading p {
  margin: 0;
  color: var(--muted);
}

.completion-ring {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}

.completion-ring strong {
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 22px;
}

.level-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.chapter-tabs {
  display: flex;
  overflow-x: auto;
  gap: 8px;
  padding: 2px 0 8px;
  scrollbar-width: none;
}

.chapter-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 11px;
  font-size: 13px;
}

.tab-button.active,
.tab-button:hover {
  color: #0c0f0d;
  background: var(--accent);
  border-color: var(--accent);
}

.tab-button.locked {
  color: #777e7a;
  background: rgba(255, 255, 255, 0.018);
}

.tab-button.locked.active,
.tab-button.locked:hover {
  color: var(--text);
  background: var(--surface-2);
  border-color: rgba(var(--accent-rgb), 0.28);
}

.tab-lock,
.level-lock {
  display: inline-flex;
  align-items: center;
}

.tab-lock svg,
.unlock-icon svg,
.level-lock svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tab-lock svg {
  width: 13px;
  height: 13px;
}

.unlock-panel {
  margin: -4px 0 24px;
  padding: 18px;
  background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.075), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(var(--accent-rgb), 0.2);
  border-radius: 18px;
}

.unlock-panel.unlocked {
  background: rgba(var(--accent-rgb), 0.055);
}

.unlock-panel-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.unlock-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #0b0d10;
  background: var(--accent);
  border-radius: 12px;
  font-weight: 900;
}

.unlock-icon svg {
  width: 19px;
  height: 19px;
}

.unlock-panel h2,
.unlock-panel p {
  margin: 0;
}

.unlock-panel h2 {
  font-family: 'Manrope', sans-serif;
  font-size: 16px;
}

.unlock-panel p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.unlock-panel-copy > strong {
  color: var(--accent);
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
  white-space: nowrap;
}

.checkpoint-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
}

.checkpoint-chip {
  display: flex;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  cursor: pointer;
  color: var(--text);
  background: rgba(5, 7, 6, 0.3);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.checkpoint-chip:hover,
.checkpoint-chip.completed {
  border-color: rgba(var(--accent-rgb), 0.34);
}

.checkpoint-chip.completed {
  background: rgba(var(--accent-rgb), 0.08);
}

.checkpoint-chip strong {
  font-family: 'Manrope', sans-serif;
  font-size: 13px;
}

.checkpoint-chip span {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.checkpoint-chip.completed span {
  color: var(--accent);
}

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

.field-compact {
  width: 108px;
  height: 42px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
}

.field-compact:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.09);
}

.jump-button {
  height: 42px;
  padding: 0 15px;
  cursor: pointer;
  color: #0b0d10;
  background: var(--accent);
  border: 0;
  border-radius: 11px;
  font-weight: 700;
}

.level-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -4px 0 18px;
}

.level-filters {
  display: flex;
  min-width: 0;
  flex: 1;
  overflow-x: auto;
  gap: 7px;
  scrollbar-width: none;
}

.level-filters::-webkit-scrollbar {
  display: none;
}

.filter-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 13px;
  cursor: pointer;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
}

.filter-button:hover,
.filter-button.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--line);
}

.filter-button.active {
  color: var(--accent);
}

.level-visible-count {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(10, minmax(64px, 1fr));
  gap: 10px;
}

.level-card {
  position: relative;
  min-height: 82px;
  padding: 12px;
  overflow: hidden;
  cursor: pointer;
  color: var(--text);
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: 140ms ease;
}

.level-card:hover {
  background: var(--surface-2);
  border-color: rgba(var(--accent-rgb), 0.34);
  transform: translateY(-2px);
}

.level-card.locked:disabled {
  cursor: not-allowed;
  color: #727975;
  background: rgba(255, 255, 255, 0.018);
  border-color: rgba(255, 255, 255, 0.055);
}

.level-card.locked:disabled:hover {
  background: rgba(255, 255, 255, 0.018);
  border-color: rgba(255, 255, 255, 0.055);
  transform: none;
}

.level-card.completed {
  border-color: rgba(var(--accent-rgb), 0.32);
}

.level-card.current::after {
  position: absolute;
  right: -16px;
  bottom: -16px;
  width: 42px;
  height: 42px;
  content: '';
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 30px rgba(var(--accent-rgb), 0.25);
}

.level-empty {
  grid-column: 1 / -1;
  padding: 54px 20px;
  color: var(--muted);
  text-align: center;
  background: rgba(255, 255, 255, 0.018);
  border: 1px dashed var(--line);
  border-radius: 16px;
}

.level-number {
  display: block;
  font-family: 'Manrope', sans-serif;
  font-size: 19px;
  font-weight: 700;
}

.level-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  color: var(--muted);
  font-size: 10px;
}

.level-check {
  color: var(--accent);
  font-size: 13px;
}

.level-lock {
  gap: 5px;
  margin-top: 12px;
  color: #666d69;
  font-size: 10px;
}

.level-lock svg {
  width: 13px;
  height: 13px;
}

.game-page {
  display: grid;
  min-height: calc(100dvh - 58px);
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.game-topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.game-topbar .game-actions {
  justify-self: end;
}

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

.game-title span,
.game-title strong {
  display: block;
}

.game-title span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.game-title strong {
  margin-top: 2px;
  font-family: 'Manrope', sans-serif;
  font-size: 21px;
}

.game-stage {
  position: relative;
  display: grid;
  min-height: 450px;
  place-items: center;
  overflow: hidden;
}

#game-canvas {
  --canvas-size: min(76vh, 720px, calc(100vw - 48px));
  --canvas-limit: max(160px, calc(100dvh - 150px));
  display: block;
  width: min(var(--canvas-size), var(--canvas-limit));
  height: min(var(--canvas-size), var(--canvas-limit));
  cursor: crosshair;
  outline: none;
  touch-action: manipulation;
}

#game-canvas:focus-visible {
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent);
}

#game-canvas[aria-disabled='true'] {
  cursor: default;
}

.game-tip {
  position: absolute;
  right: 0;
  bottom: 12%;
  max-width: 170px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.game-tip strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 11px;
  letter-spacing: 0.1em;
}

.game-tip span,
.game-tip small {
  display: block;
}

.game-tip small {
  margin-top: 10px;
  color: var(--accent);
  font-size: 10px;
  line-height: 1.6;
}

.game-bottom {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding-top: 8px;
}

.attempt-progress {
  width: min(420px, 72vw);
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}

.attempt-progress span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(var(--accent-rgb), 0.45);
  transition: width 180ms ease-out;
}

.game-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}

.remaining-label {
  min-width: 100px;
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.remaining-label strong {
  display: inline-block;
  margin-left: 5px;
  color: var(--text);
  font-family: 'Manrope', sans-serif;
  font-size: 21px;
}

.remaining-label strong.bump {
  animation: count-pop 220ms ease-out;
}

.audio-control.muted {
  color: var(--danger);
  border-color: rgba(255, 107, 107, 0.22);
}

.launch-button {
  min-width: 190px;
  height: 52px;
  cursor: pointer;
  color: #0b0d10;
  background: var(--accent);
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  box-shadow: 0 12px 40px rgba(var(--accent-rgb), 0.18);
}

.launch-button:active {
  transform: scale(0.98);
}

.launch-button:disabled {
  cursor: not-allowed;
  box-shadow: none;
  opacity: 0.58;
  transform: none;
}

.launch-button:disabled.in-flight {
  cursor: progress;
  opacity: 0.72;
}

.game-actions .icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.pin-queue {
  display: flex;
  min-width: 100px;
  gap: 5px;
}

.queue-dot {
  width: 5px;
  height: 18px;
  background: var(--accent);
  border-radius: 5px;
  opacity: 1;
}

.overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(6, 8, 9, 0.75);
  backdrop-filter: blur(12px);
  animation: fade-in 160ms ease;
  overscroll-behavior: contain;
}

body.modal-open {
  overflow: hidden;
}

.dialog {
  width: min(520px, 100%);
  max-height: min(780px, calc(100dvh - 40px));
  overflow-y: auto;
  background: #12161a;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  animation: dialog-in 220ms ease;
  outline: none;
}

.dialog-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 16px;
  background: rgba(18, 22, 26, 0.94);
  backdrop-filter: blur(12px);
}

.dialog-header h2 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 25px;
  letter-spacing: -0.04em;
}

.dialog-close {
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.dialog-content {
  padding: 4px 24px 24px;
}

.settings-group {
  padding: 18px 0;
  border-top: 1px solid var(--line);
}

.settings-group:first-child {
  border-top: 0;
}

.settings-group h3 {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.setting-row {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.setting-copy {
  min-width: 0;
}

.setting-copy strong,
.setting-copy small {
  display: block;
}

.setting-copy strong {
  font-size: 14px;
  font-weight: 600;
}

.setting-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.switch {
  position: relative;
  width: 46px;
  height: 26px;
  flex: 0 0 auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #2a3035;
  border-radius: 99px;
  transition: 160ms ease;
}

.switch span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 18px;
  height: 18px;
  content: '';
  background: #f5f7f5;
  border-radius: 50%;
  transition: 160ms ease;
}

.switch input:checked + span {
  background: var(--accent);
}

.switch input:checked + span::after {
  background: #0b0d10;
  transform: translateX(20px);
}

.switch input:focus-visible + span {
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.18);
}

.range-control {
  display: flex;
  align-items: center;
  gap: 10px;
}

.range-control input {
  width: 120px;
  accent-color: var(--accent);
}

.range-value {
  width: 34px;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.select-control {
  min-width: 118px;
  max-width: 58%;
  height: 36px;
  padding: 0 10px;
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.language-select {
  min-width: 168px;
}

.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
}

.dialog-actions .button {
  flex: 1 1 130px;
}

.result-dialog {
  width: min(430px, 100%);
  max-height: calc(100dvh - 40px);
  padding: 34px;
  overflow-y: auto;
  text-align: center;
  background: #12161a;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
  outline: none;
}

.result-icon {
  display: grid;
  width: 86px;
  height: 86px;
  margin: 0 auto 22px;
  place-items: center;
  color: #0b0d10;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0.06), 0 0 60px rgba(var(--accent-rgb), 0.18);
  font-family: 'Manrope', sans-serif;
  font-size: 34px;
  font-weight: 800;
}

.result-dialog.failed .result-icon {
  color: #fff;
  background: var(--danger);
  box-shadow: 0 0 0 12px rgba(255, 107, 107, 0.06), 0 0 60px rgba(255, 107, 107, 0.15);
}

.result-dialog.unlocked .result-icon {
  box-shadow: 0 0 0 12px rgba(var(--accent-rgb), 0.09), 0 0 78px rgba(var(--accent-rgb), 0.32);
}

.result-dialog h2 {
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 32px;
  letter-spacing: -0.05em;
}

.result-dialog p {
  margin: 10px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.about-logo {
  display: grid;
  width: 76px;
  height: 76px;
  margin: 8px 0 22px;
  place-items: center;
  color: #0b0d10;
  background: var(--accent);
  border-radius: 50%;
  font-family: 'Manrope', sans-serif;
  font-size: 25px;
  font-weight: 800;
}

.about-intro {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 22px;
  align-items: center;
}

.about-intro .about-logo {
  margin: 8px 0;
}

.about-copy {
  color: #bdc5c1;
  line-height: 1.8;
}

.about-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.about-meta div {
  padding: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.about-meta span,
.about-meta strong {
  display: block;
}

.about-meta span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 10px;
}

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

.community-link {
  display: flex;
  min-width: 0;
  min-height: 76px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  color: var(--text);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 13px;
  transition: 160ms ease;
}

.community-link:hover {
  background: rgba(var(--accent-rgb), 0.07);
  border-color: rgba(var(--accent-rgb), 0.28);
  transform: translateY(-1px);
}

.community-link span,
.community-link small,
.community-link strong {
  display: block;
  min-width: 0;
}

.community-link small {
  overflow: hidden;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.community-link strong {
  font-size: 13px;
}

.community-link svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.release-section-title {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.release-section-title.history {
  margin-top: 28px;
}

.release-card {
  margin-top: 12px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.release-card.current {
  background: rgba(var(--accent-rgb), 0.055);
  border-color: rgba(var(--accent-rgb), 0.25);
}

.release-meta,
.release-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.release-meta {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.release-meta span {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.09em;
}

.release-title {
  flex-wrap: wrap;
  justify-content: flex-start;
  margin-top: 13px;
}

.release-title strong {
  padding: 5px 8px;
  color: #0b0d10;
  background: var(--accent);
  border-radius: 7px;
  font-size: 11px;
}

.release-title h3 {
  min-width: 0;
  margin: 0;
  font-family: 'Manrope', sans-serif;
  font-size: 18px;
  overflow-wrap: anywhere;
}

.release-card p {
  margin: 12px 0 0;
  color: #bdc5c1;
  font-size: 13px;
  line-height: 1.7;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.toast {
  position: fixed;
  z-index: 40;
  bottom: 28px;
  left: 50%;
  padding: 11px 16px;
  pointer-events: none;
  color: #0b0d10;
  background: var(--accent);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body[data-theme='orange'] {
  --accent: #ffb84d;
  --accent-light: #ffe7ba;
  --accent-deep: #dc8519;
  --accent-rgb: 255, 184, 77;
}

body[data-theme='rose'] {
  --accent: #ff7d9d;
  --accent-light: #ffd6e0;
  --accent-deep: #db3f69;
  --accent-rgb: 255, 125, 157;
}

body.high-contrast {
  --bg: #000;
  --surface: #0b0b0b;
  --surface-2: #151515;
  --line: rgba(255, 255, 255, 0.28);
  --muted: #c1c1c1;
}

body.screen-shake {
  animation: shake 180ms linear;
}

@keyframes fade-in {
  from { opacity: 0; }
}

@keyframes dialog-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes count-pop {
  45% { color: var(--accent); transform: scale(1.28); }
}

@media (max-width: 1000px) {
  .home-layout {
    grid-template-columns: 1fr 0.72fr;
  }

  .level-grid {
    grid-template-columns: repeat(7, minmax(64px, 1fr));
  }

  .game-tip {
    display: none;
  }
}

@media (max-width: 760px) {
  .app-shell {
    padding: 18px 16px 24px;
  }

  .home-layout {
    display: flex;
    min-height: auto;
    flex-direction: column;
    align-items: stretch;
    padding: 56px 0 36px;
  }

  .hero-art {
    min-height: 390px;
    order: -1;
    margin-bottom: -45px;
  }

  .orbit-visual {
    width: min(78vw, 380px);
  }

  .hero-title {
    font-size: clamp(62px, 22vw, 100px);
  }

  .hero-copy {
    margin-top: 24px;
  }

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

  .announcement time,
  .announcement-arrow {
    display: none;
  }

  .announcement-copy {
    display: block;
  }

  .announcement-copy strong,
  .announcement-copy span {
    display: block;
  }

  .announcement-copy strong {
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .announcement-copy span {
    margin-top: 4px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .unlock-panel-copy {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .unlock-panel-copy > strong {
    grid-column: 2;
  }

  .level-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .level-grid {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
  }

  .level-card {
    min-height: 70px;
    padding: 10px;
  }

  .game-stage {
    min-height: 390px;
  }

  #game-canvas {
    --canvas-size: min(68vh, 620px, calc(100vw - 32px));
  }

  .pin-queue {
    display: none;
  }

  .game-bottom {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }

  .remaining-label {
    min-width: auto;
  }
}

@media (max-width: 460px) {
  .brand-text {
    display: none;
  }

  .hero-art {
    min-height: 330px;
  }

  .hero-actions .button {
    width: 100%;
  }

  .home-stats {
    justify-content: space-between;
    gap: 12px;
  }

  .level-grid {
    grid-template-columns: repeat(4, minmax(52px, 1fr));
  }

  .unlock-panel {
    padding: 15px;
  }

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

  .checkpoint-chip:last-child {
    grid-column: 1 / -1;
  }

  .game-topbar {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 8px;
  }

  .game-actions .restart-control {
    display: none;
  }

  .game-actions {
    gap: 6px;
  }

  .game-actions .icon-button {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .game-controls {
    gap: 10px;
  }

  .launch-button {
    min-width: 148px;
  }

  .result-dialog {
    padding: 28px 22px;
  }

  .setting-row {
    gap: 12px;
  }

  .select-control {
    max-width: 54%;
  }

  .range-control input {
    width: 84px;
  }

  .about-intro {
    display: block;
  }

  .community-links {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .app-shell {
    padding-right: 12px;
    padding-left: 12px;
  }

  .hero-actions {
    gap: 8px;
  }

  .level-grid {
    gap: 7px;
  }

  .level-card {
    min-height: 66px;
    padding: 9px;
  }

  .level-filter-row {
    gap: 8px;
  }

  .filter-button {
    padding: 0 9px;
  }

  #game-canvas {
    --canvas-size: min(66vh, 560px, calc(100vw - 24px));
  }

  .remaining-label {
    font-size: 10px;
  }

  .attempt-progress {
    width: min(260px, 82vw);
  }

  .launch-button {
    min-width: 136px;
  }
}

@media (max-height: 700px) {
  .app-shell {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .game-page {
    min-height: calc(100dvh - 24px);
  }

  .game-stage {
    min-height: 250px;
  }

  #game-canvas {
    --canvas-size: min(60vh, 520px, calc(100vw - 40px));
  }

  .game-tip {
    display: none;
  }

  .result-dialog {
    max-height: calc(100dvh - 24px);
    padding: 18px 20px;
    border-radius: 20px;
  }

  .result-icon {
    width: 58px;
    height: 58px;
    margin-bottom: 12px;
    font-size: 25px;
  }

  .result-dialog h2 {
    font-size: 25px;
  }

  .result-dialog p {
    margin: 6px 0 12px;
    line-height: 1.4;
  }

  .result-dialog .dialog-actions {
    gap: 7px;
    padding-top: 4px;
  }

  .result-dialog .dialog-actions .button {
    min-height: 42px;
  }
}

@media (max-height: 430px) and (orientation: landscape) {
  .game-stage {
    min-height: 150px;
  }

  .game-bottom {
    gap: 5px;
    padding-top: 2px;
  }

  .launch-button {
    height: 44px;
  }

  .remaining-label strong {
    font-size: 18px;
  }
}

@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;
  }
}

body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: 0.01ms !important;
  transition-duration: 0.01ms !important;
}
