:root {
  --ink: #f4efe7;
  --paper: #f3e8d8;
  --muted: #b9ad9b;
  --dark: #090b10;
  --panel: #141821;
  --panel-2: #1d2230;
  --line: rgba(244, 239, 231, 0.14);
  --gold: #d2aa61;
  --gold-2: #8b6d35;
  --maroon: #690f0d;
  --brand-crimson: #b51224;
  --brand-crimson-bright: #ff4058;
  --brand-crimson-line: rgba(255, 64, 88, 0.42);
  --brand-crimson-right: rgba(255, 64, 88, 0.28);
  --brand-crimson-soft: rgba(181, 18, 36, 0.13);
  --life-silver: #c9d0d6;
  --life-silver-dim: rgba(201, 208, 214, 0.42);
  --life-silver-soft: rgba(201, 208, 214, 0.11);
  --jade: #5f9d8c;
  --blue: #6ea8ff;
  --green: #6dbb78;
  --warning: #d8903a;
  --danger: #e35d5b;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background:
    radial-gradient(circle at 0% 18%, rgba(181, 18, 36, 0.14), transparent 24rem),
    radial-gradient(circle at top, rgba(111, 168, 255, 0.16), transparent 36rem),
    linear-gradient(180deg, #07080c 0%, #11151d 48%, #08090d 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 14px calc(92px + env(safe-area-inset-bottom));
}

.hero {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: -4px -4px 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-left-color: var(--brand-crimson-line);
  border-right: 2px solid var(--brand-crimson-right);
  border-radius: 24px;
  background:
    linear-gradient(90deg, var(--brand-crimson-soft), transparent 18%),
    linear-gradient(135deg, rgba(210, 170, 97, 0.12), transparent 40%),
    rgba(12, 15, 22, 0.92);
  box-shadow:
    inset 3px 0 0 rgba(255, 64, 88, 0.5),
    var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-row,
.row,
.station-row,
.artifact-head,
.modal-head {
  display: flex;
  align-items: center;
}

.hero-row {
  gap: 12px;
}

.institution-strip {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(244, 239, 231, 0.1);
}

.institution-strip img {
  width: 34px;
  height: 40px;
  object-fit: contain;
}

.institution-strip span {
  color: rgba(244, 239, 231, 0.76);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.15;
  text-transform: uppercase;
}

.logo-slot {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(210, 170, 97, 0.48);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 30%, rgba(210, 170, 97, 0.38), transparent 35%),
    linear-gradient(145deg, #222836, #0d1018);
  color: var(--gold);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  overflow: hidden;
}

.logo-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-copy {
  min-width: 0;
  flex: 1;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 8vw, 2.4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.45;
}

.score-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.score-pill {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-left-color: var(--brand-crimson-line);
  border-right: 2px solid var(--brand-crimson-right);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 2px 0 0 rgba(255, 64, 88, 0.28);
}

.score-label {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
}

.score-value {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.view {
  display: grid;
  gap: 12px;
}

.card,
.team-panel,
.station-card,
.artifact-card,
.stamp-card,
.map-card,
.modal-card {
  border: 1px solid var(--line);
  border-left-color: var(--brand-crimson-line);
  border-right: 2px solid var(--brand-crimson-right);
  border-radius: var(--radius);
  background: rgba(20, 24, 33, 0.9);
  box-shadow:
    inset 3px 0 0 rgba(255, 64, 88, 0.28),
    0 10px 26px rgba(0, 0, 0, 0.18);
}

.card,
.team-panel,
.artifact-card,
.modal-card {
  padding: 16px;
}

.section-title {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  line-height: 1.05;
  letter-spacing: 0;
}

.body-copy {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.field.compact {
  margin-top: 0;
}

.field.compact.wide {
  grid-column: 1 / -1;
}

.field.compact span {
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field label {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.text-input,
.text-area {
  width: 100%;
  border: 1px solid var(--line);
  border-left-color: rgba(255, 64, 88, 0.34);
  border-right: 2px solid rgba(255, 64, 88, 0.2);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  outline: 0;
}

.text-input {
  min-height: 48px;
  padding: 0 13px;
}

.text-input option {
  background: #f4efe7;
  color: #171006;
}

.text-input option:checked {
  background: #2f58d8;
  color: #ffffff;
}

.text-area {
  min-height: 112px;
  padding: 12px 13px;
  resize: vertical;
}

.compact-area {
  min-height: 84px;
}

.text-input::placeholder,
.text-area::placeholder {
  color: rgba(244, 239, 231, 0.48);
}

.team-style-grid,
.passport-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.style-option,
.member-row,
.role-chip,
.choice-option {
  border: 1px solid var(--line);
  border-left-color: rgba(255, 64, 88, 0.3);
  border-right: 2px solid rgba(255, 64, 88, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.style-option {
  min-height: 96px;
  padding: 12px;
  color: var(--ink);
  text-align: left;
}

.style-option.active {
  border-color: currentColor;
  background: color-mix(in srgb, currentColor 14%, transparent);
}

.style-dot {
  width: 16px;
  height: 16px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: currentColor;
}

.style-name,
.role-title,
.station-key,
.artifact-title,
.stamp-key {
  font-weight: 900;
}

.style-motto,
.role-person,
.station-meta,
.artifact-line,
.stamp-status,
.map-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.member-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 9px;
  align-items: center;
  padding: 8px;
}

.role-letter {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--gold);
  color: #18130a;
  font-weight: 900;
}

.primary-btn,
.ghost-btn,
.icon-btn,
.hero-reset-btn,
.mini-btn {
  min-height: 46px;
  border-radius: 14px;
  color: var(--ink);
  font-weight: 900;
}

.primary-btn {
  width: 100%;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--gold), #f4d58c);
  color: #171006;
  box-shadow: 0 8px 0 #6d5022;
}

.link-btn {
  display: grid;
  place-items: center;
  text-decoration: none;
}

.primary-btn:active {
  transform: translateY(4px);
  box-shadow: 0 4px 0 #6d5022;
}

.primary-btn:disabled {
  opacity: 0.48;
}

.ar-launch {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 48px;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  margin: 10px 0 14px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid rgba(246, 215, 130, 0.38);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  background:
    linear-gradient(115deg, rgba(79, 223, 255, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(246, 215, 130, 0.22), rgba(13, 19, 29, 0.92));
  box-shadow: inset 0 0 28px rgba(79, 223, 255, 0.1);
}

.ar-launch::after {
  content: "";
  position: absolute;
  inset: -60% auto -60% -20%;
  width: 38%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  animation: ar-sweep 3.2s ease-in-out infinite;
}

.ar-launch strong,
.ar-launch small,
.ar-launch span {
  position: relative;
  z-index: 1;
}

.ar-launch strong,
.ar-launch small {
  display: block;
  line-height: 1.2;
}

.ar-launch strong {
  color: #f6d782;
  font-size: 0.9rem;
}

.ar-launch small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.ar-launch > span:last-child {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(79, 223, 255, 0.5);
  border-radius: 50%;
  color: #9ceeff;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(79, 223, 255, 0.26);
}

@keyframes ar-sweep {
  0%,
  55% {
    translate: 0 0;
    opacity: 0;
  }

  72% {
    opacity: 1;
  }

  100% {
    translate: 420% 0;
    opacity: 0;
  }
}

.ghost-btn,
.icon-btn,
.hero-reset-btn,
.mini-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.icon-btn {
  width: 46px;
}

.hero-reset-btn {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 72px;
  padding: 0 14px;
  color: var(--ink);
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.mini-btn {
  min-height: 34px;
  padding: 0 10px;
  color: var(--muted);
  font-size: 0.72rem;
}

.mini-btn:disabled {
  opacity: 0.45;
}

.team-panel {
  border-color: color-mix(in srgb, var(--team-color, var(--gold)) 55%, var(--line));
  border-left-color: var(--brand-crimson-line);
  background:
    linear-gradient(90deg, rgba(181, 18, 36, 0.12), transparent 20%),
    linear-gradient(135deg, color-mix(in srgb, var(--team-color, var(--gold)) 20%, transparent), transparent 60%),
    rgba(20, 24, 33, 0.94);
}

.team-head {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 12px;
  align-items: center;
}

.team-mark,
.station-icon,
.key-placeholder,
.map-node {
  display: grid;
  place-items: center;
}

.team-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: var(--team-color, var(--gold));
  color: #090b10;
  font-weight: 900;
}

.team-name {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

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

.join-existing,
.sync-strip {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.join-existing label {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.join-qr-note {
  display: grid;
  gap: 3px;
  margin-bottom: 10px;
  padding: 11px;
  border: 1px solid rgba(79, 223, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(79, 223, 255, 0.1), transparent 54%),
    rgba(255, 255, 255, 0.04);
}

.join-qr-note strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.join-qr-note span {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
}

.join-code-row {
  display: grid;
  grid-template-columns: 1fr 92px;
  gap: 8px;
}

.join-code-row .ghost-btn {
  min-height: 48px;
}

.sync-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.team-code-pill {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--team-color, var(--gold)) 52%, var(--line));
  border-left-color: var(--brand-crimson-line);
  border-right: 2px solid var(--brand-crimson-right);
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--team-color, var(--gold)) 16%, transparent);
  box-shadow: inset 2px 0 0 rgba(255, 64, 88, 0.26);
}

.role-chip {
  padding: 10px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 10;
  width: min(100%, 480px);
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background:
    linear-gradient(90deg, rgba(181, 18, 36, 0.14), transparent 22%),
    rgba(9, 11, 16, 0.92);
  transform: translateX(-50%);
  backdrop-filter: blur(18px);
}

.tabbar.visible {
  display: grid;
}

.tab-btn {
  min-height: 54px;
  border-radius: 14px;
  background: transparent;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.tab-btn.active {
  background: var(--gold);
  color: #171006;
  box-shadow: inset 3px 0 0 rgba(181, 18, 36, 0.58);
}

.active-card {
  border-color: rgba(210, 170, 97, 0.52);
  border-left-color: var(--brand-crimson-line);
  border-right: 2px solid var(--brand-crimson-right);
  background:
    linear-gradient(90deg, var(--brand-crimson-soft), transparent 20%),
    radial-gradient(circle at 20% 15%, rgba(210, 170, 97, 0.22), transparent 32%),
    #171b26;
}

.geo-waypoint {
  position: relative;
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  padding: 16px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--station-color) 44%, var(--line));
  border-left-color: var(--brand-crimson-line);
  border-right: 2px solid var(--brand-crimson-right);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(181, 18, 36, 0.1), transparent 18%),
    linear-gradient(135deg, color-mix(in srgb, var(--station-color) 12%, transparent), transparent 42%),
    #111722;
}

.geo-waypoint.compact {
  grid-template-columns: 82px 1fr;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: transparent;
}

.beacon-visual {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  place-items: center;
  isolation: isolate;
}

.geo-waypoint.compact .beacon-visual {
  width: 78px;
  height: 78px;
}

.beacon-ring {
  position: absolute;
  border: 1px solid color-mix(in srgb, var(--station-color) 55%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 22px color-mix(in srgb, var(--station-color) 22%, transparent);
}

.ring-1 {
  inset: 9px;
}

.ring-2 {
  inset: 22px;
  opacity: 0.72;
}

.ring-3 {
  inset: 36px;
  opacity: 0.5;
}

.beacon-tower {
  position: relative;
  display: grid;
  width: 46px;
  height: 64px;
  justify-items: center;
  z-index: 2;
}

.tower-spire {
  width: 0;
  height: 0;
  border-right: 8px solid transparent;
  border-bottom: 18px solid color-mix(in srgb, var(--station-color) 80%, #ffffff);
  border-left: 8px solid transparent;
}

.tower-body {
  width: 30px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--station-color) 70%, #ffffff);
  background:
    linear-gradient(90deg, transparent 43%, color-mix(in srgb, var(--station-color) 70%, #ffffff) 44% 56%, transparent 57%),
    linear-gradient(180deg, rgba(255,255,255,0.14), transparent),
    rgba(8, 11, 16, 0.86);
}

.tower-base {
  width: 50px;
  height: 10px;
  border: 1px solid color-mix(in srgb, var(--station-color) 58%, var(--line));
  background: rgba(255, 255, 255, 0.06);
}

.beacon-pin {
  position: absolute;
  bottom: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow:
    0 0 0 7px color-mix(in srgb, var(--station-color) 24%, transparent),
    0 0 24px color-mix(in srgb, var(--station-color) 58%, transparent);
  z-index: 3;
}

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

.beacon-copy .section-title {
  margin-bottom: 4px;
}

.beacon-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.beacon-metrics span {
  border: 1px solid rgba(245, 239, 226, 0.14);
  border-radius: 999px;
  padding: 6px 8px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
}

.beacon-action {
  grid-column: 1 / -1;
  display: grid;
  min-height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--gold);
  color: #171006;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.location-panel {
  display: grid;
  gap: 12px;
}

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

.map-stage {
  position: relative;
  min-height: 310px;
  overflow: hidden;
  border: 1px solid rgba(245, 239, 226, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(79, 223, 255, 0.1), transparent 44%),
    #080c12;
}

.amazon-map {
  position: absolute;
  inset: 0;
}

.tactical-map {
  position: absolute;
  inset: 10px 10px auto;
  z-index: 2;
  height: 188px;
  overflow: hidden;
  border: 1px solid rgba(79, 223, 255, 0.3);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(79, 223, 255, 0.13), transparent 42%),
    linear-gradient(rgba(79, 223, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(79, 223, 255, 0.08) 1px, transparent 1px),
    rgba(5, 9, 15, 0.86);
  background-size:
    100% 100%,
    28px 28px,
    28px 28px,
    100% 100%;
  box-shadow:
    inset 0 0 38px rgba(79, 223, 255, 0.08),
    0 16px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.tactical-heading {
  position: absolute;
  top: 8px;
  left: 10px;
  z-index: 2;
  display: flex;
  gap: 7px;
  align-items: center;
  color: #f4d58c;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.tactical-heading strong {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  border: 1px solid rgba(244, 213, 140, 0.42);
  border-radius: 50%;
  color: var(--ink);
  letter-spacing: 0;
}

.tactical-grid {
  position: absolute;
  inset: 36px 18px 16px;
  border: 1px solid rgba(244, 239, 231, 0.1);
  background:
    linear-gradient(45deg, transparent 49.4%, rgba(244, 239, 231, 0.08) 50%, transparent 50.6%),
    linear-gradient(-45deg, transparent 49.4%, rgba(244, 239, 231, 0.08) 50%, transparent 50.6%);
}

.tactical-node {
  position: absolute;
  z-index: 3;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  translate: -50% -50%;
  border: 1px solid color-mix(in srgb, var(--node-color) 72%, #ffffff);
  border-radius: 50%;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--node-color) 46%, transparent), rgba(5, 9, 15, 0.92) 62%);
  color: #ffffff;
  font-size: 0.56rem;
  font-weight: 900;
  box-shadow: 0 0 20px color-mix(in srgb, var(--node-color) 48%, transparent);
}

.tactical-node.selected {
  width: 38px;
  height: 38px;
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--node-color) 18%, transparent),
    0 0 26px color-mix(in srgb, var(--node-color) 64%, transparent);
}

.tactical-node.completed {
  border-color: rgba(109, 187, 120, 0.92);
  box-shadow: 0 0 20px rgba(109, 187, 120, 0.5);
}

.tactical-node.user {
  width: 24px;
  height: 24px;
  border-color: #ffffff;
  background: #4fdfff;
  box-shadow:
    0 0 0 8px rgba(79, 223, 255, 0.18),
    0 0 22px rgba(79, 223, 255, 0.65);
}

.tactical-node.user span {
  width: 0;
  height: 0;
  border-right: 5px solid transparent;
  border-bottom: 12px solid #081019;
  border-left: 5px solid transparent;
}

.tactical-empty {
  height: 100%;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 22px;
  color: var(--muted);
  text-align: center;
}

.tactical-empty strong {
  color: var(--ink);
}

.map-empty {
  height: 100%;
  min-height: 310px;
  display: grid;
  place-items: center;
  padding: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  text-align: center;
}

.map-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(circle at 50% 50%, rgba(79, 223, 255, 0.16), transparent 34%),
    rgba(8, 12, 18, 0.76);
  pointer-events: none;
}

.about-card {
  display: grid;
  gap: 14px;
}

.about-brand {
  display: grid;
  grid-template-columns: minmax(78px, 0.42fr) 1fr;
  gap: 14px;
  align-items: center;
  min-height: 132px;
}

.about-wordmark,
.about-game-logo {
  max-width: 100%;
  object-fit: contain;
}

.about-wordmark {
  max-height: 124px;
  justify-self: center;
  opacity: 0.9;
  filter: drop-shadow(0 0 20px rgba(244, 213, 140, 0.16));
}

.about-game-logo {
  max-height: 132px;
  border: 1px solid rgba(210, 170, 97, 0.22);
  border-radius: 8px;
  background: rgba(8, 11, 16, 0.62);
}

.credit-list {
  display: grid;
  gap: 9px;
}

.credit-row {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left-color: var(--brand-crimson-line);
  border-right: 2px solid var(--brand-crimson-right);
  border-radius: 8px;
  background:
    linear-gradient(90deg, var(--brand-crimson-soft), transparent 24%),
    rgba(255, 255, 255, 0.04);
  box-shadow: inset 2px 0 0 rgba(255, 64, 88, 0.22);
}

.credit-row span {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.credit-row strong {
  color: var(--ink);
  font-size: 0.98rem;
}

.copyright-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.quest-compass {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  display: grid;
  grid-template-columns: 58px minmax(76px, auto);
  gap: 9px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(79, 223, 255, 0.34);
  border-radius: 8px;
  background: rgba(8, 12, 18, 0.82);
  box-shadow: 0 0 24px rgba(79, 223, 255, 0.16);
  backdrop-filter: blur(12px);
}

.compass-ring {
  position: relative;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(244, 239, 231, 0.22);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(79, 223, 255, 0.18), transparent 56%),
    rgba(255, 255, 255, 0.05);
}

.compass-north {
  position: absolute;
  top: 4px;
  color: #f4d58c;
  font-size: 0.62rem;
  font-weight: 900;
}

.compass-pointer {
  width: 4px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f4d58c 0 48%, rgba(79, 223, 255, 0.92) 52% 100%);
  box-shadow:
    0 -8px 18px rgba(244, 213, 140, 0.5),
    0 8px 18px rgba(79, 223, 255, 0.42);
  transform-origin: 50% 50%;
}

.compass-pointer::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 50%;
  width: 0;
  height: 0;
  border-right: 7px solid transparent;
  border-bottom: 11px solid #f4d58c;
  border-left: 7px solid transparent;
  transform: translateX(-50%);
}

.compass-readout strong,
.compass-readout span {
  display: block;
}

.compass-target {
  color: #f4d58c;
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compass-readout strong {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.1;
}

.compass-readout span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.calibration-panel {
  display: grid;
  gap: 10px;
}

.calibration-panel.prominent {
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, var(--line));
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.calibration-label {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.calibration-actions,
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.calibration-actions .host-link {
  min-width: min(100%, 150px);
}

.calibration-gps-btn {
  margin-top: 2px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid color-mix(in srgb, var(--station-color) 42%, var(--line));
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.045);
}

.legend-chip span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--station-color) 35%, transparent);
  color: var(--ink);
}

.legend-chip.active {
  border-color: color-mix(in srgb, var(--station-color) 78%, var(--line));
  color: var(--ink);
  background: color-mix(in srgb, var(--station-color) 18%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--station-color) 22%, transparent);
}

.overrides-json {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

.station-card {
  width: 100%;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
  color: var(--ink);
  text-align: left;
}

.station-card.locked {
  opacity: 0.52;
}

.station-icon {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--station-color) 42%, var(--line));
  background: color-mix(in srgb, var(--station-color) 16%, transparent);
  color: var(--station-color);
  font-size: 1.35rem;
}

.station-key {
  display: block;
  margin-bottom: 2px;
  font-size: 1rem;
}

.station-name {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
}

.status-badge {
  min-width: 28px;
  min-height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 900;
  overflow: hidden;
}

.station-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.station-detail-art {
  width: min(100%, 220px);
  aspect-ratio: 1 / 1.18;
  display: grid;
  place-items: center;
  margin: 4px auto 14px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--station-color) 45%, var(--line));
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--station-color) 26%, transparent), transparent 60%),
    rgba(255, 255, 255, 0.04);
}

.station-detail-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.status-badge.done {
  background: rgba(109, 187, 120, 0.22);
  color: var(--green);
}

.map-list {
  display: grid;
  gap: 10px;
}

.map-item {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 10px;
}

.map-node {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-weight: 900;
}

.map-node.done {
  border-color: var(--green);
  background: rgba(109, 187, 120, 0.22);
  color: var(--green);
}

.map-card {
  padding: 12px;
}

.map-floor,
.artifact-kicker,
.crest-kicker {
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.map-title {
  margin-top: 3px;
  font-weight: 900;
}

.crest {
  display: grid;
  place-items: center;
  text-align: center;
}

.crest-home {
  text-align: left;
}

.crest-home-head {
  width: 100%;
  justify-content: space-between;
  gap: 12px;
}

.crest-home .crest-puzzle {
  width: min(100%, 320px);
}

.crest-seal {
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  margin: 12px auto;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(210, 170, 97, 0.22), transparent 58%),
    rgba(255, 255, 255, 0.05);
  color: var(--gold);
  font-size: 2rem;
  font-weight: 900;
}

.crest-puzzle {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 3px;
  margin: 14px auto;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(210, 170, 97, 0.48);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 50%, rgba(210, 170, 97, 0.24), transparent 60%),
    #06080c;
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.72), 0 18px 38px rgba(0, 0, 0, 0.24);
  isolation: isolate;
}

.crest-puzzle::before,
.crest-puzzle::after {
  content: "";
  position: absolute;
  inset: -16%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
}

.crest-puzzle::before {
  background:
    radial-gradient(circle at 22% 30%, rgba(116, 206, 255, 0.38), transparent 12%),
    radial-gradient(circle at 50% 52%, rgba(210, 170, 97, 0.3), transparent 22%),
    radial-gradient(circle at 78% 62%, rgba(142, 98, 214, 0.32), transparent 16%);
  filter: blur(14px);
}

.crest-puzzle::after {
  background:
    conic-gradient(from 0deg, transparent, rgba(116, 206, 255, 0.22), transparent, rgba(244, 213, 140, 0.24), transparent);
  mix-blend-mode: screen;
}

.crest-puzzle.fusing {
  animation: crestVoltage 2.8s ease-in-out infinite;
}

.crest-puzzle.fusing::before {
  opacity: 0.64;
  animation: crestCorePulse 2.2s ease-in-out infinite;
}

.crest-puzzle.fusing::after {
  opacity: 0.5;
  animation: crestCurrentSweep 4s linear infinite;
}

.crest-puzzle.complete {
  border-color: rgba(244, 213, 140, 0.86);
  box-shadow:
    inset 0 0 28px rgba(244, 213, 140, 0.2),
    0 0 34px rgba(116, 206, 255, 0.2),
    0 18px 38px rgba(0, 0, 0, 0.24);
}

.crest-puzzle.complete::before,
.crest-puzzle.complete::after {
  opacity: 0.76;
}

.crest-piece {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--station-color) 20%, transparent), transparent),
    url("./assets/life-quest-logo.png"),
    #161b25;
  background-size: auto, 200% 200%, auto;
  background-position: center, var(--bg-x) var(--bg-y), center;
  color: var(--station-color);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  transition: filter 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.crest-piece.unlocked {
  background-image: url("./assets/life-quest-logo.png");
  background-size: 200% 200%;
  background-position: var(--bg-x) var(--bg-y);
  color: transparent;
  filter: saturate(1.08) contrast(1.05);
  animation: pieceRestore 740ms ease-out both;
}

.crest-piece.locked {
  filter: grayscale(0.86) brightness(0.52) contrast(1.18);
  opacity: 0.78;
}

.crest-piece.locked::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 42%, rgba(210, 170, 97, 0.2) 43%, transparent 45%),
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.06) 51%, transparent 53%);
  mix-blend-mode: screen;
}

.crest-piece span {
  position: relative;
  z-index: 1;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--station-color) 55%, var(--line));
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.34);
  color: var(--station-color);
}

.crest-piece.unlocked span {
  opacity: 0;
}

.piece-0 {
  clip-path: polygon(0 0, 100% 0, 91% 18%, 100% 38%, 92% 58%, 100% 100%, 0 100%, 8% 72%, 0 51%, 9% 24%);
}

.piece-1 {
  clip-path: polygon(7% 0, 100% 0, 94% 28%, 100% 50%, 91% 76%, 100% 100%, 0 100%, 8% 75%, 0 54%, 10% 29%, 0 11%);
}

.piece-2 {
  clip-path: polygon(0 0, 92% 0, 100% 18%, 91% 42%, 100% 66%, 92% 100%, 0 100%, 8% 76%, 0 52%, 9% 28%);
}

.piece-3 {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8% 77%, 0 56%, 10% 30%);
}

.piece-4 {
  clip-path: polygon(0 0, 100% 0, 91% 27%, 100% 48%, 92% 72%, 100% 100%, 0 100%, 0 0);
}

.piece-5 {
  clip-path: polygon(7% 0, 100% 0, 92% 28%, 100% 50%, 91% 74%, 100% 100%, 0 100%, 8% 74%, 0 51%, 9% 27%);
}

.piece-6 {
  clip-path: polygon(0 0, 92% 0, 100% 22%, 91% 44%, 100% 67%, 92% 100%, 0 100%, 8% 72%, 0 49%, 9% 25%);
}

.piece-7 {
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 8% 75%, 0 51%, 10% 27%);
}

.crest-breaks {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  z-index: 3;
  pointer-events: none;
  mix-blend-mode: screen;
}

.crest-breaks path {
  fill: none;
  stroke: rgba(210, 170, 97, 0.72);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 8px rgba(210, 170, 97, 0.45));
}

.crest-breaks path:nth-child(odd) {
  stroke: rgba(244, 239, 231, 0.34);
  stroke-width: 1.4;
}

.crest-energy {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: screen;
}

.crest-puzzle.fusing .crest-energy,
.crest-puzzle.complete .crest-energy {
  opacity: 1;
}

.energy,
.spark {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter:
    drop-shadow(0 0 5px rgba(116, 206, 255, 0.9))
    drop-shadow(0 0 12px rgba(210, 170, 97, 0.62));
}

.energy {
  stroke: #7ee7ff;
  stroke-width: 4;
  stroke-dasharray: 30 168;
  stroke-dashoffset: 0;
  animation: electricRun 1.35s linear infinite;
}

.energy-2 {
  animation-delay: -0.28s;
  stroke: #f7d88b;
}

.energy-3 {
  animation-delay: -0.52s;
}

.energy-4 {
  animation-delay: -0.8s;
  stroke: #f7d88b;
  stroke-dasharray: 44 210;
}

.spark {
  stroke: #ffffff;
  stroke-width: 2.4;
  stroke-dasharray: 12 88;
  opacity: 0;
  animation: sparkFlash 2.4s steps(1, end) infinite;
}

.spark-2 {
  animation-delay: 0.7s;
}

.spark-3 {
  animation-delay: 1.25s;
}

.crest-puzzle.complete .energy {
  animation-duration: 0.95s;
  stroke-dasharray: 58 112;
}

.crest-puzzle.complete .spark {
  animation-duration: 1.55s;
}

@keyframes electricRun {
  0% {
    stroke-dashoffset: 190;
    opacity: 0;
  }
  10%,
  72% {
    opacity: 1;
  }
  100% {
    stroke-dashoffset: -190;
    opacity: 0;
  }
}

@keyframes sparkFlash {
  0%,
  11%,
  19%,
  100% {
    opacity: 0;
  }
  12%,
  18% {
    opacity: 1;
  }
}

@keyframes crestVoltage {
  0%,
  100% {
    transform: translateZ(0) scale(1);
  }
  48% {
    transform: translateZ(0) scale(1.006);
  }
  52% {
    transform: translateZ(0) scale(1.002);
  }
}

@keyframes crestCorePulse {
  0%,
  100% {
    transform: scale(0.98) rotate(0deg);
    opacity: 0.44;
  }
  50% {
    transform: scale(1.08) rotate(6deg);
    opacity: 0.78;
  }
}

@keyframes crestCurrentSweep {
  to {
    transform: rotate(1turn);
  }
}

@keyframes pieceRestore {
  0% {
    opacity: 0.42;
    filter: brightness(1.8) saturate(1.5);
    transform: scale(0.96);
  }
  64% {
    opacity: 1;
    filter: brightness(1.28) saturate(1.2);
    transform: scale(1.018);
  }
  100% {
    filter: saturate(1.08) contrast(1.05);
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .crest-puzzle,
  .crest-puzzle::before,
  .crest-puzzle::after,
  .crest-piece.unlocked,
  .energy,
  .spark {
    animation: none;
  }

  .crest-puzzle.fusing .crest-energy,
  .crest-puzzle.complete .crest-energy {
    opacity: 0.72;
  }
}

.stamp-card {
  min-height: 132px;
  padding: 12px;
}

.key-placeholder {
  width: 48px;
  height: 48px;
  margin-bottom: 9px;
  border: 1px solid color-mix(in srgb, var(--station-color) 48%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--station-color) 14%, transparent);
  color: var(--station-color);
  font-size: 1.18rem;
  font-weight: 900;
  overflow: hidden;
}

.key-placeholder.large {
  width: 172px;
  height: 216px;
  margin: 14px auto 0;
  border-radius: 20px;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.key-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artifact-card {
  display: grid;
  justify-items: center;
  border-color: color-mix(in srgb, var(--station-color) 50%, var(--line));
}

.host-mode .app-shell {
  width: min(100%, 1120px);
}

.host-mode .logo-slot {
  border-color: var(--life-silver-dim);
  background:
    radial-gradient(circle at 50% 28%, rgba(201, 208, 214, 0.24), transparent 34%),
    linear-gradient(145deg, #20242c, #0b0e14);
  box-shadow:
    inset 0 0 20px rgba(201, 208, 214, 0.08),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.host-mode .logo-slot img {
  opacity: 0.48;
  filter: grayscale(1) saturate(0) brightness(0.72) contrast(0.98);
}

.host-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.host-card {
  align-content: start;
  min-height: 0;
}

.host-target {
  width: min(100%, 250px);
  height: auto;
  aspect-ratio: 1;
  padding: 14px;
}

.host-target img {
  width: 100%;
  height: 100%;
}

.host-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.host-link {
  display: grid;
  min-height: 40px;
  place-items: center;
  padding: 0 10px;
  border: 1px solid color-mix(in srgb, var(--station-color) 44%, var(--line));
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}

.host-link.danger {
  border-color: rgba(227, 93, 91, 0.48);
  color: #ffc3c1;
}

.host-link:disabled {
  opacity: 0.48;
}

.primary-btn.is-loading,
.ghost-btn.is-loading,
.host-link.is-loading,
.mini-btn.is-loading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0.86;
  cursor: progress;
  pointer-events: none;
}

.primary-btn.is-loading {
  display: flex;
}

.primary-btn.is-loading::before,
.ghost-btn.is-loading::before,
.host-link.is-loading::before,
.mini-btn.is-loading::before {
  content: "";
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: button-spin 0.72s linear infinite;
}

@keyframes button-spin {
  to {
    rotate: 360deg;
  }
}

.host-symbol {
  border-color: var(--life-silver-dim);
  background:
    radial-gradient(circle at 50% 30%, rgba(201, 208, 214, 0.16), transparent 38%),
    var(--life-silver-soft);
  opacity: 0.88;
  transform: scale(0.86);
  transform-origin: top center;
}

.host-symbol img {
  opacity: 0.44;
  filter: grayscale(1) saturate(0) brightness(0.7) contrast(1.06);
}

.team-board-card {
  gap: 12px;
}

.team-board {
  display: grid;
  gap: 8px;
}

.team-board-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
}

.team-board-row strong,
.team-board-row span {
  display: block;
}

.team-board-row strong {
  color: var(--ink);
}

.team-board-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.geo-token {
  width: min(100%, 188px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-top: 14px;
  border: 1px solid color-mix(in srgb, var(--station-color) 58%, var(--line));
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--station-color) 34%, transparent), transparent 58%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 22px),
    #080b10;
}

.geo-token-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--station-color) 72%, var(--line));
  border-radius: 50%;
  color: var(--station-color);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 900;
  box-shadow: 0 0 28px color-mix(in srgb, var(--station-color) 42%, transparent);
}

.geo-token-label {
  align-self: end;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.artifact-head {
  width: 100%;
  justify-content: space-between;
}

.artifact-title {
  margin-top: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.artifact-proof {
  position: relative;
  display: block;
  width: min(100%, 260px);
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(246, 215, 130, 0.42);
  border-radius: 16px;
  color: #171006;
  text-decoration: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.artifact-proof img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.artifact-proof span {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  display: grid;
  min-height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  background: rgba(246, 215, 130, 0.9);
  font-size: 0.78rem;
  font-weight: 900;
}

.target-frame {
  width: 188px;
  height: 188px;
  display: grid;
  place-items: center;
  margin-top: 14px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
}

.target-frame img {
  width: 164px;
  height: 164px;
}

.artifact-code,
.station-url {
  max-width: 100%;
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.station-url {
  margin-top: 8px;
  color: var(--muted);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  align-items: end;
  background: rgba(0, 0, 0, 0.62);
}

.modal-card {
  width: min(100%, 480px);
  max-height: 92dvh;
  margin: 0 auto;
  overflow: auto;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  background: #11151d;
}

.modal-head {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.modal-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
}

.reset-quest-card {
  border-top: 1px solid rgba(210, 28, 48, 0.52);
  box-shadow:
    0 -18px 54px rgba(0, 0, 0, 0.34),
    inset 3px 0 0 rgba(210, 28, 48, 0.78),
    inset -3px 0 0 rgba(210, 28, 48, 0.78);
}

.reset-quest-core {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(244, 213, 140, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 20% 50%, rgba(210, 28, 48, 0.2), transparent 42%),
    rgba(255, 255, 255, 0.04);
}

.reset-quest-sigil {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid rgba(244, 213, 140, 0.48);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(244, 213, 140, 0.2), transparent 62%),
    rgba(8, 11, 16, 0.9);
  color: #f4d58c;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 900;
  box-shadow: 0 0 24px rgba(210, 28, 48, 0.32);
}

.reset-quest-core strong {
  display: block;
  color: var(--ink);
  font-size: 1rem;
}

.reset-quest-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.reset-quest-actions .primary-btn {
  margin-top: 0;
}

.reset-confirm-btn {
  background: linear-gradient(135deg, #d21c30, #f4d58c);
  box-shadow: 0 8px 0 #66111b;
}

.camera-box {
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #050609;
}

.camera-box video {
  width: 100%;
  height: 300px;
  object-fit: cover;
}

.camera-fallback {
  min-height: 300px;
  display: grid;
  place-items: center;
  padding: 20px;
  text-align: center;
}

.join-qr-card {
  display: grid;
  gap: 12px;
}

.join-qr-frame {
  display: grid;
  width: min(100%, 270px);
  aspect-ratio: 1;
  place-items: center;
  margin: 4px auto 0;
  padding: 16px;
  border: 1px solid rgba(210, 170, 97, 0.44);
  border-radius: 8px;
  background: #f7f3ea;
  box-shadow:
    0 0 0 5px rgba(210, 170, 97, 0.08),
    0 18px 38px rgba(0, 0, 0, 0.32);
}

.join-qr-frame svg {
  width: 100%;
  height: 100%;
  display: block;
}

.join-code-display {
  display: grid;
  place-items: center;
  min-height: 52px;
  border: 1px solid rgba(244, 239, 231, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.join-link-text {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  background: rgba(255, 255, 255, 0.04);
}

.choice-stack {
  display: grid;
  gap: 9px;
  margin: 12px 0;
}

.choice-option {
  width: 100%;
  padding: 13px;
  color: var(--ink);
  text-align: left;
}

.choice-option.active {
  border-color: var(--gold);
  background: rgba(210, 170, 97, 0.14);
}

.notice {
  margin: 10px 0 0;
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 800;
}

.success-box {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(109, 187, 120, 0.32);
  border-radius: 16px;
  background: rgba(109, 187, 120, 0.1);
}

.xp {
  color: var(--green);
  font-weight: 900;
}

.key-burst {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  pointer-events: none;
  color: #fff7df;
  isolation: isolate;
  animation: keyBurstDismiss 2350ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.key-burst::before {
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at 50% 48%, color-mix(in srgb, var(--station-color), white 34%) 0 2%, transparent 22%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--station-color), transparent 42%), transparent 54%),
    rgba(255, 255, 255, 0.42);
  content: "";
  animation: keyBurstFlash 720ms ease-out forwards;
}

.key-burst::after {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, transparent 0 46%, rgba(255, 255, 255, 0.82) 49% 51%, transparent 54%),
    radial-gradient(circle, transparent 0 34%, rgba(3, 6, 12, 0.78) 68%, rgba(3, 6, 12, 0.94));
  content: "";
  mix-blend-mode: screen;
  opacity: 0;
  animation: keyBurstSkySplit 540ms 60ms ease-out forwards;
}

.key-burst-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.key-burst-field span {
  --angle: calc((var(--bolt) * 37deg) - 162deg);
  --distance: calc(16vh + (var(--bolt) * 2.2vh));
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 42vh;
  background:
    linear-gradient(color-mix(in srgb, var(--station-color), white 42%), #fff 38%, var(--station-color));
  clip-path: polygon(48% 0, 88% 22%, 60% 22%, 100% 52%, 58% 45%, 72% 100%, 24% 62%, 48% 62%, 0 28%, 36% 34%);
  filter:
    drop-shadow(0 0 10px var(--station-color))
    drop-shadow(0 0 28px var(--station-color));
  opacity: 0;
  transform: rotate(var(--angle)) translateY(calc(-1 * var(--distance))) scaleY(0.15);
  transform-origin: 50% 100%;
  animation: keyBoltStrike 820ms calc(var(--bolt) * 32ms) cubic-bezier(0.18, 0.82, 0.28, 1) forwards;
}

.key-burst-core {
  position: relative;
  display: grid;
  min-width: min(82vw, 390px);
  justify-items: center;
  padding: 28px 22px 24px;
  text-align: center;
  text-transform: uppercase;
  animation: keyBurstCore 1240ms cubic-bezier(0.18, 0.86, 0.22, 1) both;
}

.key-burst-core::before,
.key-burst-core::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 240px;
  height: 240px;
  border: 2px solid color-mix(in srgb, var(--station-color), white 28%);
  border-radius: 50%;
  box-shadow:
    0 0 26px var(--station-color),
    inset 0 0 28px color-mix(in srgb, var(--station-color), transparent 26%);
  content: "";
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.38);
  animation: keyBurstRing 1120ms 80ms ease-out forwards;
}

.key-burst-core::after {
  width: 320px;
  height: 320px;
  border-style: dashed;
  animation-delay: 180ms;
  animation-duration: 1380ms;
}

.key-burst-mark {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  margin-bottom: 12px;
  border: 1px solid color-mix(in srgb, var(--station-color), white 38%);
  border-radius: 50%;
  background: rgba(5, 8, 13, 0.82);
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--station-color), transparent 72%),
    0 0 34px var(--station-color);
  color: #fff8dc;
  font-size: 1.8rem;
  font-weight: 1000;
  line-height: 1;
}

.key-burst-kicker {
  color: color-mix(in srgb, var(--station-color), white 38%);
  font-size: 0.78rem;
  font-weight: 1000;
  letter-spacing: 0.26em;
}

.key-burst-title {
  margin-top: 4px;
  color: #fff9e8;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.1rem, 11vw, 4.6rem);
  font-weight: 900;
  line-height: 0.92;
  text-shadow:
    0 0 10px rgba(255, 255, 255, 0.72),
    0 0 28px var(--station-color),
    0 4px 0 rgba(0, 0, 0, 0.6);
}

.key-burst-xp {
  margin-top: 12px;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--station-color), white 34%);
  background: rgba(5, 8, 13, 0.78);
  box-shadow: 0 0 22px color-mix(in srgb, var(--station-color), transparent 30%);
  color: #fff3bd;
  font-size: 0.92rem;
  font-weight: 1000;
  letter-spacing: 0.14em;
}

@keyframes keyBurstDismiss {
  0%,
  74% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    visibility: hidden;
  }
}

@keyframes keyBurstFlash {
  0% {
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes keyBurstSkySplit {
  0% {
    opacity: 0;
    transform: scaleX(0.1);
  }
  24% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scaleX(1.4);
  }
}

@keyframes keyBoltStrike {
  0% {
    opacity: 0;
    transform: rotate(var(--angle)) translateY(calc(-1 * var(--distance))) scaleY(0.05);
  }
  12% {
    opacity: 1;
  }
  48% {
    opacity: 0.94;
    transform: rotate(var(--angle)) translateY(calc(-1 * var(--distance))) scaleY(1);
  }
  100% {
    opacity: 0;
    transform: rotate(calc(var(--angle) + 7deg)) translateY(calc(-1 * var(--distance))) scaleY(0.22);
  }
}

@keyframes keyBurstCore {
  0% {
    opacity: 0;
    transform: scale(0.54) translateY(20px);
  }
  42% {
    opacity: 1;
    transform: scale(1.08) translateY(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes keyBurstRing {
  0% {
    opacity: 0.95;
    transform: translate(-50%, -50%) scale(0.22) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.28) rotate(50deg);
  }
}

@media (min-width: 720px) {
  .app-shell {
    padding-top: 24px;
  }

  .artifact-card {
    min-height: 520px;
  }
}
