@import url("./fonts.css?v=2");
:root {
  --bg: #090d19;
  --panel: #101625;
  --line: #242c40;
  --text: #edf1fc;
  --muted: #8894ad;
  --mint: #63f7d1;
  --purple: #bd93ff;
  --accent: var(--mint);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font:
    15px "DM Sans",
    system-ui,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  color: inherit;
  border: 0;
  background: none;
  transition:
    background 0.18s,
    transform 0.18s,
    border-color 0.18s;
}
button:hover {
  filter: brightness(1.12);
}
button:active {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
}
a {
  color: inherit;
  text-decoration: none;
}
h1,
h2,
h3,
.brand,
.level-name,
.primary,
strong {
  font-family: "Space Grotesk", system-ui, sans-serif;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h2 {
  font-size: 27px;
  letter-spacing: -1px;
}
h3 {
  font-size: 19px;
}
p {
  line-height: 1.65;
  color: var(--muted);
}
.topbar {
  height: 92px;
  border-bottom: 1px solid #202638;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5.5%;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1.5px;
  position: relative;
  padding-bottom: 9px;
}
.brand > span:not(.brand-mark) {
  color: var(--mint);
}
.brand-mark {
  font-size: 39px;
  line-height: 1;
  color: var(--mint);
  margin-right: 7px;
}
.brand small {
  white-space: nowrap;
  font:
    7px "DM Sans",
    sans-serif;
  letter-spacing: 2px;
  color: #77859b;
  position: absolute;
  bottom: 0;
  left: 49px;
}
nav {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 100%;
}
.nav {
  height: 100%;
  position: relative;
  font-size: 13px;
  color: #99a4bc;
  padding: 0;
}
.nav.active {
  color: var(--text);
}
.nav.active:after {
  content: "";
  height: 2px;
  background: var(--mint);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.new {
  font-size: 8px;
  color: var(--mint);
  border: 1px solid #2a6257;
  padding: 3px 4px;
  border-radius: 3px;
  margin-left: 5px;
  letter-spacing: 0.6px;
}
.top-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.icon-button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: 19px;
  color: #cbd5e8;
}
.volume-wrap {
  display: flex;
  width: 65px;
}
input[type="range"] {
  accent-color: var(--mint);
  width: 100%;
  cursor: pointer;
  height: 4px;
}
main {
  max-width: 1440px;
  margin: auto;
  padding: 0 5.5%;
}
.screen {
  display: none;
}
.screen.active {
  display: block;
}
.hero {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 425px;
  align-items: center;
  position: relative;
  padding-top: 20px;
}
.eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--mint);
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 19px;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 100%;
  background: var(--mint);
  box-shadow: 0 0 12px #63f7d16b;
  display: inline-block;
}
.hero h1 {
  font-size: clamp(50px, 5.2vw, 76px);
  letter-spacing: -4px;
  line-height: 1.02;
  margin: 0 0 22px;
  font-weight: 600;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(110deg, #63f7d1, #84c7eb 75%);
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  font-size: 14px;
  margin-bottom: 26px;
}
.hero-buttons {
  display: flex;
  align-items: center;
  gap: 24px;
}
.primary {
  background: var(--mint);
  border: 1px solid var(--mint);
  color: #071d1c;
  padding: 13px 22px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
}
.primary span {
  font-size: 18px;
}
.quiet {
  color: #b7c1d7;
  font-size: 12px;
  padding: 10px 0;
  display: inline-flex;
  align-items: center;
  gap: 20px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font:
    8px "DM Sans",
    sans-serif;
  letter-spacing: 1.1px;
  color: #66748c;
  margin-top: 26px;
}
.hero-meta i {
  height: 3px;
  width: 3px;
  background: #647188;
  border-radius: 50%;
}
.hero-art {
  height: 390px;
  position: relative;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 50%, #3a236142, transparent 65%);
}
.orbital {
  width: 290px;
  height: 290px;
  border: 1px solid #3b344d8c;
  position: absolute;
  left: 50%;
  top: 50%;
  border-radius: 50%;
  transform: translate(-50%, -50%) rotate(-30deg);
}
.o2 {
  width: 380px;
  height: 380px;
  border-color: #222c3e;
}
.o1:after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #c4a2ff;
  position: absolute;
  top: 65px;
  left: 15px;
  box-shadow: 0 0 20px #b68cff;
}
.hero-line {
  position: absolute;
  left: 15%;
  top: 50%;
  width: 75%;
  border-top: 1px dashed #3c3b536b;
  transform: rotate(-30deg);
}
.line2 {
  transform: rotate(60deg);
}
.cube-art {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 125px;
  height: 125px;
  border-radius: 15px;
  border: 3px solid #b799f6;
  background: linear-gradient(145deg, #7975c3, #524391 65%, #7862bb);
  transform: translate(-50%, -50%) rotate(-23deg);
  box-shadow:
    10px 14px 0 #302b56,
    14px 18px 0 #7561ab,
    -12px -8px 55px #b08eff26,
    inset 0 0 0 8px #9588d53d;
  animation: float 5s ease-in-out infinite;
}
.cube-eyes {
  display: flex;
  justify-content: space-between;
  padding: 27px 23px 0;
}
.cube-eyes i {
  width: 20px;
  height: 24px;
  background: #0f1531;
  box-shadow: inset -4px -3px #8ef8de;
  border: 2px solid #c6b2ff;
}
.cube-mouth {
  width: 47px;
  height: 12px;
  background: #1b2240;
  border: 2px solid #baaff1;
  margin: 12px auto;
  box-shadow: inset 0 -3px #81e5d0;
}
.floating-chip {
  position: absolute;
  background: #131b2ddd;
  border: 1px solid #333949;
  border-radius: 9px;
  padding: 10px 13px;
  font-family: "Space Grotesk", sans-serif;
  box-shadow: 0 12px 30px #05071170;
}
.chip-top {
  right: 9%;
  top: 50px;
  font-size: 19px;
  transform: rotate(7deg);
}
.chip-top span {
  font-size: 9px;
  color: #8c9bb6;
}
.chip-top b {
  color: var(--mint);
  font-size: 19px;
  letter-spacing: 3px;
  margin-left: 16px;
}
.chip-bottom {
  bottom: 52px;
  left: 11%;
  display: flex;
  align-items: center;
  gap: 9px;
  letter-spacing: 1.4px;
  font-size: 8px;
  transform: rotate(-7deg);
}
.chip-bottom > span:last-child {
  margin-left: 12px;
  color: var(--mint);
}
.art-spark {
  position: absolute;
  color: #a5fbe5;
}
.s1 {
  top: 90px;
  left: 16%;
  font-size: 35px;
}
.s2 {
  right: 12%;
  top: 48%;
  color: #b59aff;
  font-size: 27px;
}
.s3 {
  bottom: 52px;
  right: 32%;
  font-size: 28px;
}
.mini-triangle {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 1px solid #73bba7;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: linear-gradient(#172f30, #66b99c44);
}
.t1 {
  bottom: 90px;
  right: 18%;
  transform: rotate(20deg);
}
.t2 {
  top: 43px;
  left: 32%;
  width: 13px;
  height: 13px;
}
.hero-coordinate {
  font: 8px monospace;
  line-height: 1.7;
  color: #566079;
  position: absolute;
  bottom: 12px;
  right: 13%;
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 23px 0 22px;
  gap: 15px;
}
.section-heading .eyebrow {
  margin: 0 0 10px;
  font-size: 8px;
}
.section-heading h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.8px;
}
.count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #30384e;
  border-radius: 5px;
  font-size: 10px;
  letter-spacing: 0;
  color: #92a0b9;
  margin-left: 14px;
  vertical-align: middle;
  padding: 4px 6px;
}
.section-note {
  color: #6f7c95;
  font-size: 11px;
}
.muted {
  color: var(--muted);
}
.level-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px;
}
.level-card {
  background: linear-gradient(135deg, #151c2d, #0e1422);
  border: 1px solid #293147;
  border-radius: 11px;
  overflow: hidden;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.level-card:hover {
  transform: translateY(-4px);
  border-color: var(--course);
}
.card-art {
  height: 121px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(
      ellipse at 50% 100%,
      color-mix(in srgb, var(--course) 17%, transparent),
      transparent 80%
    ),
    #101729;
  border-bottom: 1px solid #252e42;
}
.card-art:before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(#8492ba08 1px, transparent 1px),
    linear-gradient(90deg, #8492ba08 1px, transparent 1px);
  background-size: 24px 24px;
  transform: perspective(200px) rotateX(15deg);
}
.card-art svg {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.card-number {
  position: absolute;
  top: 11px;
  left: 13px;
  color: #b6c3d3;
  font-size: 9px;
  letter-spacing: 1px;
}
.card-duration {
  position: absolute;
  right: 11px;
  top: 11px;
  color: #9eb0c6;
  background: #090d1980;
  padding: 3px 5px;
  border-radius: 3px;
  font-size: 8px;
}
.card-content {
  padding: 16px;
}
.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--course);
  font-size: 9px;
  margin-bottom: 9px;
}
.difficulty {
  padding: 3px 6px;
  border-radius: 4px;
  border: 1px solid color-mix(in srgb, var(--course) 25%, transparent);
  background: color-mix(in srgb, var(--course) 7%, transparent);
}
.stars {
  font-size: 10px;
  letter-spacing: 2px;
}
.level-name {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: -0.7px;
  margin: 0 0 5px;
}
.level-tag {
  font-size: 8px;
  letter-spacing: 1.4px;
  color: #7485a0;
  margin: 0 0 18px;
}
.card-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #8c9bb1;
  margin-bottom: 7px;
}
.card-progress-label b {
  color: #d3daeb;
  font-size: 10px;
}
.mini-track {
  height: 3px;
  background: #242d40;
  border-radius: 4px;
  overflow: hidden;
}
.mini-track i {
  display: block;
  height: 100%;
  background: var(--course);
}
.card-buttons {
  display: flex;
  gap: 7px;
  margin-top: 16px;
}
.play-course {
  background: color-mix(in srgb, var(--course) 11%, #101522);
  border: 1px solid color-mix(in srgb, var(--course) 25%, transparent);
  color: var(--course);
  flex: 1;
  padding: 8px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  justify-content: space-between;
}
.practice-course {
  width: 32px;
  border: 1px solid #303b52;
  border-radius: 5px;
  font-size: 15px;
  color: #9caac0;
}
.studio-banner {
  display: flex;
  align-items: center;
  margin-top: 26px;
  padding: 22px 24px;
  background: linear-gradient(90deg, #141b2e, #111624);
  border: 1px solid #293147;
  border-radius: 9px;
  gap: 18px;
}
.studio-icon {
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bba7eb;
  border: 1px solid #49415d;
  background: #302a4150;
  width: 43px;
  height: 43px;
  border-radius: 9px;
}
.studio-banner h3 {
  font-size: 16px;
  margin: 0 0 4px;
  letter-spacing: -0.3px;
}
.studio-banner p {
  font-size: 11px;
  margin: 0;
}
.outlined {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 11px;
  border: 1px solid #3a455e;
  padding: 11px 16px;
  border-radius: 6px;
}
.studio-banner .outlined {
  margin-left: auto;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 27px 0;
  color: #596880;
  font-size: 8px;
  letter-spacing: 1.2px;
}
footer b {
  margin: 0 8px;
}
footer .live-dot {
  margin-left: 9px;
  width: 4px;
  height: 4px;
}
.custom-section {
  margin-top: 35px;
}
.custom-section:has(.level-grid:empty) {
  display: none;
}
.page-title {
  padding: 50px 0 15px;
}
.page-title h1,
.editor-heading h1 {
  font-size: 43px;
  letter-spacing: -2px;
  margin-bottom: 13px;
}
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  margin-bottom: 22px;
}
.panel h2 {
  font-size: 20px;
}
.panel h2 small {
  font: 11px "DM Sans";
  color: var(--muted);
  margin-left: 12px;
}
.record-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.record-summary .panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.record-summary strong {
  font-size: 35px;
  color: var(--mint);
}
.record-summary span {
  color: var(--muted);
  font-size: 12px;
}
.table-wrap {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  text-align: left;
  font-size: 13px;
}
th {
  font-size: 10px;
  color: #95a4bd;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}
th,
td {
  padding: 16px 15px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td:first-child {
  color: var(--mint);
}
.leader-row {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 15px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}
.leader-row b {
  color: var(--mint);
}
.leader-row span:last-child {
  margin-left: auto;
}
.empty-state {
  padding: 22px;
  color: var(--muted);
  font-size: 13px;
}
.editor-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 40px;
  gap: 20px;
}
.editor-heading .eyebrow {
  margin-bottom: 8px;
}
.editor-actions {
  display: flex;
  gap: 14px;
}
.editor-settings {
  display: flex;
  gap: 17px;
  align-items: end;
  padding: 18px;
}
.editor-settings label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 9px;
  letter-spacing: 1.4px;
  color: var(--muted);
  flex: 1;
}
.editor-settings label:first-child {
  flex: 1.5;
}
input:not([type="range"]),
select {
  min-width: 0;
  background: #0a1020;
  border: 1px solid #303b52;
  padding: 10px;
  color: #dce5f4;
  border-radius: 5px;
  font-size: 12px;
  letter-spacing: 0;
  width: 100%;
}
.editor-workspace {
  padding: 0;
  overflow: hidden;
}
.tool-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding: 12px;
}
.tool {
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: #9eacc4;
  font-size: 18px;
  display: flex;
  gap: 7px;
  align-items: center;
}
.tool span {
  font-size: 10px;
}
.tool.selected {
  color: var(--mint);
  border-color: #396254;
  background: #19342f;
}
.tool-divider {
  width: 1px;
  background: #30384d;
  margin: 7px;
}
.editor-scroll {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 17px;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
}
.editor-scroll span {
  white-space: nowrap;
  min-width: 55px;
}
#editor-canvas {
  display: block;
  width: 100%;
  height: 360px;
  touch-action: none;
  cursor: crosshair;
}
.editor-foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 11px;
  color: var(--muted);
}
.editor-foot b {
  color: var(--mint);
  margin-right: 8px;
  font-size: 9px;
}
.editor-warning {
  font-size: 11px;
  margin-top: 15px;
}
.game-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 25px 0 20px;
}
.game-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: "Space Grotesk";
  letter-spacing: 2px;
  font-size: 14px;
}
.game-title small {
  font: 8px "DM Sans";
  color: var(--muted);
  letter-spacing: 1.7px;
}
.game-top-right {
  display: flex;
  gap: 10px;
  align-items: center;
}
.badge {
  font-size: 9px;
  color: #f6d37f;
  border: 1px solid #655336;
  border-radius: 4px;
  padding: 5px 9px;
  letter-spacing: 1px;
}
.game-shell {
  position: relative;
  border: 1px solid #2c3750;
  border-radius: 12px;
  overflow: hidden;
  background: #0b1324;
  touch-action: none;
}
#game-canvas {
  width: 100%;
  height: min(62vh, 570px);
  min-height: 340px;
  display: block;
  touch-action: none;
}
.game-hud {
  position: absolute;
  top: 25px;
  left: 27px;
  right: 27px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.hud-label {
  display: block;
  font-size: 9px;
  letter-spacing: 1.7px;
  color: #9caec5;
}
.game-hud strong {
  font-size: 27px;
  text-shadow: 0 2px 8px #000;
}
.progress-hud {
  width: 29%;
  min-width: 130px;
}
.progress-hud > div:first-child {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.progress-hud #form-label {
  font-size: 10px;
  color: var(--mint);
  letter-spacing: 2px;
}
.progress-track {
  height: 4px;
  margin-top: 7px;
  background: #252d46;
}
.progress-track > div {
  height: 100%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  width: 0;
}
.mode-instruction {
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  text-align: center;
  color: #b0c0da;
  font-size: 10px;
  letter-spacing: 2px;
  pointer-events: none;
  text-shadow: 0 2px 6px #000;
}
.game-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 0;
  color: var(--muted);
  font-size: 11px;
}
.game-bottom > div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}
.keycap,
kbd {
  font: 9px "DM Sans";
  border: 1px solid #3c4661;
  padding: 5px 8px;
  border-radius: 4px;
  color: #b4c1d8;
}
.game-hint i {
  margin: 0 8px;
  color: #505e79;
}
.practice-controls {
  display: none;
  align-items: center;
  gap: 10px;
}
.practice-on .practice-controls {
  display: flex;
}
.practice-on .game-hint {
  display: none;
}
.small {
  font-size: 10px;
  padding: 8px;
}
.small kbd {
  padding: 1px 4px;
}
.touch-action {
  display: none;
  touch-action: none;
  user-select: none;
}
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #060b18a6;
  backdrop-filter: blur(7px);
  padding: 20px;
}
.overlay-card {
  text-align: center;
  background: linear-gradient(145deg, #172339f2, #0e1426f2);
  border: 1px solid #40516a;
  border-radius: 15px;
  padding: 34px;
  min-width: 330px;
  max-width: 95%;
  box-shadow: 0 30px 80px #0007;
}
.overlay-card .eyebrow {
  justify-content: center;
  font-size: 9px;
}
.overlay-card h2 {
  font-size: 42px;
  letter-spacing: -2px;
  margin: 12px 0;
}
.overlay-card p {
  font-size: 13px;
  max-width: 330px;
  margin: 0 auto 23px;
}
.overlay-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.overlay-buttons button {
  width: 100%;
  justify-content: center;
}
.hidden {
  display: none !important;
}
dialog {
  background: #121b2c;
  color: var(--text);
  border: 1px solid #3c4865;
  border-radius: 15px;
  padding: 36px;
  max-width: 620px;
  width: 94%;
  box-shadow: 0 30px 100px #000a;
}
dialog::backdrop {
  background: #050917c9;
  backdrop-filter: blur(7px);
}
dialog > .icon-button {
  float: right;
}
dialog h2 {
  font-size: 32px;
}
dialog p {
  font-size: 13px;
}
.mode-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 24px 0;
}
.mode-guide > div {
  border: 1px solid #2e3b52;
  border-radius: 8px;
  padding: 16px;
}
.mode-guide b {
  color: var(--mint);
  font-family: "Space Grotesk";
}
.mode-guide p {
  margin: 8px 0 0;
  font-size: 12px;
}
#toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 13px 24px;
  background: #213b38;
  border: 1px solid #4c8b79;
  color: #d5ffef;
  border-radius: 8px;
  z-index: 30;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  max-width: 90%;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@keyframes float {
  50% {
    transform: translate(-50%, -57%) rotate(-17deg);
  }
}
@media (min-width: 1600px) {
  .hero {
    min-height: 470px;
  }
  .hero-art {
    height: 440px;
  }
}
@media (max-width: 1000px) {
  .topbar {
    padding: 0 4%;
    gap: 15px;
  }
  nav {
    gap: 20px;
  }
  .brand {
    font-size: 16px;
  }
  .new {
    display: none;
  }
  main {
    padding: 0 4%;
  }
  .hero h1 {
    font-size: 60px;
  }
  .level-grid {
    gap: 11px;
  }
  .card-content {
    padding: 13px;
  }
  .level-name {
    font-size: 19px;
  }
  .hero-meta {
    font-size: 7px;
    letter-spacing: 0.4px;
  }
  .editor-settings {
    flex-wrap: wrap;
  }
  .editor-settings label {
    flex: 1 1 25%;
  }
  .tool {
    padding: 6px;
  }
  .tool-row {
    gap: 1px;
  }
  .hero-art {
    height: 370px;
  }
}
@media (max-width: 720px) {
  .topbar {
    height: 76px;
    flex-wrap: wrap;
    gap: 0;
    padding: 12px 5% 0;
  }
  .brand {
    font-size: 15px;
  }
  .brand-mark {
    font-size: 27px;
  }
  .brand small {
    font-size: 6px;
    left: 39px;
    letter-spacing: 1.8px;
  }
  .top-actions {
    margin-left: auto;
    gap: 6px;
  }
  .top-actions .icon-button {
    width: 29px;
    height: 29px;
    font-size: 15px;
  }
  .volume-wrap {
    width: 42px;
  }
  nav {
    order: 3;
    width: 100%;
    height: 28px;
    justify-content: center;
    gap: 35px;
  }
  .nav {
    font-size: 10px;
  }
  main {
    padding: 0 5%;
  }
  .hero {
    min-height: 365px;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    padding-top: 25px;
  }
  .hero h1 {
    font-size: 47px;
    letter-spacing: -2.8px;
  }
  .hero .eyebrow {
    font-size: 7px;
    letter-spacing: 1px;
    margin-bottom: 13px;
  }
  .hero p {
    font-size: 11px;
    margin-bottom: 18px;
  }
  .hero-art {
    height: 280px;
    margin-right: -20px;
    margin-left: -25px;
  }
  .orbital {
    width: 190px;
    height: 190px;
  }
  .o2 {
    width: 260px;
    height: 260px;
  }
  .cube-art {
    width: 85px;
    height: 85px;
    border-radius: 10px;
  }
  .cube-eyes {
    padding: 18px 15px 0;
  }
  .cube-eyes i {
    width: 15px;
    height: 18px;
  }
  .cube-mouth {
    width: 30px;
    height: 8px;
    margin-top: 8px;
  }
  .chip-top {
    font-size: 13px;
    top: 32px;
    right: 4%;
    padding: 7px;
  }
  .chip-top b {
    font-size: 12px;
    margin-left: 7px;
  }
  .chip-top span {
    font-size: 7px;
  }
  .chip-bottom {
    font-size: 6px;
    gap: 6px;
    left: 4%;
    padding: 8px;
    bottom: 35px;
    letter-spacing: 0.5px;
  }
  .hero-coordinate {
    font-size: 6px;
    bottom: 5px;
  }
  .hero-meta {
    display: none;
  }
  .hero-buttons {
    gap: 15px;
  }
  .hero-buttons .primary {
    font-size: 11px;
    padding: 11px 15px;
    gap: 14px;
  }
  .hero-buttons .quiet {
    font-size: 10px;
    gap: 8px;
  }
  .s1 {
    left: 8%;
    top: 70px;
    font-size: 22px;
  }
  .s2 {
    right: 4%;
  }
  .s3 {
    font-size: 20px;
    right: 16%;
  }
  .section-heading {
    margin-top: 0;
    align-items: center;
  }
  .section-heading h2 {
    font-size: 20px;
  }
  .section-note {
    font-size: 9px;
  }
  .section-heading > .section-note {
    display: none;
  }
  .level-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  .card-art {
    height: 120px;
  }
  .card-content {
    padding: 16px;
  }
  .level-name {
    font-size: 22px;
  }
  .studio-banner {
    padding: 18px;
    gap: 12px;
    flex-wrap: wrap;
  }
  .studio-banner h3 {
    font-size: 15px;
  }
  .studio-banner p {
    font-size: 10px;
  }
  .studio-banner .outlined {
    margin-left: 55px;
    padding: 8px 12px;
    font-size: 10px;
  }
  footer {
    font-size: 6px;
    letter-spacing: 0.6px;
  }
  .editor-heading {
    display: block;
    padding-top: 25px;
  }
  .editor-heading h1,
  .page-title h1 {
    font-size: 33px;
  }
  .editor-actions {
    margin: 20px 0;
  }
  .editor-actions button {
    font-size: 11px;
    padding: 10px;
  }
  .editor-settings {
    gap: 12px;
  }
  .editor-settings label {
    flex: 1 1 40%;
  }
  .editor-settings label:first-child {
    flex: 1 1 40%;
  }
  .tool span {
    font-size: 9px;
  }
  .tool {
    font-size: 16px;
    padding: 6px;
  }
  .tool-divider {
    display: none;
  }
  #editor-canvas {
    height: 300px;
  }
  .editor-foot {
    font-size: 9px;
  }
  .editor-warning {
    font-size: 10px;
  }
  .game-top {
    padding: 20px 0 13px;
  }
  .game-title {
    font-size: 11px;
    letter-spacing: 1px;
  }
  .game-title small {
    font-size: 7px;
  }
  .game-top-right {
    gap: 6px;
  }
  .game-top .quiet {
    font-size: 10px;
    gap: 6px;
  }
  .game-top .icon-button {
    width: 30px;
    height: 30px;
  }
  .badge {
    font-size: 7px;
    padding: 5px;
  }
  .game-hud {
    top: 15px;
    left: 15px;
    right: 15px;
  }
  .game-hud strong {
    font-size: 23px;
  }
  .hud-label {
    font-size: 8px;
  }
  .progress-hud {
    min-width: 110px;
  }
  .game-shell {
    border-radius: 8px;
  }
  #game-canvas {
    height: 52vh;
    min-height: 320px;
  }
  .game-bottom {
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px 0;
  }
  .game-bottom > div:first-child {
    font-size: 10px;
  }
  .game-hint {
    display: none;
  }
  .touch-action {
    display: flex;
    min-height: 54px;
    width: 100%;
    font-size: 13px;
  }
  .practice-controls {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 9px;
  }
  .overlay-card {
    min-width: 260px;
    padding: 23px;
  }
  .overlay-card h2 {
    font-size: 34px;
  }
  .mode-instruction {
    font-size: 8px;
    letter-spacing: 1px;
    bottom: 20px;
  }
  .record-summary {
    gap: 8px;
  }
  .record-summary .panel {
    padding: 13px;
  }
  .record-summary strong {
    font-size: 27px;
  }
  .record-summary span {
    font-size: 9px;
  }
  .panel {
    padding: 16px;
  }
  .panel h2 small {
    display: block;
    margin: 8px 0 0;
  }
  .mode-guide {
    gap: 9px;
  }
  .mode-guide > div {
    padding: 12px;
  }
  dialog {
    padding: 23px;
  }
  .leader-row {
    gap: 12px;
    font-size: 11px;
  }
}
@media (pointer: coarse) {
  .touch-action {
    display: flex;
  }
  .game-hint {
    display: none;
  }
}
@media (max-height: 550px) and (orientation: landscape) {
  body:has(#game.active) .topbar {
    display: none;
  }
  #game-canvas {
    height: 72vh;
    min-height: 210px;
  }
  .game-top {
    padding: 8px 0;
  }
  .game-bottom {
    padding: 8px 0;
    flex-wrap: nowrap;
  }
  .touch-action {
    width: 150px;
    min-height: 35px;
    font-size: 10px;
  }
  .game-hud {
    top: 12px;
  }
  .game-bottom .practice-controls {
    font-size: 8px;
  }
  .mode-instruction {
    bottom: 12px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

.catalog-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  margin: 24px 0;
}
.catalog-controls label {
  display: flex;
  align-items: center;
  gap: 12px;
}
.catalog-controls select {
  background: var(--panel);
  color: var(--text);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 100%;
}
.catalog-controls button:disabled {
  opacity: 0.4;
  cursor: default;
}
@media (max-width: 750px) {
  .topbar nav {
    flex-wrap: wrap;
  }
  .catalog-controls label {
    width: 100%;
    flex-wrap: wrap;
  }
}

/* Installable web app: respect iPhone notch/home-indicator insets and gate outdated sessions. */
html.standalone body {
  padding: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
  min-height: 100dvh;
  box-sizing: border-box;
}
#update-gate {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 13, 25, 0.94);
}
#update-gate.show {
  display: flex;
}
#update-gate .gate-card {
  max-width: 440px;
  padding: 28px;
  border: 1px solid #2a3350;
  border-radius: 16px;
  background: #10162a;
  text-align: center;
}
#update-gate h2 {
  margin: 0 0 10px;
}
#update-gate p {
  margin: 0 0 18px;
  color: #b8c0d8;
  line-height: 1.5;
}

/* Website account button + modal (register / log in / log out). */
.account-button {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
}
.account-button.signed-in {
  background: linear-gradient(135deg, #22d3a6, #7c6cff);
  color: #0a0f1e;
  border-color: transparent;
}
#account-dialog {
  max-width: 440px;
  max-height: 92dvh;
  overflow: auto;
}
#account-dialog [hidden] {
  display: none !important;
}
#account-dialog h2 {
  font-size: 26px;
  margin: 6px 0 16px;
}
.account-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.account-tabs button {
  padding: 8px 14px;
  font-size: 12px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #93a0bc;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  border-radius: 0;
}
.account-tabs button.active {
  color: var(--text);
  border-bottom-color: var(--mint);
}
.account-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.account-form label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #93a0bc;
  margin-top: 8px;
}
.account-form input {
  font-size: 15px;
  padding: 11px 12px;
}
.account-form input[aria-invalid="true"] {
  border-color: #ff6b81;
}
.field-hint,
.field-error {
  font-size: 12px;
  line-height: 1.4;
}
.field-hint {
  color: #7f8aa6;
}
.field-error,
.form-error,
.form-error-inline {
  color: #ff8a9c;
  font-size: 13px;
  line-height: 1.45;
}
.form-error {
  margin: 6px 0 0;
}
.form-error-inline:empty {
  display: none;
}
.account-form button[type="submit"],
#account-logout {
  margin-top: 14px;
  justify-content: center;
}
.account-form button[aria-busy="true"] {
  opacity: 0.7;
  cursor: progress;
}
.link-button {
  color: var(--mint);
  text-decoration: underline;
  padding: 0;
  font: inherit;
  display: inline;
}
.small-note {
  font-size: 12px;
  margin-top: 10px;
}
.signed-line {
  font-size: 16px;
  line-height: 1.5;
}
@media (max-width: 720px) {
  #account-dialog {
    padding: 24px 18px;
    width: 96%;
  }
  .account-form input {
    font-size: 16px; /* prevents iOS zoom on focus */
  }
}
