:root {
  --phos: #57f9c9;
  --phos-dim: #1ca67b;
  --amber: #ffd36f;
  --cyan: #70e5ff;
  --violet: #9a7dff;
  --danger: #ff5f7e;
  --ink: #050816;
  --ink-soft: rgba(7, 15, 30, 0.76);
  --panel: rgba(7, 18, 36, 0.64);
  --panel-strong: rgba(8, 19, 38, 0.86);
  --line: rgba(112, 229, 255, 0.18);
  --font: 'Share Tech Mono', 'VT323', monospace;
  --font-display: 'VT323', 'Share Tech Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #02040c;
  color: #ecffff;
  font-family: var(--font);
  user-select: none;
  -webkit-font-smoothing: none;
}

body {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 15% 20%, rgba(87, 249, 201, 0.14), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(112, 229, 255, 0.16), transparent 24%),
    radial-gradient(circle at 60% 78%, rgba(154, 125, 255, 0.14), transparent 24%),
    linear-gradient(135deg, #010208 0%, #040912 40%, #071323 100%);
}

.ambient {
  position: fixed;
  inset: auto;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.75;
  pointer-events: none;
  z-index: 0;
}

.ambient-a {
  width: 28vw;
  height: 28vw;
  left: -8vw;
  top: 12vh;
  background: rgba(87, 249, 201, 0.18);
  animation: floatA 16s ease-in-out infinite;
}

.ambient-b {
  width: 24vw;
  height: 24vw;
  right: 6vw;
  top: -2vh;
  background: rgba(112, 229, 255, 0.18);
  animation: floatB 18s ease-in-out infinite;
}

.ambient-c {
  width: 34vw;
  height: 34vw;
  right: -10vw;
  bottom: -8vh;
  background: rgba(154, 125, 255, 0.14);
  animation: floatC 20s ease-in-out infinite;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(90vw, 1280px);
  height: min(86vh, 760px);
  height: min(86dvh, 760px);
}

.screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(112, 229, 255, 0.12);
  box-shadow:
    0 24px 72px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  background:
    radial-gradient(circle at center, rgba(11, 44, 33, 0.24), transparent 35%),
    linear-gradient(180deg, rgba(6, 14, 31, 0.34), rgba(3, 7, 18, 0.82));
}

#game {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  /* contain (not cover) so the full playfield is always visible — cover
     crops the wide canvas off-screen on tall/portrait phones. */
  object-fit: contain;
  image-rendering: pixelated;
  touch-action: none;             /* taps act instantly, no zoom/scroll */
  -webkit-tap-highlight-color: transparent;
}

.scene-noise,
.scene-grid,
.scanlines,
.vignette,
.flicker {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.scene-noise {
  z-index: 5;
  background:
    linear-gradient(0deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02)),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.02) 0 1px,
      transparent 1px 120px
    );
  mix-blend-mode: soft-light;
  opacity: 0.22;
}

.scene-grid {
  z-index: 6;
  background:
    linear-gradient(rgba(112, 229, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(112, 229, 255, 0.08) 1px, transparent 1px);
  background-size: 100% 64px, 64px 100%;
  mask-image: linear-gradient(180deg, transparent 0%, black 20%, black 80%, transparent 100%);
  opacity: 0.4;
}

.scanlines {
  z-index: 40;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0,
    rgba(0, 0, 0, 0) 2px,
    rgba(0, 0, 0, 0.18) 3px,
    rgba(0, 0, 0, 0.18) 4px
  );
  mix-blend-mode: multiply;
}

.vignette {
  z-index: 41;
  background:
    radial-gradient(circle at center, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.64) 100%);
}

.flicker {
  z-index: 42;
  background: rgba(87, 249, 201, 0.022);
  animation: flicker 4.8s infinite steps(72);
}

.hud {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  pointer-events: none;
}

.hud-cluster {
  align-self: flex-start;
  backdrop-filter: blur(20px);
  background:
    linear-gradient(180deg, rgba(7, 16, 34, 0.84), rgba(5, 12, 26, 0.68)),
    linear-gradient(90deg, rgba(112, 229, 255, 0.04), rgba(87, 249, 201, 0.02));
  border: 1px solid rgba(112, 229, 255, 0.14);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.hud-primary {
  min-width: min(640px, calc(100vw - 48px));
  border-radius: 12px;
  padding: 14px 16px 13px;
}

.hud-secondary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-radius: 10px;
  padding: 8px 10px;
}

.hud-kicker,
.launch-kicker,
.eyebrow,
.wallet-label,
.feature-label,
.char-select-label,
.selected-family-label {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--amber);
}

.hud-topline,
.hud-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.hud-topline {
  margin: 10px 0 14px;
  flex-wrap: wrap;
}

.hud-metric {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid rgba(112, 229, 255, 0.14);
  background: rgba(255, 255, 255, 0.025);
  font-size: clamp(10px, 1vw, 13px);
  color: rgba(236, 255, 255, 0.86);
}

.hud-metric b,
.hud-val,
.hud-ability,
.over-stats b,
.panel-title,
.selected-family-name,
.feature-card h3,
.launch-title {
  color: #fff;
}

.hud-label {
  min-width: 152px;
  letter-spacing: 0.16em;
  font-size: clamp(11px, 1vw, 13px);
  color: rgba(236, 255, 255, 0.78);
}

.hud-label.danger {
  color: var(--danger);
  text-shadow: 0 0 10px rgba(255, 95, 126, 0.45);
}

.hud-val,
.hud-ability {
  font-size: clamp(11px, 1vw, 14px);
  letter-spacing: 0.08em;
}

.hud-ability {
  margin-left: auto;
  color: var(--cyan);
}

.hud-chip {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(87, 249, 201, 0.16);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(236, 255, 255, 0.82);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.hud-chip-alt {
  border-color: rgba(112, 229, 255, 0.26);
}

.bar {
  flex: 1;
  height: 12px;
  overflow: hidden;
  border-radius: 4px;
  border: 1px solid rgba(112, 229, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.4);
}

.bar-fill {
  width: 100%;
  height: 100%;
  transition: width 0.12s linear;
}

.bar-fill.stability {
  background: linear-gradient(90deg, var(--phos-dim), var(--phos));
  box-shadow: 0 0 18px rgba(87, 249, 201, 0.42);
}

.bar-fill.eraser {
  background: linear-gradient(90deg, #8a1730, var(--danger));
  box-shadow: 0 0 18px rgba(255, 95, 126, 0.35);
}

.screen-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 24px 32px;
  background: linear-gradient(180deg, rgba(2, 6, 16, 0.52), rgba(2, 6, 16, 0.84));
  backdrop-filter: blur(12px);
  overflow-y: auto;
  overflow-x: hidden;
}

.screen-overlay.mini {
  background: rgba(2, 6, 16, 0.42);
}

.boot-log {
  width: min(920px, 90vw);
  min-height: 210px;
  padding: 24px 28px;
  border-radius: 10px;
  border: 1px solid rgba(87, 249, 201, 0.2);
  background: rgba(3, 12, 16, 0.78);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  color: var(--phos);
  line-height: 1.55;
  font-size: clamp(11px, 1vw, 15px);
  white-space: pre-wrap;
  text-align: left;
}

.title-block {
  width: min(1380px, calc(100vw - 64px));
  animation: fadein 0.45s ease;
  margin: auto 0;
}

.start-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.hero-panel,
.launch-panel,
.modal-card {
  border-radius: 12px;
  border: 1px solid rgba(112, 229, 255, 0.14);
  background:
    linear-gradient(180deg, rgba(8, 18, 38, 0.92), rgba(4, 10, 24, 0.82)),
    linear-gradient(90deg, rgba(112,229,255,0.03), rgba(255,255,255,0));
  box-shadow:
    0 18px 52px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
}

.hero-panel {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 0;
  background:
    radial-gradient(circle at top left, rgba(112, 229, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(8, 18, 38, 0.92), rgba(4, 10, 24, 0.8));
}

.hero-copy {
  max-width: 720px;
}

.title {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(56px, 7vw, 112px);
  line-height: 0.78;
  letter-spacing: 0.06em;
  color: #fff;
  text-shadow:
    0 0 14px rgba(87, 249, 201, 0.52),
    0 0 40px rgba(112, 229, 255, 0.38),
    6px 0 rgba(255, 95, 126, 0.38),
    -6px 0 rgba(112, 229, 255, 0.35);
}

.subtitle {
  margin-top: 12px;
  font-size: clamp(11px, 1.2vw, 15px);
  letter-spacing: 0.18em;
  color: var(--amber);
}

.lore {
  margin-top: 14px;
  max-width: 720px;
  font-size: clamp(12px, 1.05vw, 15px);
  line-height: 1.6;
  color: rgba(236, 255, 255, 0.8);
}

.lore-hi {
  color: var(--cyan);
  text-shadow: 0 0 12px rgba(112, 229, 255, 0.35);
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.feature-card {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 14px;
  border-radius: 10px;
  border: 1px solid rgba(112, 229, 255, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015));
}

.feature-card::after {
  content: '';
  position: absolute;
  inset: auto -15% -40% auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(112, 229, 255, 0.18), transparent 62%);
}

.feature-card h3 {
  margin-top: 10px;
  font-size: 18px;
  line-height: 1;
  font-family: var(--font-display);
  letter-spacing: 0.05em;
}

.feature-card p {
  margin-top: 10px;
  max-width: 26ch;
  color: rgba(236, 255, 255, 0.72);
  line-height: 1.45;
  font-size: 11px;
}

.launch-panel {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background:
    radial-gradient(circle at top right, rgba(87, 249, 201, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(7, 16, 33, 0.96), rgba(5, 12, 25, 0.88));
}

.launch-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.launch-title {
  margin-top: 6px;
  font-size: clamp(20px, 2vw, 30px);
  font-family: var(--font-display);
  line-height: 0.95;
  letter-spacing: 0.05em;
}

.launch-badge {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(112, 229, 255, 0.1);
  border: 1px solid rgba(112, 229, 255, 0.2);
  color: var(--cyan);
  letter-spacing: 0.12em;
  font-size: 10px;
}

.selected-family-card {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(87, 249, 201, 0.14);
  background: rgba(255, 255, 255, 0.03);
}

.selected-family-color {
  width: 10px;
  height: 56px;
  border-radius: 3px;
  background: var(--phos);
  box-shadow: 0 0 20px currentColor;
}

.selected-family-name {
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

.selected-family-passive {
  margin-top: 6px;
  color: rgba(236, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.45;
}

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

.char-tile {
  position: relative;
  overflow: hidden;
  min-height: 82px;
  padding: 12px 10px;
  border-radius: 10px;
  border: 1px solid rgba(112, 229, 255, 0.14);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  color: rgba(236, 255, 255, 0.88);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.char-tile::before {
  content: '';
  position: absolute;
  inset: auto -25% -45% auto;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: radial-gradient(circle, var(--family-color), transparent 68%);
  opacity: 0.18;
}

.char-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(112, 229, 255, 0.3);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.18);
}

.char-tile.active {
  border-color: var(--family-color);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 34px rgba(0, 0, 0, 0.28),
    inset 0 0 24px rgba(255, 255, 255, 0.03),
    0 0 24px var(--family-color);
  background: linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025));
}

.char-glyph {
  position: relative;
  z-index: 1;
  font-size: 28px;
  line-height: 1;
}

.char-name {
  position: relative;
  z-index: 1;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: #fff;
}

.char-role {
  position: relative;
  z-index: 1;
  font-size: 11px;
  color: rgba(236, 255, 255, 0.66);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.char-ability {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(112, 229, 255, 0.14);
  background: rgba(255, 255, 255, 0.03);
  color: var(--cyan);
  line-height: 1.45;
  font-size: 12px;
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 11px 14px;
  font-family: var(--font);
  font-size: clamp(11px, 1vw, 13px);
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.14s ease, color 0.14s ease;
  pointer-events: auto;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--cyan), #47ffd5 80%);
  color: #04101a;
  box-shadow: 0 18px 34px rgba(80, 224, 255, 0.26);
  font-weight: 700;
}

.btn-primary:hover {
  box-shadow: 0 20px 40px rgba(80, 224, 255, 0.34);
}

.btn-ghost,
.btn-wallet {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(236, 255, 255, 0.92);
  border: 1px solid rgba(112, 229, 255, 0.16);
}

.btn-ghost:hover,
.btn-wallet:hover {
  background: rgba(112, 229, 255, 0.12);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.start-meta,
.over-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.launch-notes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.meta-pill {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(112, 229, 255, 0.12);
  color: rgba(236, 255, 255, 0.66);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.modal-card {
  width: min(760px, calc(100vw - 64px));
  padding: 24px;
  text-align: center;
}

.pass-card {
  width: min(640px, calc(100vw - 64px));
}

.pass-recall {
  letter-spacing: 0.35em;
  color: var(--amber);
  font-size: clamp(13px, 1.3vw, 18px);
}

.pass-num {
  margin-top: 12px;
  font-family: var(--font-display);
  font-size: clamp(52px, 7vw, 92px);
  color: #fff;
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(87, 249, 201, 0.48);
}

.pass-msg {
  margin-top: 10px;
  color: var(--cyan);
  letter-spacing: 0.28em;
  animation: blink 0.8s steps(2) infinite;
}

.pass-cells {
  margin-top: 18px;
  color: var(--phos);
  font-size: clamp(16px, 2vw, 24px);
  letter-spacing: 0.18em;
}

.over-card,
.panel-card {
  max-width: 860px;
}

.over-title {
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 92px);
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(255, 95, 126, 0.4);
}

.over-sub {
  margin-top: 8px;
  color: rgba(236, 255, 255, 0.62);
  font-size: clamp(13px, 1.4vw, 16px);
}

.over-stats {
  margin-top: 24px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.over-stats div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(112, 229, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(236, 255, 255, 0.68);
}

.web3-actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.glitch {
  position: relative;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.glitch::before {
  color: var(--cyan);
  animation: gl1 2.2s infinite linear alternate-reverse;
}

.glitch::after {
  color: var(--danger);
  animation: gl2 1.6s infinite linear alternate-reverse;
}

.panel-title {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 54px);
  letter-spacing: 0.08em;
}

.panel-body {
  margin-top: 18px;
  width: 100%;
  max-height: min(56vh, 560px);
  overflow-y: auto;
  text-align: left;
}

.lb-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  gap: 12px;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(112, 229, 255, 0.1);
}

.lb-row.head {
  color: var(--amber);
  letter-spacing: 0.12em;
}

.lb-row .addr {
  color: var(--cyan);
  overflow: hidden;
  text-overflow: ellipsis;
}

.help-list {
  color: rgba(236, 255, 255, 0.78);
  line-height: 1.85;
  font-size: clamp(13px, 1.3vw, 16px);
}

.help-list .k {
  color: var(--cyan);
}

.wallet-bar {
  position: absolute;
  top: 24px;
  right: 24px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(112, 229, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(7, 17, 34, 0.86), rgba(7, 17, 34, 0.72)),
    linear-gradient(90deg, rgba(112,229,255,0.04), rgba(87,249,201,0.02));
  backdrop-filter: blur(18px);
}

.wallet-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.wallet-net {
  color: rgba(236, 255, 255, 0.76);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.btn-wallet.connected {
  border-color: rgba(87, 249, 201, 0.3);
  color: var(--phos);
}

.touch-controls {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 20px;
  z-index: 36;
  display: flex;
  gap: 12px;
  justify-content: center;
}

.touch-btn {
  flex: 1;
  max-width: 220px;
  border: 1px solid rgba(112, 229, 255, 0.18);
  border-radius: 8px;
  background: rgba(7, 18, 36, 0.82);
  color: #fff;
  padding: 18px 12px;
  font-family: var(--font);
  letter-spacing: 0.12em;
  touch-action: manipulation;     /* kill 300ms tap delay / double-tap zoom */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.touch-btn-jump {
  box-shadow: inset 0 0 24px rgba(87, 249, 201, 0.12);
}

.touch-btn-duck {
  box-shadow: inset 0 0 24px rgba(255, 211, 111, 0.08);
}

.touch-btn-ability {
  box-shadow: inset 0 0 24px rgba(112, 229, 255, 0.12);
}

.touch-btn:active {
  background: rgba(112, 229, 255, 0.18);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  max-width: min(90vw, 520px);
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(87, 249, 201, 0.24);
  background: rgba(7, 18, 36, 0.88);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.32);
  color: rgba(236, 255, 255, 0.94);
  text-align: center;
  letter-spacing: 0.08em;
  font-size: 13px;
}

.hidden { display: none !important; }

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(87, 249, 201, 0.28);
}

@keyframes fadein {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes blink {
  50% { opacity: 0.28; }
}

@keyframes flicker {
  0%, 100% { opacity: 0.2; }
  8% { opacity: 0.28; }
  10% { opacity: 0.08; }
  52% { opacity: 0.24; }
  54% { opacity: 0.36; }
}

@keyframes gl1 {
  0% { clip-path: inset(0 0 80% 0); transform: translate(-3px, 0); }
  50% { clip-path: inset(50% 0 20% 0); }
  100% { clip-path: inset(20% 0 40% 0); transform: translate(2px, 0); }
}

@keyframes gl2 {
  0% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 0); }
  50% { clip-path: inset(20% 0 60% 0); }
  100% { clip-path: inset(70% 0 5% 0); transform: translate(-2px, 0); }
}

@keyframes floatA {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(5vw, -4vh, 0); }
}

@keyframes floatB {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-4vw, 6vh, 0); }
}

@keyframes floatC {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-5vw, -5vh, 0); }
}

@media (max-width: 1120px) {
  .start-layout {
    grid-template-columns: 1fr;
  }

  .hero-panel {
    min-height: 0;
  }

  .feature-strip {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 860px) {
  .app-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  .screen-overlay {
    padding: 12px 12px calc(20px + env(safe-area-inset-bottom));
  }

  .title-block {
    width: calc(100vw - 24px);
  }

  .hero-panel,
  .launch-panel,
  .modal-card {
    padding: 16px;
    border-radius: 12px;
  }

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

  .hud {
    padding: 10px 10px calc(88px + env(safe-area-inset-bottom));
  }

  .hud-primary {
    min-width: 0;
    width: min(320px, calc(100vw - 20px));
    padding: 10px 11px;
  }

  .hud-label {
    min-width: 112px;
    font-size: 10px;
    letter-spacing: 0.08em;
  }

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

  .hud-metric {
    padding: 5px 7px;
    font-size: 9px;
  }

  .hud-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 8px;
    align-items: center;
  }

  .hud-label {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .hud-val,
  .hud-ability {
    font-size: 10px;
  }

  .hud-ability {
    margin-left: 0;
    text-align: right;
  }

  .over-stats {
    grid-template-columns: 1fr;
  }

  .touch-controls {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
  }

  .screen {
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .hud-secondary {
    display: none;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
  }

  .title {
    font-size: 44px;
  }

  .subtitle,
  .eyebrow,
  .launch-kicker,
  .wallet-label,
  .feature-label,
  .selected-family-label {
    letter-spacing: 0.2em;
  }

  .char-grid,
  .feature-strip {
    grid-template-columns: 1fr;
  }

  .launch-head,
  .start-meta,
  .over-buttons {
    flex-direction: column;
    align-items: stretch;
  }

  .hud {
    padding: 8px 8px calc(84px + env(safe-area-inset-bottom));
  }

  .hud-primary {
    width: min(280px, calc(100vw - 16px));
    padding: 9px 10px 10px;
  }

  .hud-kicker {
    font-size: 9px;
    letter-spacing: 0.18em;
  }

  .selected-family-card {
    align-items: flex-start;
  }

  .selected-family-color {
    height: 48px;
  }

  .feature-card {
    min-height: 0;
  }

  .touch-controls {
    gap: 8px;
  }

  .touch-btn {
    max-width: none;
    min-height: 56px;
    padding: 12px 8px;
    font-size: 12px;
  }

}
