@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("/fonts/inter-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --ink: #0b0c10;
  --ink-2: #12141a;
  --panel: #181b22;
  --panel-2: #222630;
  --paper: #f8f3e8;
  --muted: #b0b3bb;
  --line: rgba(255, 255, 255, 0.12);
  --acid: #ffc857;
  --acid-strong: #ffb627;
  --coral: #ff5f56;
  --violet: #9b87f5;
  --sky: #63d7ff;
  --success: #65d58a;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.45);
  --radius: 24px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --page-gutter: clamp(12px, 4vw, 24px);
  --surface-pad: clamp(16px, 3vw, 24px);
  --topbar-height: 68px;
  --viewport-width-offset: 56.25px;
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

:where(h1, h2, h3, p, ol, ul) {
  margin: 0;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: var(--ink);
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--paper);
}

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

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

#gameCanvas:focus-visible {
  position: relative;
  z-index: 3;
  outline: 3px solid var(--sky);
  outline-offset: -4px;
}

.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
  opacity: 0.12;
  mix-blend-mode: soft-light;
  background-image:
    radial-gradient(circle at 15% 25%, rgba(255, 255, 255, .18) 0 1px, transparent 1.5px),
    radial-gradient(circle at 75% 65%, rgba(255, 255, 255, .11) 0 1px, transparent 1.5px);
  background-size: 7px 7px, 11px 11px;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: var(--topbar-height) minmax(0, 1fr);
  background: var(--ink);
}

.topbar {
  width: min(100%, 1060px);
  height: var(--topbar-height);
  margin-inline: auto;
  padding: env(safe-area-inset-top) max(var(--page-gutter), env(safe-area-inset-right)) 0 max(var(--page-gutter), env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 20;
}

.brand {
  color: var(--paper);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand > span:last-child span {
  color: var(--acid);
}

.brand-mark {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  padding: 5px;
  transform: skew(-7deg);
  background: var(--acid);
  border-radius: 7px;
}

.brand-mark i {
  width: 3px;
  height: 10px;
  display: block;
  background: var(--ink);
  border-radius: 4px;
}

.brand-mark i:nth-child(2) {
  height: 15px;
}

.brand-mark i:nth-child(3) {
  height: 7px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.top-nav-button {
  min-height: 44px;
  padding: 0 var(--space-2);
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 850;
}

.top-nav-button:hover {
  color: var(--paper);
}

.connection-badge,
.guest-pill {
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1;
  padding: 7px 8px;
  text-transform: uppercase;
  border-radius: 999px;
}

.guest-pill.verified {
  color: #111218;
  border-color: var(--acid);
  background: var(--acid);
}

.icon-button,
.text-icon-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--paper);
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  position: relative;
}

.icon-button:hover,
.text-icon-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

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

.notification-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  top: 4px;
  right: 3px;
  background: var(--coral);
  border: 2px solid var(--ink);
  border-radius: 50%;
}

.main-layout {
  width: min(100%, 980px);
  min-height: 0;
  margin-inline: auto;
  display: grid;
  justify-content: center;
  align-items: center;
  padding: var(--space-2) var(--page-gutter) var(--space-5);
}

.game-column {
  min-width: 0;
  display: grid;
  place-items: center;
}

.game-viewport {
  width: min(100%, 432px, calc(56.25dvh - var(--viewport-width-offset)));
  aspect-ratio: 9 / 16;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #151326;
  border-radius: 26px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 0, 0, 0.35);
  isolation: isolate;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

.game-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.3);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.18), transparent 22%, transparent 70%, rgba(0, 0, 0, 0.28));
}

.game-hud {
  position: absolute;
  z-index: 5;
  left: 16px;
  right: 16px;
  top: 18px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.hud-pill {
  min-width: 68px;
  padding: 8px 10px;
  background: rgba(8, 9, 14, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  display: grid;
  gap: 1px;
}

.hud-pill-right {
  text-align: right;
}

.hud-pill span,
.mode-badge {
  color: rgba(255, 255, 255, 0.65);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.13em;
}

.hud-pill strong {
  font-size: 15px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.mode-badge {
  margin-top: 3px;
  color: var(--ink);
  background: var(--acid);
  padding: 7px 10px;
  border-radius: 999px;
}

.hud-center {
  display: grid;
  justify-items: center;
  gap: 5px;
}

.trap-progress-badge {
  padding: 5px 8px;
  color: rgba(255, 255, 255, .78);
  background: rgba(8, 9, 14, .72);
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .1em;
  line-height: 1;
}

.mode-badge.overtime {
  color: white;
  background: var(--violet);
}

.progress-track {
  position: absolute;
  z-index: 6;
  height: 3px;
  left: 16px;
  right: 16px;
  top: 76px;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  overflow: hidden;
}

.progress-track i {
  width: 0;
  height: 100%;
  display: block;
  background: var(--acid);
  box-shadow: 0 0 10px rgba(216, 255, 67, 0.75);
  transition: width 80ms linear;
}

.creator-test-exit {
  position: absolute;
  z-index: 9;
  top: 86px;
  right: 16px;
  min-height: 44px;
  padding: 8px 12px;
  color: var(--paper);
  background: rgba(8, 9, 14, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  cursor: pointer;
  touch-action: manipulation;
}

.creator-test-exit:hover,
.creator-test-exit:focus-visible {
  color: var(--ink);
  background: var(--acid);
  border-color: var(--acid);
  outline: none;
}

.tap-cue {
  position: absolute;
  z-index: 5;
  bottom: 54px;
  left: 50%;
  translate: -50% 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  background: rgba(8, 9, 14, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.13);
  backdrop-filter: blur(12px);
  color: white;
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.11em;
  pointer-events: none;
  animation: cue-bob 1.2s ease-in-out infinite;
}

.tap-icon {
  width: 19px;
  height: 19px;
  border: 2px solid var(--acid);
  display: inline-block;
  border-radius: 50%;
  position: relative;
}

.tap-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  inset: 5px;
  background: var(--acid);
  border-radius: 50%;
}

@keyframes cue-bob {
  50% { translate: -50% -4px; }
}

.countdown {
  position: absolute;
  z-index: 8;
  top: clamp(118px, 21%, 160px);
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  translate: -50% 0;
  font-size: clamp(31px, 9vw, 48px);
  line-height: .92;
  font-weight: 1000;
  font-style: italic;
  letter-spacing: -0.08em;
  text-align: center;
  text-shadow: 0 4px 0 rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.countdown.failure-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  letter-spacing: 0;
}

.countdown.failure-countdown span {
  font-size: .48em;
  line-height: 1;
  letter-spacing: .08em;
}

.countdown.failure-countdown small {
  color: rgba(244, 240, 231, .72);
  font-size: .22em;
  font-style: normal;
  line-height: 1;
  letter-spacing: .18em;
}

.countdown.failure-countdown strong {
  font-size: 1em;
  line-height: .82;
  font-variant-numeric: tabular-nums;
}

.level-announcement {
  position: absolute;
  z-index: 7;
  top: clamp(84px, 13%, 118px);
  left: 50%;
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 15px 7px;
  color: var(--paper);
  background: rgba(10, 11, 16, .74);
  border: 1px solid rgba(216, 255, 67, .5);
  border-radius: 999px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .24);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  pointer-events: none;
  opacity: 0;
  translate: -50% -7px;
}

.level-announcement strong {
  color: var(--acid);
  font-size: 21px;
  line-height: 1;
  letter-spacing: -.02em;
}

.level-announcement.level-announcement-live {
  animation: level-announcement-fade 1.65s ease both;
}

.level-announcement.level-announcement-opening {
  animation-duration: .8s;
}

@keyframes level-announcement-fade {
  0% { opacity: 0; translate: -50% -7px; }
  14%, 66% { opacity: 1; translate: -50% 0; }
  100% { opacity: 0; translate: -50% 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .level-announcement.level-announcement-live {
    animation-duration: .8s;
  }
}

/* Global Relay is a separate daily competition surface. Its fixed geometry,
   event stream, and ad placeholders must not inherit private-relay state. */
.global-relay-root {
  min-height: 100dvh;
  color: var(--paper);
  background:
    linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px),
    var(--ink);
  background-size: 32px 32px;
}

.global-topbar {
  width: min(100%, 1100px);
  min-height: var(--topbar-height);
  margin-inline: auto;
  padding: env(safe-area-inset-top) max(var(--page-gutter), env(safe-area-inset-right)) 0 max(var(--page-gutter), env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.global-top-actions,
.global-live-dot,
.global-kicker {
  display: flex;
  align-items: center;
}

.global-top-actions {
  gap: var(--space-2);
}

.global-live-dot {
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .1em;
}

.global-live-dot i {
  width: 8px;
  height: 8px;
  display: block;
  background: var(--success);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(101, 213, 138, .12);
}

.global-main {
  width: min(100%, 1040px);
  min-height: calc(100dvh - var(--topbar-height));
  margin-inline: auto;
  padding: clamp(24px, 5vw, 64px) var(--page-gutter) max(32px, env(safe-area-inset-bottom));
}

.global-lobby {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: center;
  gap: clamp(24px, 6vw, 72px);
}

.global-hero,
.global-auth,
.global-state-panel,
.global-play-heading,
.global-builder-heading,
.global-builder {
  display: grid;
  gap: var(--space-3);
}

.global-hero {
  max-width: 660px;
}

.global-kicker {
  min-width: 0;
  justify-content: space-between;
  gap: var(--space-3);
  color: var(--acid);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.global-kicker time,
.global-kicker strong {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.global-kicker.danger {
  color: var(--coral);
}

.global-kicker.success {
  color: var(--success);
}

.global-hero h1,
.global-auth h1,
.global-state-panel h1,
.global-play-heading h1,
.global-builder-heading h1 {
  max-width: 820px;
  color: var(--paper);
  font-size: clamp(38px, 7vw, 78px);
  line-height: .96;
  letter-spacing: 0;
}

.global-hero h1 em {
  color: var(--acid);
  font-style: normal;
}

.global-hero > p,
.global-auth > p,
.global-state-panel > p,
.global-play-heading > p,
.global-builder-heading > p {
  max-width: 620px;
  color: var(--muted);
  font-size: clamp(14px, 2vw, 18px);
  line-height: 1.55;
}

.global-level-track {
  display: grid;
  grid-template-columns: repeat(24, minmax(4px, 1fr));
  gap: 4px;
}

.global-level-track i {
  height: 9px;
  display: block;
  background: var(--panel-2);
  border-radius: 2px;
}

.global-level-track i.live {
  background: var(--acid);
  box-shadow: 0 0 12px rgba(255, 200, 87, .2);
}

.global-stats {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
}

.global-stats div {
  min-width: 0;
  padding: var(--space-3) 0;
}

.global-stats dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.global-stats dd {
  margin: var(--space-1) 0 0;
  color: var(--paper);
  font-size: 24px;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.global-button,
.global-link-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.global-button {
  width: min(100%, 380px);
  color: var(--ink);
  background: var(--acid);
  border: 2px solid var(--paper);
  border-radius: 6px;
  box-shadow: 6px 6px 0 rgba(255, 255, 255, .15);
}

.global-button:hover {
  background: #ffdc91;
}

.global-button:disabled {
  cursor: wait;
  opacity: .55;
}

.global-link-button {
  width: fit-content;
  color: var(--paper);
  background: transparent;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.global-account-note,
.global-integrity-note {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

.global-ad-slot {
  width: 100%;
  min-width: 0;
  height: 250px;
  display: grid;
  place-items: center;
  color: rgba(248, 243, 232, .46);
  background: rgba(255, 255, 255, .025);
  border: 1px dashed rgba(255, 255, 255, .16);
  border-radius: 4px;
  contain: strict;
}

.global-ad-slot span {
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.global-state-panel .global-ad-slot {
  max-width: 420px;
  height: 120px;
}

.global-auth-main,
.global-state-main {
  display: grid;
  place-items: center;
}

.global-auth,
.global-state-panel {
  width: min(100%, 680px);
}

.global-auth form {
  display: grid;
  gap: var(--space-2);
}

.global-auth label,
.global-builder label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.global-auth input,
.global-builder select {
  width: 100%;
  min-height: 52px;
  margin-top: var(--space-1);
  padding: 0 var(--space-3);
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  font: inherit;
  font-size: 16px;
}

.global-form-error {
  color: var(--coral);
  font-size: 11px;
}

.global-play-main {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(280px, 432px);
  align-items: center;
  gap: clamp(20px, 5vw, 64px);
}

.global-game-frame {
  width: min(100%, 432px);
  aspect-ratio: 9 / 16;
  position: relative;
  overflow: hidden;
  background: #11131a;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

#globalGameCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: pointer;
  touch-action: manipulation;
}

.global-game-hud {
  position: absolute;
  z-index: 4;
  top: 16px;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
  pointer-events: none;
}

.global-game-hud span {
  padding: 7px 9px;
  color: var(--paper);
  background: rgba(11, 12, 16, .76);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
}

.global-game-progress {
  position: absolute;
  z-index: 4;
  top: 58px;
  left: 16px;
  right: 16px;
  height: 4px;
  overflow: hidden;
  background: rgba(255, 255, 255, .16);
  border-radius: 2px;
}

.global-game-progress i {
  width: 0;
  height: 100%;
  display: block;
  background: var(--acid);
}

.global-game-message {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 24px;
  translate: -50% 0;
  padding: 9px 12px;
  color: var(--paper);
  background: rgba(11, 12, 16, .8);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 10px;
  font-weight: 950;
  white-space: nowrap;
  pointer-events: none;
}

.global-opaque-cue {
  width: min(78%, 300px);
  min-height: 112px;
  margin: 0;
  padding: var(--space-2);
  position: absolute;
  z-index: 5;
  top: 86px;
  left: 50%;
  translate: -50% 0;
  display: grid;
  place-items: center;
  gap: var(--space-1);
  color: var(--paper);
  background: rgba(11, 12, 16, .88);
  border: 2px solid var(--acid);
  border-radius: 4px;
  pointer-events: none;
}

.global-opaque-cue img {
  width: 100%;
  height: 82px;
  display: block;
  object-fit: contain;
}

.global-opaque-cue figcaption {
  font-size: 10px;
  font-weight: 950;
  letter-spacing: .1em;
}

.global-broken-panel .global-button,
.global-frontier-panel .global-button,
.global-recap-panel .global-button {
  margin-top: var(--space-2);
}

.global-countdown,
.global-build-clock {
  color: var(--acid);
  font-size: clamp(48px, 12vw, 92px);
  font-weight: 950;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.global-ready-toggle {
  min-height: 72px;
  max-width: 520px;
  padding: var(--space-3);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 54px;
  align-items: center;
  gap: var(--space-3);
  color: var(--paper);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  cursor: pointer;
}

.global-ready-toggle > span {
  display: grid;
  gap: 3px;
}

.global-ready-toggle strong {
  font-size: 13px;
}

.global-ready-toggle small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
}

.global-ready-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.global-ready-toggle > i {
  width: 52px;
  height: 30px;
  padding: 3px;
  display: block;
  background: #3a3d47;
  border-radius: 99px;
}

.global-ready-toggle > i::before {
  content: "";
  width: 24px;
  height: 24px;
  display: block;
  background: var(--paper);
  border-radius: 50%;
  transition: translate 160ms ease;
}

.global-ready-toggle input:checked + i {
  background: var(--success);
}

.global-ready-toggle input:checked + i::before {
  translate: 22px 0;
}

.global-ready-toggle:focus-within {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
}

.global-builder-main {
  display: grid;
  grid-template-columns: minmax(240px, .7fr) minmax(420px, 1.3fr);
  align-items: start;
  gap: clamp(24px, 5vw, 64px);
}

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

.global-builder > :is(.global-builder-status, .global-button, .global-integrity-note) {
  grid-column: 1 / -1;
}

.global-builder-station {
  min-width: 0;
  margin: 0;
  padding: var(--space-3);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.global-builder-station legend {
  padding: 0 6px;
  color: var(--acid);
  font-size: 11px;
  font-weight: 950;
}

.global-door-options {
  margin-top: var(--space-2);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.global-door-options button {
  min-width: 0;
  min-height: 42px;
  padding: 5px;
  color: var(--muted);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  font: inherit;
  font-size: 10px;
  font-weight: 900;
  cursor: pointer;
}

.global-door-options button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--acid);
  border-color: var(--acid);
}

.global-builder-status {
  color: var(--muted);
  font-size: 10px;
}

.global-skeleton {
  width: min(100%, 720px);
  margin: clamp(30px, 8vw, 100px) auto 0;
  display: grid;
  gap: var(--space-3);
}

.global-skeleton-line,
.global-skeleton-stage {
  display: block;
  background: var(--panel);
  animation: global-skeleton-pulse 900ms ease-in-out infinite alternate;
}

.global-skeleton-line {
  width: 45%;
  height: 18px;
}

.global-skeleton-line.wide {
  width: 72%;
}

.global-skeleton-stage {
  width: 100%;
  height: 220px;
}

@keyframes global-skeleton-pulse {
  to { background: var(--panel-2); }
}

.global-toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  translate: -50% 0;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  color: var(--ink);
  background: var(--paper);
  border-radius: 4px;
  box-shadow: var(--shadow);
  font-size: 11px;
  font-weight: 850;
}

@media (max-width: 760px) {
  .global-lobby,
  .global-play-main,
  .global-builder-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .global-lobby {
    align-items: start;
  }

  .global-lobby > .global-ad-slot {
    height: 100px;
  }

  .global-play-heading {
    order: 2;
  }

  .global-game-frame {
    justify-self: center;
  }
}

@media (max-width: 520px) {
  .global-topbar .brand > span:last-child {
    display: none;
  }

  .global-main {
    padding-top: var(--space-4);
  }

  .global-hero h1,
  .global-auth h1,
  .global-state-panel h1,
  .global-play-heading h1,
  .global-builder-heading h1 {
    font-size: 38px;
  }

  .global-stats dd {
    font-size: 20px;
  }

  .global-builder {
    grid-template-columns: minmax(0, 1fr);
  }

  .global-builder > :is(.global-builder-status, .global-button, .global-integrity-note) {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-skeleton-line,
  .global-skeleton-stage {
    animation: none;
  }

  .global-ready-toggle > i::before {
    transition: none;
  }
}

/* Global Relay styles end. */

.action-sheet {
  position: absolute;
  z-index: 10;
  left: var(--space-3);
  right: var(--space-3);
  bottom: var(--space-3);
  max-height: calc(100% - var(--space-5));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-3) var(--surface-pad) max(var(--space-4), env(safe-area-inset-bottom));
  background: rgba(244, 240, 231, 0.97);
  color: #111218;
  border: 1px solid rgba(255, 255, 255, 0.46);
  box-shadow: 0 -14px 55px rgba(4, 5, 8, 0.32);
  border-radius: 23px;
  transform: translateY(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
  transition: transform 480ms cubic-bezier(.2,.8,.2,1), opacity 300ms ease;
}

.action-sheet-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  margin: 0 auto var(--space-3);
  background: rgba(17, 18, 24, 0.18);
  border-radius: 99px;
}

.sheet-content {
  display: grid;
  gap: var(--space-2);
  min-width: 0;
  text-align: center;
}

.sheet-content-changing {
  animation: sheet-content-enter 360ms cubic-bezier(.2,.8,.2,1) both;
}

@keyframes sheet-content-enter {
  from {
    opacity: .18;
    transform: translateY(9px) scale(.992);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.sheet-content > * {
  min-width: 0;
  margin-block: 0;
}

.sheet-content > :is(.result-stamp, .challenge-avatar, .batch-builder-progress) {
  margin-inline: auto;
}

.sheet-content h1,
.sheet-content h2,
.drawer-dialog h2,
.modal-dialog h2 {
  margin: 0;
  font-size: clamp(29px, 8.5vw, 44px);
  font-weight: 1000;
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.sheet-content h2 {
  font-size: clamp(27px, 7.5vw, 38px);
}

.sheet-content p {
  margin-inline: auto;
  color: #5e5f68;
  font-size: 13px;
  line-height: 1.48;
  max-width: 340px;
}

.eyebrow {
  display: block;
  margin-bottom: 0;
  color: #777984;
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.15em;
  line-height: 1.2;
  text-transform: uppercase;
}

.challenge-avatar {
  width: 46px;
  height: 46px;
  margin-inline: auto;
  display: grid;
  place-items: center;
  background: var(--coral);
  color: white;
  box-shadow: 4px 4px 0 #111218;
  font-weight: 1000;
  border: 2px solid #111218;
  border-radius: 14px;
  transform: rotate(-3deg);
}

.intro-rule {
  margin: 0;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  color: #32333a;
  background: #e9e4d9;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 800;
}

.intro-rule span {
  color: var(--violet);
  font-size: 16px;
}

.landing-demo {
  margin: 0;
  overflow: hidden;
  color: var(--paper);
  background:
    radial-gradient(circle at 74% 25%, rgba(135, 111, 255, .22), transparent 42%),
    #15171e;
  border: 2px solid #111218;
  box-shadow: 4px 4px 0 rgba(17, 18, 24, .2);
  border-radius: 15px;
}

.landing-demo svg {
  width: 100%;
  height: auto;
  display: block;
}

.landing-demo-ground {
  fill: none;
  stroke: rgba(244, 240, 231, .42);
  stroke-width: 3;
  stroke-linecap: round;
}

.landing-motion-line {
  fill: none;
  stroke: rgba(216, 255, 67, .62);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 7 8;
  animation: landing-motion 850ms linear infinite;
}

.landing-motion-line.line-two {
  animation-delay: -420ms;
}

.landing-demo-doors .landing-hatch-frame {
  fill: #111218;
  stroke: rgba(244, 240, 231, .72);
  stroke-width: 1.5;
}

.landing-demo-doors .landing-hatch-well {
  fill: #050609;
  stroke: none;
}

.landing-demo-doors .hatch-panel {
  fill: #313541;
  stroke: rgba(244, 240, 231, .6);
  stroke-width: 1.5;
}

.landing-demo-doors .hatch-panel.armed {
  fill: #313541;
  transform-box: fill-box;
  transform-origin: right bottom;
  animation: landing-hatch-open 4.8s ease-in-out infinite;
}

.landing-hidden-trap {
  fill: var(--coral);
  stroke: #111218;
  stroke-width: 1.5;
  stroke-linejoin: round;
  opacity: 0;
  transform: translateY(18px);
  animation: landing-trap-emerge 4.8s ease-in-out infinite;
}

.landing-demo-doors text {
  fill: rgba(244, 240, 231, .72);
  font: 800 7px system-ui, sans-serif;
  text-anchor: middle;
}

.landing-svg-runner {
  transform-box: view-box;
  transform-origin: 0 0;
  animation: landing-runner-loop 4.8s linear infinite;
  will-change: transform;
}

.landing-runner-head {
  fill: var(--acid);
  stroke: #111218;
  stroke-width: 2.5;
}

.landing-runner-body,
.landing-runner-leg {
  fill: none;
  stroke: var(--paper);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.landing-runner-leg {
  transform-box: fill-box;
  transform-origin: 50% 0;
  animation: landing-leg-swing 320ms ease-in-out infinite alternate;
}

.landing-runner-leg.leg-two {
  animation-direction: alternate-reverse;
}

.landing-demo-labels {
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: rgba(244, 240, 231, .72);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .1em;
}

@keyframes landing-runner-loop {
  0% { transform: translate(0, 0); }
  34% { transform: translate(112px, 0); }
  48% { transform: translate(165px, 0); }
  58% { transform: translate(205px, 0); }
  64% { transform: translate(228px, -24px); }
  73% { transform: translate(266px, -38px); }
  84% { transform: translate(304px, 0); }
  100% { transform: translate(338px, 0); }
}

@keyframes landing-hatch-open {
  0%, 56%, 84%, 100% { transform: translateY(0) scaleY(1); }
  61%, 77% { transform: translateY(7px) rotate(7deg) scaleY(.18); }
}

@keyframes landing-trap-emerge {
  0%, 57%, 83%, 100% { opacity: 0; transform: translateY(18px); }
  63%, 76% { opacity: 1; transform: translateY(-1px); }
}

@keyframes landing-motion {
  to { stroke-dashoffset: -30; }
}

@keyframes landing-leg-swing {
  from { transform: rotate(-18deg); }
  to { transform: rotate(18deg); }
}

.landing-actions {
  margin: 0;
}

.button-stack {
  display: grid;
  gap: var(--space-2);
}

.fresh-trap-button {
  width: max-content;
  min-height: 44px;
  margin-inline: auto;
  padding: var(--space-2) var(--space-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  border: 0;
  border-radius: 10px;
  color: #555760;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
  text-decoration: underline;
  text-decoration-color: rgba(17, 18, 24, 0.24);
  text-underline-offset: 3px;
}

.fresh-trap-button span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #111218;
  border: 1px solid rgba(17, 18, 24, 0.25);
  border-radius: 7px;
  font-size: 16px;
  line-height: 1;
  text-decoration: none;
}

.fresh-trap-button:hover {
  color: #111218;
  background: rgba(17, 18, 24, 0.05);
}

.fresh-trap-button[disabled] {
  cursor: wait;
  opacity: 0.58;
}

.sheet-content .fresh-trap-status {
  width: 100%;
  margin-inline: auto;
  color: #9d3026;
  font-size: 11px;
  font-weight: 750;
}

.button,
.mini-button {
  border: 0;
  cursor: pointer;
  font-weight: 950;
}

.button {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  color: var(--ink);
  background: var(--acid);
  box-shadow: 0 5px 0 #9dbd22;
  border: 2px solid #111218;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.1;
  transition: translate 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.button:hover {
  background: #e3ff76;
}

.button:active {
  translate: 0 4px;
  box-shadow: 0 1px 0 #9dbd22;
}

.button-dark {
  color: white;
  background: #111218;
  box-shadow: 0 5px 0 #393b45;
}

.button-dark:hover {
  background: #292b34;
}

.button-secondary {
  color: #111218;
  background: transparent;
  border-color: rgba(17, 18, 24, 0.24);
  box-shadow: none;
}

.button-secondary:hover {
  background: rgba(17, 18, 24, 0.05);
}

.button[disabled],
.mini-button[disabled] {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.button-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 7px;
  color: white;
  background: var(--violet);
  border-radius: 999px;
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.privacy-inline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin: 0 auto;
  max-width: 340px;
  color: #73747c;
  font-size: 10px;
  line-height: 1.4;
}

.privacy-inline span {
  color: var(--violet);
}

.result-stamp {
  width: fit-content;
  margin-inline: auto;
  padding: 6px var(--space-3);
  color: white;
  background: var(--coral);
  font-size: 9px;
  font-weight: 1000;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transform: rotate(-2deg);
  border-radius: 6px;
}

.result-stamp.success {
  color: #111218;
  background: var(--acid);
}

.result-stamp.overtime {
  background: var(--violet);
}

.crown-row {
  margin: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.crown {
  width: 29px;
  height: 25px;
  position: relative;
  color: #b8b2a8;
  opacity: 0.26;
}

.crown::before {
  content: "♛";
  font-size: 28px;
  line-height: 1;
}

.crown.earned {
  color: #f3b51b;
  filter: drop-shadow(0 3px 0 rgba(168, 111, 0, 0.25));
  opacity: 1;
}

.official-lock {
  margin: 0;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  color: #5d5e66;
  background: #e9e4d9;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 800;
}

.official-lock strong {
  color: #111218;
}

.official-lock .meter-lock-value {
  min-width: 0;
  display: grid;
  justify-items: end;
  gap: 3px;
  text-align: right;
}

.official-lock .meter-lock-value > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.official-lock .meter-lock-value small {
  color: #5d5e66;
  font-size: 8px;
  line-height: 1.25;
}

.credit-pack-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 1fr;
  align-items: stretch;
  gap: var(--space-2);
}

.credit-pack {
  position: relative;
  height: 100%;
  min-height: 112px;
  padding: var(--space-4) var(--space-3) var(--space-3);
  display: grid;
  place-items: center;
  gap: 2px;
  color: #111218;
  background: #e9e4d9;
  border: 2px solid rgba(17, 18, 24, .18);
  border-radius: 14px;
  cursor: pointer;
  font: inherit;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.credit-pack:hover:not(:disabled),
.credit-pack:focus-visible {
  border-color: #111218;
  box-shadow: 4px 4px 0 #111218;
  transform: translate(-2px, -2px);
}

.credit-pack.best-value {
  background: #e9e4d9;
  border-color: rgba(17, 18, 24, .18);
  box-shadow: inset 0 4px 0 var(--violet);
}

.credit-pack.best-value:hover:not(:disabled),
.credit-pack.best-value:focus-visible {
  box-shadow: inset 0 4px 0 var(--violet), 4px 4px 0 #111218;
}

.credit-pack.selected,
.credit-pack.selected.best-value {
  border-color: #111218;
  background: #f5f2e9;
  box-shadow: inset 0 0 0 2px var(--acid), 4px 4px 0 #111218;
  transform: translate(-2px, -2px);
}

.purchase-submit {
  margin-top: var(--space-1);
}

.credit-pack:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.credit-pack-badge {
  position: absolute;
  top: -8px;
  padding: 4px 8px;
  color: white;
  background: var(--violet);
  border-radius: 999px;
  font-size: 7px;
  font-weight: 1000;
  letter-spacing: .1em;
}

.credit-pack-count {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.credit-pack-count strong {
  font-size: 25px;
  line-height: 1;
}

.credit-pack-price {
  font-size: 14px;
  font-weight: 1000;
}

.credit-pack small {
  color: #666770;
  font-size: 8px;
  font-weight: 800;
}

.sheet-content .purchase-account-note,
.sheet-content .purchase-unavailable {
  margin: 0 auto;
  color: #666770;
  font-size: 9px;
}

.sheet-content .purchase-unavailable {
  color: #9b3e37;
  font-weight: 850;
}

.mini-meter {
  display: inline-flex;
  gap: 3px;
  vertical-align: middle;
}

.mini-meter i {
  width: 16px;
  height: 6px;
  display: block;
  background: rgba(17, 18, 24, 0.14);
  border-radius: 99px;
}

.mini-meter i.filled {
  background: var(--violet);
}

.trap-grid,
.socket-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
  margin: 0;
}

.batch-builder-progress {
  width: fit-content;
  margin-inline: auto;
  padding: var(--space-1) var(--space-2);
  display: flex;
  align-items: baseline;
  gap: var(--space-1);
  color: #111218;
  background: var(--acid);
  border: 1px solid #111218;
  border-radius: 999px;
}

.batch-builder-progress strong {
  font-size: 13px;
}

.batch-builder-progress span {
  font-size: 7px;
  font-weight: 950;
  letter-spacing: .1em;
}

.batch-builder-progress.needs-traps {
  color: white;
  background: var(--coral);
}

.sheet-content .builder-constraint {
  margin-inline: auto;
  padding: var(--space-2) var(--space-3);
  border-radius: 9px;
  font-size: 9px;
  font-weight: 900;
}

.sheet-content .builder-constraint.minimum-met {
  color: #315d14;
  background: rgba(216, 255, 67, .42);
}

.sheet-content .builder-constraint.needs-traps {
  color: #7d251f;
  background: rgba(255, 101, 87, .15);
  border: 1px solid rgba(125, 37, 31, .2);
}

.sheet-content .builder-live-proof {
  margin-inline: auto;
  color: #6250bd;
  font-size: 8px;
  font-weight: 950;
  letter-spacing: .1em;
}

.builder-live-proof span {
  color: #4da81c;
}

.batch-socket-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.batch-socket {
  min-width: 0;
  min-height: 92px;
  padding: var(--space-2) var(--space-1);
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-1);
  border: 2px solid rgba(17, 18, 24, .14);
  color: #111218;
  background: #ece7dc;
  border-radius: 12px;
  cursor: pointer;
}

.batch-socket:hover,
.batch-socket.selected {
  border-color: #111218;
}

.batch-socket.filled {
  background: rgba(216, 255, 67, .58);
}

.batch-socket.trap-spikes,
.trap-symbol.trap-spikes { --trap-color: var(--coral); }
.batch-socket.trap-flame,
.trap-symbol.trap-flame { --trap-color: #ff923f; }
.batch-socket.trap-saw,
.trap-symbol.trap-saw { --trap-color: var(--violet); }
.batch-socket.trap-jaws,
.trap-symbol.trap-jaws { --trap-color: #35bfe8; }
.batch-socket.trap-crusher,
.trap-symbol.trap-crusher { --trap-color: #e1b522; }
.batch-socket.trap-piston,
.trap-symbol.trap-piston { --trap-color: #50b96a; }

.batch-socket.filled .trap-visual,
.trap-symbol[class*="trap-"] .trap-visual {
  color: var(--trap-color);
}

.batch-socket.safe {
  color: #65666f;
  background: #e4dfd5;
}

.batch-socket-number {
  position: absolute;
  top: 5px;
  left: 6px;
  color: #777984;
  font-size: 8px;
  font-weight: 950;
}

.batch-socket .trap-symbol {
  min-height: 24px;
  font-size: 21px;
}

.batch-socket .trap-visual {
  width: 42px;
  height: 34px;
}

.batch-socket strong {
  max-width: 100%;
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.batch-socket > span:last-child {
  color: #6d6e76;
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.batch-palette {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.batch-palette.hidden-door-palette {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.trap-picker {
  margin: 0;
  padding: var(--space-3);
  color: #111218;
  background: rgba(17, 18, 24, .055);
  border: 1px solid rgba(17, 18, 24, .1);
  border-radius: 16px;
}

.trap-picker-heading {
  margin: 0 0 var(--space-2);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  text-align: left;
}

.trap-picker-heading strong {
  font-size: 12px;
  font-weight: 1000;
}

.trap-picker-heading span {
  color: #6a6b73;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.trap-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.trap-type-card {
  --trap-color: var(--coral);
  min-width: 0;
  overflow: hidden;
  background: #ebe6dc;
  border: 2px solid rgba(17, 18, 24, .13);
  border-radius: 14px;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.trap-type-card.trap-flame { --trap-color: #ff923f; }
.trap-type-card.trap-saw { --trap-color: var(--violet); }
.trap-type-card.trap-jaws { --trap-color: #35bfe8; }
.trap-type-card.trap-crusher { --trap-color: #e1b522; }
.trap-type-card.trap-piston { --trap-color: #50b96a; }

.trap-type-card:hover,
.trap-type-card:focus-within,
.trap-type-card.selected {
  border-color: #111218;
}

.trap-type-card.selected {
  background: rgba(216, 255, 67, .5);
  box-shadow: 0 3px 0 rgba(17, 18, 24, .18);
  transform: translateY(-1px);
}

.trap-type-select {
  width: 100%;
  min-height: 78px;
  padding: var(--space-2) var(--space-2) var(--space-1);
  position: relative;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.trap-stage {
  width: 52px;
  height: 54px;
  display: grid;
  place-items: center;
  color: var(--trap-color);
  background:
    linear-gradient(to bottom, transparent 76%, rgba(255, 255, 255, .08) 76%),
    #181b22;
  border: 1px solid rgba(17, 18, 24, .28);
  border-radius: 9px;
}

.trap-card-copy {
  min-width: 0;
  display: grid;
  gap: var(--space-1);
}

.trap-card-copy strong {
  font-size: 10px;
  font-weight: 1000;
  line-height: 1;
}

.trap-card-copy > span {
  color: #65666f;
  font-size: 7px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.trap-card-timing {
  position: absolute;
  top: 5px;
  right: 6px;
  padding: 2px 4px;
  color: #5b5c65;
  background: rgba(255, 255, 255, .55);
  border-radius: 999px;
  font-size: 6px;
  font-weight: 950;
  letter-spacing: .06em;
  line-height: 1;
  text-transform: uppercase;
}

.trap-visual {
  width: 58px;
  height: 54px;
  overflow: visible;
  fill: currentColor;
  stroke: #111218;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trap-visual.compact {
  width: 46px;
  height: 38px;
}

.trap-visual .trap-cutout {
  fill: #181b22;
}

.trap-visual .trap-flame-inner {
  fill: var(--acid);
  stroke-width: 1;
}

.trap-crusher-shadow,
.trap-motion-mark {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  opacity: .62;
}

.trap-part {
  transform-box: fill-box;
  transform-origin: center;
}

.trap-type-card.selected .trap-spike-set { animation: trap-spike-strike 2.35s ease-in-out infinite; }
.trap-type-card.selected .trap-flame-outer { animation: trap-flame-strike 2.35s ease-in-out infinite; transform-origin: 50% 100%; }
.trap-type-card.selected .trap-flame-inner { animation: trap-flame-inner 2.35s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.trap-type-card.selected .trap-saw-wheel { animation: trap-saw-sweep 2.35s ease-in-out infinite; }
.trap-type-card.selected .trap-jaw-top { animation: trap-jaw-top 2.35s ease-in-out infinite; }
.trap-type-card.selected .trap-jaw-bottom { animation: trap-jaw-bottom 2.35s ease-in-out infinite; }
.trap-type-card.selected .trap-crusher-head { animation: trap-crusher-thrust 2.35s cubic-bezier(.2,.7,.2,1) infinite; }
.trap-type-card.selected .trap-crusher-shadow { animation: trap-shadow-pulse 2.35s ease-in-out infinite; }
.trap-type-card.selected .trap-piston { animation: trap-piston-ram 2.35s ease-in-out infinite; }

@keyframes trap-spike-strike {
  0%, 24%, 100% { transform: translateY(17px) scaleY(.55); }
  31% { transform: translateY(13px) scaleY(.7); }
  36%, 63% { transform: translateY(0) scaleY(1); }
  72% { transform: translateY(17px) scaleY(.55); }
}

@keyframes trap-flame-strike {
  0%, 24%, 100% { opacity: .18; transform: scale(.35, .22); }
  31% { opacity: .65; transform: scale(.45, .36); }
  39%, 60% { opacity: 1; transform: scale(1.03, 1.1); }
  66% { opacity: .75; transform: scale(.8, .72); }
}

@keyframes trap-flame-inner {
  0%, 28%, 100% { opacity: 0; transform: scale(.2); }
  39%, 62% { opacity: 1; transform: scale(1); }
}

@keyframes trap-saw-sweep {
  0%, 24%, 100% { transform: translateX(-12px) rotate(0); }
  30% { transform: translateX(-9px) rotate(-30deg); }
  55% { transform: translateX(12px) rotate(430deg); }
  69% { transform: translateX(-12px) rotate(720deg); }
}

@keyframes trap-jaw-top {
  0%, 28%, 100% { transform: translateY(-8px); }
  34% { transform: translateY(-11px); }
  39%, 58% { transform: translateY(8px); }
  68% { transform: translateY(-8px); }
}

@keyframes trap-jaw-bottom {
  0%, 28%, 100% { transform: translateY(8px); }
  34% { transform: translateY(11px); }
  39%, 58% { transform: translateY(-8px); }
  68% { transform: translateY(8px); }
}

@keyframes trap-crusher-thrust {
  0%, 27%, 100% { transform: translateY(18px); }
  33% { transform: translateY(21px); }
  39%, 59% { transform: translateY(-7px); }
  70% { transform: translateY(18px); }
}

@keyframes trap-shadow-pulse {
  0%, 25%, 100% { opacity: .15; transform: scaleX(.5); }
  34% { opacity: .75; transform: scaleX(1); }
  40%, 60% { opacity: .22; transform: scaleX(.8); }
}

@keyframes trap-piston-ram {
  0%, 26%, 100% { transform: translateX(-12px); }
  33% { transform: translateX(-8px); }
  39%, 58% { transform: translateX(4px); }
  68% { transform: translateX(-12px); }
}

.trap-door-slider {
  padding: 0 var(--space-2) var(--space-2);
  position: relative;
  display: grid;
}

.door-slider-track {
  height: 4px;
  position: absolute;
  z-index: 0;
  top: 20px;
  left: 17px;
  right: 17px;
  display: block;
  background: #c4beb4;
  border-radius: 99px;
}

.door-slider-thumb {
  width: 12px;
  height: 12px;
  position: absolute;
  top: 50%;
  left: 50%;
  display: block;
  background: #777984;
  border: 2px solid #111218;
  border-radius: 50%;
  opacity: .3;
  translate: -50% -50%;
  transition: left 160ms ease, opacity 160ms ease, background 160ms ease;
}

.trap-door-slider.active .door-slider-thumb {
  background: var(--trap-color);
  opacity: 1;
}

.door-slider-thumb.door-0 { left: 0; }
.door-slider-thumb.door-1 { left: 50%; }
.door-slider-thumb.door-2 { left: 100%; }

.door-slider-stops {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.door-slider-stops button {
  width: 44px;
  height: 40px;
  justify-self: center;
  padding: 0;
  color: #676871;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 7px;
  font-weight: 1000;
}

.door-slider-stops button[aria-pressed="true"] {
  color: #111218;
}

.safe-hatch-option {
  width: 100%;
  min-height: 56px;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #111218;
  background: #e5e0d6;
  border: 2px solid rgba(17, 18, 24, .13);
  border-radius: 12px;
  cursor: pointer;
  text-align: left;
}

.safe-hatch-option:hover,
.safe-hatch-option.selected {
  border-color: #111218;
}

.safe-hatch-option.selected {
  background: white;
}

.safe-hatch-option.constraint-locked {
  color: #777984;
  background: #d8d3c9;
  cursor: not-allowed;
}

.safe-shield {
  min-width: 45px;
  padding: 6px 5px;
  display: inline-grid;
  place-items: center;
  color: #4f5058;
  background: white;
  border: 2px solid currentColor;
  border-radius: 999px;
  font-size: 8px;
  font-weight: 1000;
  letter-spacing: .08em;
}

.safe-hatch-option > span:last-child {
  display: grid;
  gap: 2px;
}

.safe-hatch-option strong {
  font-size: 10px;
  font-weight: 1000;
}

.safe-hatch-option small {
  color: #686972;
  font-size: 7px;
  font-weight: 800;
  text-transform: uppercase;
}

.trap-card,
.socket-card {
  min-width: 0;
  min-height: 82px;
  border: 2px solid rgba(17, 18, 24, 0.13);
  color: #111218;
  background: #ece7dc;
  cursor: pointer;
  border-radius: 13px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-1);
  transition: border 120ms ease, background 120ms ease, transform 120ms ease;
}

.trap-card:hover,
.socket-card:hover,
.trap-card.selected,
.socket-card.selected {
  border-color: #111218;
  background: var(--acid);
  transform: translateY(-2px);
}

.trap-card.constraint-locked,
.trap-card.constraint-locked:hover {
  color: #6b6c74;
  background: #ded9cf;
  border-color: rgba(17, 18, 24, .2);
  transform: none;
}

.trap-card.constraint-locked .door-strip {
  opacity: .55;
}

.trap-card strong,
.socket-card strong {
  font-size: 10px;
}

.trap-card span:last-child,
.socket-card span:last-child {
  color: #65666f;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.trap-symbol {
  min-height: 26px;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 1000;
}

.door-strip {
  display: inline-flex;
  overflow: hidden;
  color: #111218;
  background: #d5d0c6;
  border: 2px solid #111218;
  border-radius: 5px;
  box-shadow: 0 2px 0 rgba(17, 18, 24, .2);
}

.door-strip i {
  width: 18px;
  height: 22px;
  display: grid;
  place-items: center;
  border-right: 1px solid #111218;
  font-size: 8px;
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
}

.door-strip i:last-child {
  border-right: 0;
}

.door-strip i.armed {
  color: white;
  background: var(--coral);
}

.batch-socket .door-strip {
  transform: scale(.86);
}

.builder-step {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.builder-step i {
  width: 30px;
  height: 4px;
  background: rgba(17, 18, 24, 0.13);
  border-radius: 99px;
}

.builder-step i.active {
  background: var(--violet);
}

.builder-back {
  border: 0;
  background: none;
  color: #55565e;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
  text-decoration: underline;
}

.action-sheet.builder-preview-sheet {
  max-height: 48%;
  padding: var(--space-3) var(--surface-pad) max(var(--space-4), env(safe-area-inset-bottom));
  background: rgba(244, 240, 231, .95);
  box-shadow: 0 -10px 38px rgba(4, 5, 8, .25);
}

.builder-preview-sheet .sheet-handle {
  margin-bottom: var(--space-2);
}

.placement-preview-confirmation .eyebrow {
  margin-bottom: 0;
  color: #6250bd;
}

.placement-preview-confirmation {
  display: grid;
  gap: var(--space-2);
}

.placement-preview-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  text-align: left;
}

.placement-preview-title .trap-symbol {
  min-width: 42px;
  min-height: 42px;
  color: #111218;
  background: var(--acid);
  border: 2px solid #111218;
  border-radius: 11px;
  font-size: 21px;
}

.placement-preview-title h2 {
  font-size: 23px;
}

.sheet-content .placement-preview-title p {
  margin: var(--space-1) 0 0;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.sheet-content .placement-preview-proof {
  margin-inline: auto;
  color: #5d5e66;
  font-size: 9px;
}

.placement-preview-proof span {
  margin-right: var(--space-1);
  color: var(--violet);
}

.builder-preview-sheet .button-stack {
  gap: var(--space-2);
}

.builder-preview-sheet .button {
  min-height: 42px;
  padding-block: 9px;
}

.builder-preview-sheet .builder-back {
  min-height: 30px;
}

.share-link-box {
  margin: 0;
  padding: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  background: #e7e2d8;
  border: 1px solid rgba(17, 18, 24, 0.1);
  border-radius: 12px;
  text-align: left;
}

.share-message-preview {
  margin: 0;
  padding: var(--space-3);
  background: rgba(135, 111, 255, 0.09);
  border-left: 3px solid var(--violet);
  border-radius: 0 10px 10px 0;
  text-align: left;
}

.share-message-preview span {
  display: block;
  margin-bottom: var(--space-1);
  color: var(--violet);
  font-size: 8px;
  font-weight: 950;
  letter-spacing: 0.13em;
}

.share-message-preview p {
  margin: 0;
  color: #252630;
  font-size: 11px;
  line-height: 1.45;
}

.share-link-box span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: #5d5e66;
  font-size: 10px;
}

.share-link-box button {
  border: 0;
  background: transparent;
  color: #111218;
  cursor: pointer;
  font-size: 10px;
  font-weight: 950;
}

.loading-state {
  min-height: 110px;
  display: grid;
  gap: var(--space-3);
  place-items: center;
  align-content: center;
}

.loading-state p {
  margin: 0;
}

.loading-stick {
  width: 12px;
  height: 28px;
  display: block;
  border: solid #111218;
  border-width: 0 3px 0 3px;
  position: relative;
  animation: loading-run .45s ease-in-out infinite alternate;
}

.loading-stick::before {
  content: "";
  width: 10px;
  height: 10px;
  position: absolute;
  left: -2px;
  top: -9px;
  border: 3px solid #111218;
  border-radius: 50%;
}

@keyframes loading-run {
  to { transform: skew(13deg) translateY(-3px); }
}

.side-panel {
  display: none;
}

.session-skeleton {
  position: relative;
}

.app-shell[data-session-state="loading"] .session-skeleton {
  overflow: hidden;
  border-color: transparent !important;
  color: transparent !important;
  background: rgba(255, 255, 255, .1) !important;
  box-shadow: none !important;
  pointer-events: none;
  user-select: none;
}

.app-shell[data-session-state="loading"] .session-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, .07);
  animation: session-skeleton-pulse 1.1s ease-in-out infinite alternate;
}

.session-skeleton-name {
  min-width: 92px;
  min-height: 20px;
  border-radius: 4px;
}

.session-skeleton-pill {
  min-width: 58px;
  min-height: 25px;
}

.session-skeleton-meter-label {
  min-width: 38px;
  min-height: 17px;
  display: inline-block;
  border-radius: 4px;
}

.session-skeleton-meter {
  min-height: 11px;
  border-radius: 99px;
}

.session-skeleton-copy {
  min-height: 28px;
  border-radius: 4px;
}

.session-skeleton-balance {
  min-width: 20px;
  min-height: 20px;
  display: inline-block;
  border-radius: 4px;
}

.session-skeleton-button {
  min-width: 78px;
}

@keyframes session-skeleton-pulse {
  to { opacity: .42; }
}

.side-card {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(14px);
  border-radius: 18px;
  padding: var(--space-4);
}

.identity-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.identity-card strong {
  display: block;
  font-size: 16px;
}

.identity-card .eyebrow,
.wallet-card .eyebrow,
.rule-card .eyebrow {
  color: var(--muted);
  margin-bottom: var(--space-1);
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.card-heading strong {
  font-size: 13px;
}

.text-icon-button {
  width: 27px;
  height: 27px;
  font-size: 11px;
  font-weight: 900;
}

.meter-segments {
  margin: var(--space-3) 0 var(--space-2);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-1);
}

.meter-segments i {
  height: 9px;
  display: block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 99px;
}

.meter-segments i.filled {
  background: var(--violet);
  border-color: var(--violet);
  box-shadow: 0 0 13px rgba(135, 111, 255, 0.4);
}

.microcopy {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.credit-row {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.credit-token {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--acid);
  border-radius: 50%;
  font-size: 18px;
  font-weight: 950;
}

.credit-row > div {
  min-width: 0;
  flex: 1;
  display: grid;
}

.credit-row span:not(.credit-token) {
  color: var(--muted);
  font-size: 9px;
}

.credit-row strong {
  font-size: 16px;
}

.mini-button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--ink);
  background: var(--acid);
  border-radius: 9px;
  font-size: 9px;
}

.rule-card ol {
  list-style: none;
  padding: 0;
  margin: var(--space-3) 0 0;
  display: grid;
  gap: var(--space-3);
}

.rule-card li {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: #d7d4cf;
  font-size: 11px;
  font-weight: 750;
}

.rule-card li i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--paper);
  border-radius: 7px;
  font-size: 9px;
  font-style: normal;
  font-weight: 950;
}

.privacy-note {
  display: flex;
  gap: var(--space-2);
  margin: 0;
  padding: 0 var(--space-1);
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.privacy-note span {
  color: var(--violet);
}

dialog {
  color: var(--paper);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(4px);
}

.drawer-dialog {
  width: min(calc(100vw - var(--page-gutter)), 390px);
  max-height: min(88dvh, 680px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: max(var(--space-4), env(safe-area-inset-top)) max(var(--space-4), env(safe-area-inset-right)) max(var(--space-4), env(safe-area-inset-bottom)) var(--space-4);
  margin: auto 0 auto auto;
  border: 1px solid var(--line);
  background: #15171e;
  box-shadow: var(--shadow);
  border-radius: 22px 0 0 22px;
}

.drawer-dialog[open] {
  animation: drawer-in 220ms ease-out;
}

@keyframes drawer-in {
  from { transform: translateX(30px); opacity: 0; }
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.drawer-head h2 {
  font-size: 29px;
}

.drawer-head .eyebrow {
  color: var(--muted);
}

.close-dialog {
  flex: 0 0 auto;
}

.notification-list {
  display: grid;
  gap: var(--space-2);
}

.notification-settings {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-block: var(--space-3);
  border-block: 1px solid var(--line);
}

.notification-settings > div {
  min-width: 0;
}

.notification-settings strong {
  font-size: 12px;
}

.notification-settings p {
  margin: var(--space-1) 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.notification-push-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.notification-push-toggle input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.notification-switch-track {
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  padding: 2px;
  display: flex;
  align-items: center;
  border: 2px solid #111218;
  border-radius: 999px;
  background: #c9c6bd;
  transition: background 180ms ease;
}

.notification-switch-track i {
  width: 16px;
  height: 16px;
  display: block;
  border-radius: 50%;
  background: #111218;
  transform: translateX(0);
  transition: transform 180ms ease;
}

.notification-push-toggle input:checked + .notification-switch-track {
  background: var(--acid);
}

.notification-push-toggle input:checked + .notification-switch-track i {
  transform: translateX(18px);
}

.notification-push-toggle input:focus-visible + .notification-switch-track {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.notification-push-toggle input:disabled + .notification-switch-track,
.notification-push-toggle input:disabled ~ strong {
  cursor: not-allowed;
  opacity: .48;
}

.notification-email-toggle {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  cursor: pointer;
}

.notification-email-toggle span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.notification-email-toggle small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.notification-email-toggle input {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  accent-color: var(--acid);
}

.notification-settings .field-message {
  grid-column: 1 / -1;
  margin: 0;
}

.history-list,
.history-section {
  display: grid;
  gap: var(--space-3);
}

.history-section + .history-section {
  margin-top: var(--space-5);
}

.account-footer {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  display: grid;
  gap: var(--space-2);
}

.account-footer[hidden] {
  display: none;
}

.account-footer > * {
  min-width: 0;
  margin: 0;
}

.account-footer strong {
  overflow-wrap: anywhere;
  color: var(--paper);
  font-size: 13px;
}

.account-footer p,
.account-footer small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.account-logout-button {
  width: fit-content;
  min-height: 44px;
  margin-top: var(--space-2);
  padding: 0 var(--space-3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 11px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 850;
}

.account-logout-button:hover {
  border-color: rgba(216, 255, 67, 0.45);
  background: rgba(216, 255, 67, 0.08);
}

.account-logout-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.history-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.history-section-title h3 {
  margin: 0;
  font-size: 14px;
}

.history-section-title span {
  color: var(--muted);
  font-size: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-1) var(--space-3);
  padding: var(--space-3);
  border: 1px solid var(--line);
  color: var(--paper);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  text-decoration: none;
}

.history-item:hover {
  border-color: rgba(216, 255, 67, .38);
}

.history-item strong {
  font-size: 12px;
}

.history-item span,
.history-item time {
  color: var(--muted);
  font-size: 10px;
}

.history-item time {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
}

.notification-item {
  display: block;
  padding: var(--space-3);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--paper);
  border-radius: 14px;
  text-decoration: none;
}

a.notification-item:hover {
  border-color: rgba(216, 255, 67, 0.48);
}

.notification-item.unread {
  border-color: rgba(216, 255, 67, 0.34);
}

.notification-item strong {
  display: block;
  margin-bottom: var(--space-1);
  font-size: 12px;
}

.notification-item p,
.empty-notifications {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.modal-dialog {
  width: min(calc(100vw - (2 * var(--page-gutter))), 410px);
  padding: var(--surface-pad);
  position: relative;
  margin: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: #111218;
  box-shadow: var(--shadow);
  border-radius: 22px;
  text-align: center;
}

.modal-dialog[open] {
  display: grid;
  gap: var(--space-3);
}

#identityDialogContent,
#playbackDialogContent {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
}

#identityDialogContent > *,
#playbackDialogContent > * {
  min-width: 0;
  margin-block: 0;
}

.account-flow-surface {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
}

.identity-flow-surface {
  width: 100%;
}

.account-flow-surface > * {
  min-width: 0;
  margin-block: 0;
}

.modal-dialog .close-dialog:not(.button) {
  position: absolute;
  right: var(--space-3);
  top: var(--space-3);
  color: #111218;
  border-color: rgba(17, 18, 24, 0.14);
  background: transparent;
}

.modal-dialog .eyebrow {
  margin-top: 0;
}

.modal-dialog h2 {
  font-size: 32px;
}

.modal-dialog p {
  margin: 0;
  color: #62636b;
  font-size: 12px;
  line-height: 1.55;
}

.account-dialog {
  width: min(calc(100vw - (2 * var(--page-gutter))), 430px);
  max-height: min(92dvh, 700px);
  overflow-y: auto;
  padding: var(--surface-pad);
}

.account-dialog[open] {
  animation: account-dialog-in 180ms ease-out;
}

.playback-dialog {
  width: min(calc(100vw - (2 * var(--page-gutter))), 760px);
  max-height: 94dvh;
  overflow-y: auto;
  padding: var(--surface-pad);
}

.playback-dialog[open] {
  animation: account-dialog-in 180ms ease-out;
}

.playback-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  color: #111218;
  border-color: rgba(17, 18, 24, .14);
  background: transparent;
}

.playback-dialog h2 {
  margin: 0;
  padding-inline: 42px;
  font-size: clamp(27px, 6vw, 40px);
}

.playback-dialog #playbackSummary {
  margin-inline: auto;
}

.playback-frame {
  width: auto;
  height: min(64dvh, 570px);
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  overflow: hidden;
  background: #0b0c12;
  border: 1px solid rgba(17, 18, 24, .2);
  border-radius: 18px;
  box-shadow: 0 13px 30px rgba(8, 9, 13, .18);
}

.playback-body {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr);
  align-items: center;
  justify-content: center;
  gap: var(--space-5);
}

.playback-controls {
  min-width: 0;
  display: grid;
  gap: var(--space-3);
}

.playback-frame svg {
  width: 100%;
  height: auto;
  display: block;
}

.playback-frame.playback-frame-static {
  width: min(100%, 420px);
  height: auto;
  aspect-ratio: auto;
}

.playback-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.playback-render-status {
  min-height: 17px;
  color: #656771;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.4;
}

.playback-actions {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

.playback-actions .playback-share {
  grid-column: 1 / -1;
}

.playback-actions .button {
  min-height: 48px;
  padding-inline: 10px;
  font-size: 11px;
}

.modal-dialog .playback-privacy {
  margin-inline: auto;
  color: #666872;
  font-size: 10px;
}

.playback-privacy span {
  margin-right: var(--space-1);
  color: var(--violet);
}

@media (max-width: 560px) {
  .playback-dialog {
    width: calc(100vw - (2 * var(--page-gutter)));
    padding: var(--space-4);
  }

  .playback-actions {
    grid-template-columns: 1fr;
  }

  .playback-actions .playback-share {
    grid-column: auto;
  }

  .playback-actions .button {
    min-height: 45px;
  }
}

@media (max-width: 700px) {
  .playback-body {
    grid-template-columns: 1fr;
    gap: var(--space-3);
  }

  .playback-frame {
    width: min(100%, 280px);
    height: auto;
  }
}

@keyframes account-dialog-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.98);
  }
}

.account-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  color: #111218;
  border-color: rgba(17, 18, 24, 0.14);
  background: transparent;
}

.account-modal-icon {
  font-size: 21px;
}

.account-form {
  display: grid;
  gap: var(--space-2);
  margin-top: 0;
  text-align: left;
}

.account-form label {
  color: #393a42;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.account-form label span {
  color: #8a8b93;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: none;
}

.account-form input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 2px solid rgba(17, 18, 24, 0.18);
  outline: 0;
  color: #111218;
  background: white;
  border-radius: 13px;
  font: inherit;
  font-size: 16px;
  font-weight: 750;
}

.account-form input:focus {
  border-color: var(--violet);
  box-shadow: 0 0 0 3px rgba(135, 111, 255, 0.16);
}

.account-form .otp-input {
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .3em;
  text-align: center;
}

.account-form .button {
  margin-top: var(--space-1);
}

.username-details {
  margin-top: 0;
}

.username-details > input[readonly] {
  color: #555761;
  background: #f3f2f7;
}

.username-security-panel {
  margin-top: 0;
  padding-top: var(--space-4);
  border-top: 1px solid rgba(17, 18, 24, .12);
}

.username-security-panel:not([hidden]) {
  display: grid;
  gap: var(--space-2);
}

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

.username-security-form {
  margin-top: var(--space-3);
}

.username-secure-copy,
.username-code-destination,
.username-code-guidance {
  margin: 0 0 var(--space-2);
  color: #575962;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
}

.username-secure-copy strong {
  color: #347313;
}

.username-code-guidance {
  color: #7a5b10;
}

.modal-dialog .field-message,
.account-flow-surface .field-message {
  min-height: 17px;
  margin: 0;
  color: #777984;
  font-size: 10px;
  font-weight: 750;
  text-align: left;
}

.modal-dialog .field-message.error-message,
.account-flow-surface .field-message.error-message {
  color: #a83227;
}

.modal-dialog .field-message.success-message,
.account-flow-surface .field-message.success-message {
  color: #347313;
}

.modal-dialog .field-message.checking-message,
.account-flow-surface .field-message.checking-message {
  color: #6551c9;
}

.account-inline-actions {
  margin-top: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.account-inline-actions button,
.account-skip {
  min-height: 38px;
  padding: 5px;
  border: 0;
  color: #575962;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-inline-actions button[disabled] {
  cursor: wait;
  opacity: .55;
}

.account-skip {
  margin-top: 0;
}

.share-generated {
  margin-top: 0;
}

.modal-dialog .account-fine-print,
.account-flow-surface .account-fine-print {
  margin-inline: auto;
  color: #7b7c84;
  font-size: 9px;
}

.modal-dialog .demo-code,
.account-flow-surface .demo-code {
  width: fit-content;
  margin-inline: auto;
  padding: var(--space-2) var(--space-3);
  color: #3e327c;
  background: rgba(135, 111, 255, .12);
  border-radius: 9px;
  font-size: 11px;
}

.modal-icon {
  width: 48px;
  height: 48px;
  margin-inline: auto;
  display: grid;
  place-items: center;
  color: #111218;
  background: var(--acid);
  border: 2px solid #111218;
  box-shadow: 4px 4px 0 #111218;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 950;
}

.toast {
  position: fixed;
  z-index: 50;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  translate: -50% 18px;
  min-width: 160px;
  max-width: calc(100vw - 36px);
  padding: 11px 15px;
  color: var(--paper);
  background: #252833;
  border: 1px solid var(--line);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, translate 160ms ease;
}

.toast.visible {
  opacity: 1;
  translate: -50% 0;
}

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

@media (min-width: 850px) {
  :root {
    --topbar-height: 76px;
    --viewport-width-offset: 65.25px;
  }

  .topbar {
    padding-left: var(--page-gutter);
    padding-right: var(--page-gutter);
  }

  .main-layout {
    padding: var(--space-2) var(--page-gutter) var(--space-6);
    grid-template-columns: minmax(0, 432px) 270px;
    gap: clamp(38px, 6vw, 78px);
  }

  .side-panel {
    display: grid;
    gap: var(--space-3);
    align-self: center;
  }
}

@media (max-width: 849px) {
  .main-layout {
    padding: var(--space-2) var(--page-gutter) var(--space-4);
  }

  .game-viewport {
    width: min(100%, 432px, calc(56.25dvh - var(--viewport-width-offset)));
    border-radius: 22px;
  }
}

@media (max-height: 720px) {
  :root {
    --topbar-height: 56px;
    --viewport-width-offset: 45px;
  }

  .main-layout {
    padding-top: var(--space-1);
    padding-bottom: var(--space-3);
  }

  .action-sheet {
    padding-bottom: max(var(--space-3), env(safe-area-inset-bottom));
  }

  .sheet-content h1,
  .sheet-content h2 {
    font-size: 27px;
  }

  .sheet-content p {
    margin-inline: auto;
  }

  .button {
    min-height: 48px;
  }
}

@media (max-width: 700px) and (orientation: portrait) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }

  .app-shell {
    height: 100dvh;
    min-height: 100dvh;
    overflow: hidden;
  }

  .main-layout {
    width: 100%;
    min-height: 0;
    padding: 0;
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
    align-items: stretch;
  }

  .game-column {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    place-items: stretch;
  }

  .game-viewport {
    width: 100%;
    height: 100%;
    max-width: none;
    min-height: 0;
    aspect-ratio: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #gameCanvas {
    object-fit: cover;
    object-position: center;
  }
}

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

  .landing-svg-runner {
    animation: none !important;
    transform: translate(137px, -35px);
  }

  .landing-motion-line {
    animation: none !important;
    opacity: .6;
  }

  .landing-runner-leg {
    animation: none !important;
  }

  .landing-demo-doors .hatch-panel.armed {
    transform: translateY(7px) scaleY(.18);
  }

  .landing-hidden-trap {
    opacity: 1;
    transform: translateY(-1px);
  }

  .trap-type-card.selected .trap-part,
  .trap-type-card.selected .trap-flame-inner,
  .trap-type-card.selected .trap-crusher-shadow {
    animation: none !important;
    opacity: 1;
    transform: none;
  }
}
