:root {
  --bg: #070407;
  --panel: rgba(12, 8, 12, 0.88);
  --green: #7dffb2;
  --amber: #ffb238;
  --red: #ff354b;
  --blue: #42c6ff;
  --violet: #9b5cff;
  --text: #fff2cf;
  --muted: #b7a77d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 16%, rgba(255, 178, 56, 0.18) 0, transparent 34%),
    linear-gradient(180deg, #130914 0, var(--bg) 48%, #020102 100%);
  color: var(--text);
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0;
}

.signal-canvas,
.crt-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.signal-canvas { opacity: 0.38; }

body.sector-relic .signal-canvas {
  display: none;
}

body.sector-relic .crt-overlay {
  opacity: 0.18;
}

body.sector-moria {
  background: #03070d;
  color: #e7edf0;
  font-family: Georgia, 'Times New Roman', serif;
}

body.sector-moria .signal-canvas,
body.sector-moria .crt-overlay {
  display: none;
}

body.sector-moria .site-shell {
  width: 100%;
  padding: 0;
  display: block;
}

body.sector-treasure-map {
  background: #120b07;
  color: #372111;
  font-family: Georgia, 'Times New Roman', serif;
}

body.sector-treasure-map .signal-canvas,
body.sector-treasure-map .crt-overlay {
  display: none;
}

body.sector-treasure-map .site-shell {
  width: 100%;
  padding: 0;
  display: block;
}

.crt-overlay {
  background:
    radial-gradient(ellipse at center, transparent 0 54%, rgba(0,0,0,0.42) 100%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(255,178,56,0.035) 0 1px, transparent 1px 9px);
  mix-blend-mode: screen;
  opacity: 0.44;
}

.site-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 44px 0;
  display: flex;
  align-items: center;
}

.moria-puzzle {
  position: relative;
  height: 100vh;
  overflow: hidden;
  background: #02050a;
}

.moria-scene,
.moria-bg,
.moria-mist,
.moria-water,
.moria-door-light {
  position: absolute;
  inset: 0;
}

.moria-bg {
  background:
    linear-gradient(180deg, rgba(2, 6, 13, 0.16), rgba(2, 6, 13, 0.34) 52%, rgba(2, 6, 13, 0.84)),
    url('/public/assets/img/puzzles/pz010/moria-gate-bg.png') center center / contain no-repeat,
    #02050a;
  transform: none;
  filter: saturate(0.88) brightness(0.72);
}

.moria-puzzle::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 42%, rgba(178, 220, 235, 0.18), transparent 22%),
    radial-gradient(ellipse at center, transparent 0 48%, rgba(0, 0, 0, 0.62) 100%);
}

.moria-mist {
  opacity: 0.42;
  background:
    radial-gradient(ellipse at 24% 64%, rgba(178, 208, 214, 0.26), transparent 34%),
    radial-gradient(ellipse at 76% 58%, rgba(118, 156, 178, 0.22), transparent 36%),
    linear-gradient(90deg, transparent, rgba(206, 230, 226, 0.12), transparent);
  filter: blur(18px);
  animation: moriaMist 24s ease-in-out infinite alternate;
}

.moria-mist-b {
  opacity: 0.24;
  animation-duration: 34s;
  animation-direction: alternate-reverse;
}

.moria-water {
  top: auto;
  bottom: 0;
  height: clamp(180px, 26vh, 320px);
  background:
    linear-gradient(180deg, transparent 0%, rgba(7, 19, 27, 0.44) 38%, rgba(3, 10, 16, 0.82) 100%),
    radial-gradient(ellipse at 50% 34%, rgba(194, 229, 230, 0.2), transparent 48%);
  transform-origin: center bottom;
  animation: moriaWater 9s ease-in-out infinite;
  mix-blend-mode: screen;
  opacity: 0.56;
  overflow: hidden;
}

.moria-water::before,
.moria-water::after {
  content: '';
  position: absolute;
  inset: 18% -12% 0;
  pointer-events: none;
}

.moria-water::before {
  background:
    radial-gradient(ellipse at 36% 38%, rgba(205, 238, 235, 0.18), transparent 34%),
    radial-gradient(ellipse at 66% 42%, rgba(118, 168, 184, 0.16), transparent 38%),
    linear-gradient(90deg, transparent 0%, rgba(216, 245, 240, 0.16) 48%, transparent 100%);
  filter: blur(18px);
  opacity: 0.46;
  transform: translateX(-4%);
  animation: moriaWaterGlow 13s ease-in-out infinite alternate;
}

.moria-water::after {
  inset: 34% -8% -12%;
  background: radial-gradient(ellipse at center, rgba(207, 239, 236, 0.16), transparent 58%);
  filter: blur(28px);
  opacity: 0.34;
  transform: scaleX(1.08);
  animation: moriaWaterBreath 11s ease-in-out infinite;
}

.moria-door-light {
  opacity: 0;
  background: radial-gradient(ellipse at 50% 42%, rgba(197, 237, 228, 0.52), transparent 16%);
  transition: opacity 1.2s ease;
}

.moria-stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  height: 100vh;
  padding: clamp(18px, 3vw, 42px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.moria-header {
  max-width: 720px;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.82);
}

.moria-header p {
  margin: 0 0 10px;
  color: #a8ccc9;
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.moria-header h1 {
  margin: 0 0 10px;
  color: #edf7f2;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(36px, 5.6vw, 82px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: 0;
}

.moria-header span {
  display: block;
  max-width: 560px;
  color: #b9c8c5;
  font-size: clamp(15px, 1.6vw, 20px);
}

.moria-runes {
  position: relative;
  min-height: 0;
}

.moria-rune {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: clamp(44px, 5vw, 68px);
  height: clamp(44px, 5vw, 68px);
  border: 1px solid rgba(188, 226, 218, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(9, 21, 29, 0.58), rgba(3, 7, 12, 0.22));
  color: rgba(198, 231, 222, 0.74);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(27px, 3.8vw, 45px);
  line-height: 1;
  text-shadow: 0 0 14px rgba(176, 235, 221, 0.25);
  box-shadow: inset 0 0 18px rgba(178, 220, 218, 0.08), 0 0 18px rgba(13, 32, 42, 0.24);
  transform: translate(-50%, -50%);
  cursor: pointer;
  transition: color 0.45s ease, border-color 0.45s ease, box-shadow 0.45s ease, transform 0.45s ease, opacity 0.45s ease;
}

.moria-rune:hover,
.moria-rune:focus-visible {
  color: #e9fff6;
  border-color: rgba(212, 244, 234, 0.72);
  box-shadow: 0 0 28px rgba(178, 235, 220, 0.34), inset 0 0 22px rgba(199, 244, 232, 0.13);
  outline: none;
  transform: translate(-50%, -50%) scale(1.06);
}

.moria-rune.awake {
  color: #f4fff7;
  border-color: rgba(215, 249, 238, 0.9);
  box-shadow: 0 0 36px rgba(180, 243, 224, 0.42), inset 0 0 26px rgba(215, 249, 238, 0.16);
}

.moria-rune.chosen {
  transform: translate(-50%, -50%) scale(1.12);
}

.moria-rune.wrong {
  color: #6f7a77;
  opacity: 0.45;
  border-color: rgba(105, 121, 119, 0.34);
  box-shadow: none;
}

.moria-progress,
.moria-complete {
  width: min(680px, calc(100vw - 48px));
  margin: 0 auto clamp(14px, 2.5vh, 28px);
  padding: 14px 20px;
  border: 1px solid rgba(180, 218, 213, 0.26);
  background: rgba(4, 12, 17, 0.54);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.34), inset 0 0 28px rgba(186, 231, 221, 0.05);
  backdrop-filter: blur(10px);
  text-align: center;
}

.moria-progress span {
  display: block;
  min-height: 24px;
  color: #d8e9e4;
  font-size: 17px;
}

.moria-inscription {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.4vw, 16px);
  margin: 12px auto 0;
  padding: 8px 10px 10px;
  width: min(460px, 100%);
  background:
    linear-gradient(180deg, rgba(220, 231, 220, 0.1), rgba(16, 21, 22, 0.28)),
    radial-gradient(ellipse at center, rgba(177, 188, 178, 0.16), transparent 70%);
  border: 1px solid rgba(200, 215, 203, 0.18);
  box-shadow: inset 0 8px 24px rgba(0, 0, 0, 0.34), inset 0 -1px 0 rgba(232, 243, 230, 0.08);
}

.moria-inscription b {
  width: clamp(32px, 5vw, 52px);
  height: clamp(34px, 5vw, 54px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  border-bottom: 3px solid rgba(188, 202, 190, 0.22);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(24px, 4.4vw, 44px);
  font-weight: 400;
  line-height: 1;
  text-shadow: none;
  transition: color 0.9s ease, text-shadow 0.9s ease, border-color 0.9s ease, box-shadow 0.9s ease, transform 0.9s ease;
}

.moria-inscription b.carved {
  color: rgba(224, 239, 225, 0.82);
  border-color: rgba(218, 255, 238, 0.86);
  box-shadow: 0 10px 18px -14px rgba(202, 255, 234, 0.86);
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.2),
    0 -1px 0 rgba(0, 0, 0, 0.72),
    0 0 16px rgba(195, 230, 219, 0.22);
  transform: translateY(-1px);
}

.moria-complete {
  color: #eaf7f2;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 1.35s ease, transform 1.35s ease;
}

.moria-complete.visible {
  opacity: 1;
  transform: translateY(0);
}

.moria-complete[hidden] {
  display: none;
}

.moria-complete p:first-child {
  color: #d8fff1;
  font-family: 'Share Tech Mono', monospace;
  text-transform: uppercase;
}

.moria-complete .button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  line-height: 1.2;
  border-color: rgba(216, 255, 241, 0.48);
  color: #f2fff9;
  background: rgba(12, 34, 38, 0.78);
}

.moria-puzzle[data-stage='2'] .moria-door-light,
.moria-puzzle[data-stage='3'] .moria-door-light {
  opacity: 0.18;
}

.moria-puzzle[data-stage='4'] .moria-water,
.moria-puzzle[data-stage='5'] .moria-water {
  opacity: 0.86;
}

.moria-puzzle[data-stage='5'] .moria-door-light,
.moria-puzzle.moria-open .moria-door-light {
  opacity: 0.55;
}

.moria-puzzle.moria-open .moria-bg {
  filter: saturate(0.94) brightness(0.86);
}

.moria-puzzle.moria-open::after {
  background:
    radial-gradient(circle at 50% 42%, rgba(216, 255, 242, 0.32), transparent 26%),
    radial-gradient(ellipse at center, transparent 0 54%, rgba(0, 0, 0, 0.48) 100%);
}

.moria-rejected .moria-stage {
  animation: moriaReject 0.32s ease;
}

@keyframes moriaMist {
  from { transform: translateX(-4%) translateY(1%); }
  to { transform: translateX(5%) translateY(-1%); }
}

@keyframes moriaWater {
  0%, 100% { transform: scaleY(1) translateY(0); opacity: 0.5; }
  50% { transform: scaleY(1.025) translateY(3px); opacity: 0.62; }
}

@keyframes moriaWaterGlow {
  from { transform: translateX(-5%) translateY(0); opacity: 0.34; }
  to { transform: translateX(5%) translateY(3px); opacity: 0.54; }
}

@keyframes moriaWaterBreath {
  0%, 100% { transform: scaleX(1.04) translateY(0); opacity: 0.25; }
  50% { transform: scaleX(1.14) translateY(4px); opacity: 0.42; }
}

@keyframes moriaReject {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(4px); }
}

.home-grid {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 20px;
  align-items: stretch;
}

.hero-panel,
.ranking-panel,
.single-panel {
  position: relative;
  border: 2px solid rgba(255, 178, 56, 0.42);
  background: var(--panel);
  box-shadow:
    0 0 0 5px rgba(0, 0, 0, 0.38),
    0 0 36px rgba(255, 178, 56, 0.14),
    inset 0 0 42px rgba(255, 53, 75, 0.06);
  padding: 28px;
}

.hero-panel::before,
.ranking-panel::before,
.single-panel::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(255, 178, 56, 0.18);
  pointer-events: none;
}

.hero-panel h1,
.single-panel h1,
.blocked-screen h1 {
  margin: 10px 0 16px;
  color: #ffe27a;
  font-family: 'Press Start 2P', system-ui;
  font-size: clamp(34px, 8vw, 92px);
  line-height: 1.08;
  text-shadow:
    3px 0 0 rgba(255, 53, 75, 0.7),
    -3px 0 0 rgba(66, 198, 255, 0.45),
    0 0 18px rgba(255, 178, 56, 0.42);
}

.system-line,
.panel-header,
.terminal-form h2 {
  color: var(--amber);
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(255, 178, 56, 0.35);
}

.intro {
  max-width: 760px;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.55;
}

.flash {
  border-left: 3px solid var(--red);
  padding: 10px 12px;
  color: #ffd0d6;
  background: rgba(255, 50, 77, 0.1);
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 30px;
}

.terminal-form {
  border: 1px solid rgba(255, 178, 56, 0.32);
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255,178,56,0.06), transparent 44%),
    rgba(0,0,0,0.34);
}

label {
  display: block;
  margin: 14px 0 7px;
  color: var(--muted);
}

input,
button,
.button-link {
  width: 100%;
  min-height: 44px;
  border-radius: 0;
  font: inherit;
}

[hidden] {
  display: none !important;
}

input {
  border: 1px solid rgba(255, 178, 56, 0.38);
  background: #070405;
  color: var(--amber);
  padding: 10px 12px;
  outline: none;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(66, 198, 255, 0.16);
}

button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  border: 1px solid var(--amber);
  background: linear-gradient(180deg, rgba(255, 178, 56, 0.18), rgba(255, 53, 75, 0.08));
  color: var(--amber);
  cursor: pointer;
  text-transform: uppercase;
  text-decoration: none;
}

button:hover,
.button-link:hover {
  background: linear-gradient(180deg, rgba(255, 178, 56, 0.28), rgba(255, 53, 75, 0.14));
  color: #fff6d8;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-header a {
  color: var(--blue);
}

.ranking-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px 12px;
  padding: 10px 0;
  border-bottom: 1px dashed rgba(255, 178, 56, 0.2);
}

.ranking-list span {
  color: var(--amber);
}

.ranking-list strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.ranking-list em {
  grid-column: 2;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.network-panel {
  position: relative;
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid rgba(125, 255, 178, 0.34);
  background:
    linear-gradient(180deg, rgba(125,255,178,0.08), transparent 32%),
    repeating-linear-gradient(90deg, rgba(125,255,178,0.045) 0 1px, transparent 1px 21px),
    rgba(2, 8, 6, 0.88);
  box-shadow:
    0 0 0 5px rgba(0, 0, 0, 0.34),
    0 0 34px rgba(125, 255, 178, 0.11),
    inset 0 0 46px rgba(66, 198, 255, 0.05);
  padding: 22px;
}

.network-panel::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(125, 255, 178, 0.16);
  pointer-events: none;
}

.network-panel::after {
  content: 'RX: UNKNOWN // TRACE UNSTABLE // LISTENING';
  position: absolute;
  right: 18px;
  bottom: 8px;
  color: rgba(125, 255, 178, 0.22);
  font-size: 12px;
  pointer-events: none;
}

.network-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(230px, 0.36fr);
  gap: 20px;
  align-items: end;
}

.network-head h2 {
  margin: 6px 0 0;
  color: var(--green);
  font-family: 'Press Start 2P', system-ui;
  font-size: clamp(22px, 3.3vw, 42px);
  line-height: 1.15;
  text-shadow:
    2px 0 0 rgba(255, 53, 75, 0.48),
    -2px 0 0 rgba(66, 198, 255, 0.35),
    0 0 16px rgba(125, 255, 178, 0.28);
}

.anomaly-counter {
  border-left: 2px solid rgba(125, 255, 178, 0.36);
  padding-left: 18px;
  text-align: right;
}

.anomaly-counter span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  text-transform: uppercase;
}

.anomaly-counter strong {
  display: block;
  color: #fff6d8;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1;
  text-shadow: 0 0 18px rgba(125, 255, 178, 0.42);
}

.network-scanline {
  position: relative;
  z-index: 1;
  height: 26px;
  margin: 16px 0 10px;
  background:
    linear-gradient(90deg, transparent, rgba(125,255,178,0.55), transparent),
    repeating-linear-gradient(90deg, rgba(125,255,178,0.14) 0 16px, transparent 16px 33px);
  opacity: 0.54;
  animation: networkPulse 2.8s infinite steps(8, end);
}

.sector-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.sector-node {
  min-width: 0;
  border: 1px solid rgba(125, 255, 178, 0.22);
  background:
    linear-gradient(135deg, rgba(125,255,178,0.08), rgba(255,53,75,0.035)),
    rgba(0,0,0,0.36);
  padding: 14px;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.42);
}

.sector-node:nth-child(2n) {
  border-color: rgba(66, 198, 255, 0.25);
}

.sector-node:nth-child(3n) {
  border-color: rgba(255, 178, 56, 0.26);
}

.sector-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  padding-bottom: 9px;
  border-bottom: 1px dashed rgba(125, 255, 178, 0.18);
}

.sector-title span {
  color: var(--green);
  font-size: 19px;
  text-shadow: 0 0 11px rgba(125, 255, 178, 0.34);
}

.sector-title em {
  color: rgba(255, 178, 56, 0.76);
  font-style: normal;
  font-size: 12px;
  text-align: right;
}

.sector-node dl {
  margin: 12px 0 0;
}

.sector-node dl div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 7px 0;
}

.sector-node dt {
  color: var(--muted);
}

.sector-node dd {
  margin: 0;
  color: #fff6d8;
  text-align: right;
  text-shadow: 0 0 9px rgba(255, 178, 56, 0.2);
}

.empty-sector p {
  margin: 12px 0 0;
  color: var(--muted);
}

.single-panel {
  width: min(760px, 100%);
  margin: auto;
}

.continue-code {
  margin: 22px 0;
  padding: 18px;
  border: 1px dashed var(--amber);
  color: var(--amber);
  font-size: clamp(24px, 6vw, 42px);
  text-align: center;
}

.continue-code-field {
  display: block;
  width: min(560px, 100%);
  min-height: auto;
  margin: 22px auto 12px;
  padding: 18px;
  border: 1px dashed var(--amber);
  background: rgba(0,0,0,0.62);
  color: var(--amber);
  font-size: clamp(24px, 6vw, 42px);
  text-align: center;
  user-select: text;
  -webkit-user-select: text;
}

.copy-help {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.blocked-screen {
  position: relative;
  overflow: hidden;
  width: min(720px, 100%);
  min-height: min(720px, calc(100vh - 48px));
  margin: auto;
  text-align: center;
  border: 1px solid rgba(255, 50, 77, 0.42);
  background: rgba(7, 4, 5, 0.9);
  padding: clamp(18px, 5vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  box-shadow: 0 0 40px rgba(255, 50, 77, 0.16);
}

.blocked-screen > *:not(.blocker-atmosphere) {
  position: relative;
  z-index: 1;
}

.blocked-screen h1 {
  max-width: 100%;
  font-size: clamp(22px, 7vw, 54px);
  line-height: 1.18;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

.blocker-message {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text);
  font-size: clamp(16px, 4.4vw, 22px);
  line-height: 1.45;
  overflow-wrap: normal;
  text-wrap: pretty;
}

.blocker-atmosphere,
.blocker-atmosphere span {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.blocker-visual {
  position: relative;
  flex: 0 0 auto;
  width: min(300px, 78vw);
  height: min(260px, 40vh);
  min-height: 185px;
  margin: 0 auto clamp(14px, 4vw, 24px);
}

.blocker-theme-wizard {
  animation: wizardRumble 2.8s infinite;
  background:
    radial-gradient(circle at 50% 100%, rgba(255, 92, 0, 0.32), transparent 36%),
    radial-gradient(circle at 20% 20%, rgba(205, 214, 202, 0.12), transparent 34%),
    rgba(7, 4, 5, 0.92);
}

.blocker-theme-wizard .blocker-atmosphere span:nth-child(1),
.blocker-theme-wizard .blocker-atmosphere span:nth-child(2) {
  width: 170px;
  height: 170px;
  inset: auto auto 10px 6%;
  border-radius: 50%;
  background: rgba(178, 184, 172, 0.13);
  filter: blur(16px);
  animation: smokeDrift 7s infinite linear;
}

.blocker-theme-wizard .blocker-atmosphere span:nth-child(2) {
  left: auto;
  right: 5%;
  bottom: 4px;
  animation-delay: -3s;
}

.blocker-theme-wizard .blocker-atmosphere span:nth-child(3),
.blocker-theme-wizard .blocker-atmosphere span:nth-child(4) {
  inset: auto 18% -30px;
  height: 120px;
  background: radial-gradient(ellipse at center, rgba(255,178,56,0.48), rgba(255,53,75,0.26) 38%, transparent 70%);
  filter: blur(8px);
  animation: firePulse 1.2s infinite alternate;
}

.blocker-theme-wizard .blocker-atmosphere span:nth-child(4) {
  animation-delay: -0.55s;
  transform: scaleX(0.72);
}

.blocker-visual.wizard .one {
  position: absolute;
  left: 50%;
  top: 0;
  width: 112px;
  height: 132px;
  margin-left: -56px;
  background: linear-gradient(160deg, #d6d8d0, #58615e 72%);
  clip-path: polygon(50% 0, 70% 66%, 100% 82%, 54% 100%, 0 82%, 30% 66%);
  filter: drop-shadow(0 0 10px rgba(255, 226, 122, 0.24));
}

.blocker-visual.wizard .two {
  position: absolute;
  left: 50%;
  top: 82px;
  width: 150px;
  height: 128px;
  margin-left: -75px;
  border-radius: 48% 48% 35% 35%;
  background:
    linear-gradient(#d6ccbd 0 28%, transparent 29%),
    linear-gradient(90deg, transparent 0 18%, #f2f1e7 19% 81%, transparent 82%),
    linear-gradient(#f2f1e7, #cfd4ce);
  box-shadow:
    inset 0 -28px 0 rgba(180, 185, 178, 0.86),
    0 0 18px rgba(255,255,255,0.12);
}

.blocker-visual.wizard .two::before,
.blocker-visual.wizard .two::after {
  content: '';
  position: absolute;
  top: 34px;
  width: 10px;
  height: 10px;
  background: #111;
  box-shadow: 0 0 7px rgba(255, 178, 56, 0.7);
}

.blocker-visual.wizard .two::before { left: 28px; }
.blocker-visual.wizard .two::after { right: 28px; }

.blocker-visual.wizard .three {
  position: absolute;
  right: 10%;
  top: 0;
  width: 8px;
  height: 198px;
  background: var(--amber);
  box-shadow: 0 0 14px rgba(255, 191, 84, 0.75);
}

.blocker-visual.wizard .three::before {
  content: '';
  position: absolute;
  left: -11px;
  top: -15px;
  width: 30px;
  height: 30px;
  border: 3px solid var(--amber);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(255, 191, 84, 0.85);
}

.blocker-visual.hal {
  width: min(250px, 64vw);
  height: min(250px, 64vw);
  min-height: 190px;
  max-height: 250px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fffbf4 0 4%, #ff354b 5% 18%, #7e0612 19% 31%, #090608 32% 44%, #bbb8aa 45% 49%, #1c1c20 50% 100%);
  border: 10px solid #c8c2af;
  box-shadow:
    inset 0 0 34px rgba(0,0,0,0.95),
    0 0 36px rgba(255,53,75,0.46);
  animation: halBlink 4.8s infinite;
}

.blocker-visual.hal::before {
  content: 'HAL 9000';
  position: absolute;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  color: #e9e2cc;
  font-size: 14px;
  letter-spacing: 0;
}

.blocker-theme-hal {
  background:
    radial-gradient(circle at 50% 38%, rgba(255,53,75,0.18), transparent 38%),
    radial-gradient(circle at 50% 90%, rgba(66,198,255,0.12), transparent 32%),
    rgba(2, 3, 7, 0.95);
}

.blocker-theme-hal .blocker-atmosphere {
  background:
    radial-gradient(circle at 18% 25%, rgba(255,255,255,0.16) 0 1px, transparent 2px),
    radial-gradient(circle at 72% 18%, rgba(255,255,255,0.14) 0 1px, transparent 2px),
    radial-gradient(circle at 82% 72%, rgba(255,255,255,0.12) 0 1px, transparent 2px),
    radial-gradient(circle at 36% 78%, rgba(255,255,255,0.12) 0 1px, transparent 2px);
  opacity: 0.8;
  animation: spaceDrift 9s infinite alternate;
}

.blocker-theme-hal .blocker-message {
  animation: textPulse 3.8s infinite;
}

.blocker-visual.hal .one,
.blocker-visual.hal .two,
.blocker-visual.hal .three {
  position: absolute;
  left: 50%;
  width: 150px;
  height: 1px;
  background: rgba(255,255,255,0.16);
  transform: translateX(-50%);
}

.blocker-visual.hal .one { top: 82px; }
.blocker-visual.hal .two { top: 110px; }
.blocker-visual.hal .three { top: 138px; }

.blocker-visual.agent {
  width: min(270px, 72vw);
  height: min(245px, 39vh);
  min-height: 190px;
  animation: agentGlitch 1.8s infinite steps(2, end);
}

.blocker-visual.agent .one {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 102px;
  height: 92px;
  margin-left: -51px;
  border-radius: 45% 45% 38% 38%;
  background: linear-gradient(#e0c7aa, #b58a66);
  box-shadow: inset 0 -18px 0 rgba(66,39,28,0.18);
}

.blocker-visual.agent .one::before {
  content: '';
  position: absolute;
  left: 20px;
  right: 20px;
  top: 38px;
  height: 18px;
  background: linear-gradient(180deg, #101114, #020203);
  border: 2px solid #242a2c;
  box-shadow: 0 0 12px rgba(66,198,255,0.22);
}

.blocker-visual.agent .two {
  position: absolute;
  left: 50%;
  top: 104px;
  width: 138px;
  height: 102px;
  margin-left: -69px;
  background: linear-gradient(180deg, #151718, #050506);
  clip-path: polygon(18% 0, 82% 0, 100% 100%, 0 100%);
  box-shadow: inset 0 0 0 2px #2d3334;
}

.blocker-visual.agent .two::before {
  content: '';
  position: absolute;
  left: 61px;
  top: 0;
  width: 16px;
  height: 100%;
  background: linear-gradient(180deg, #f3f0db, #aaa082);
}

.blocker-visual.agent .three {
  position: absolute;
  left: 50%;
  top: 98px;
  width: 70px;
  height: 26px;
  margin-left: -35px;
  background: #0c0d0f;
  clip-path: polygon(0 0, 100% 0, 76% 100%, 24% 100%);
}

.blocker-theme-agent {
  border-color: rgba(125, 255, 178, 0.42);
  background:
    repeating-linear-gradient(90deg, rgba(125,255,178,0.08) 0 1px, transparent 1px 17px),
    repeating-linear-gradient(0deg, rgba(125,255,178,0.06) 0 1px, transparent 1px 15px),
    rgba(1, 6, 3, 0.95);
  box-shadow: 0 0 40px rgba(125,255,178,0.13), inset 0 0 38px rgba(0,0,0,0.8);
}

.blocker-theme-agent::before,
.blocker-theme-agent::after {
  content: '';
  position: absolute;
  left: -10%;
  right: -10%;
  height: 16px;
  background: rgba(255,255,255,0.14);
  mix-blend-mode: screen;
  animation: corruptSweep 2.1s infinite;
}

.blocker-theme-agent::after {
  animation-delay: -0.8s;
  height: 9px;
  background: rgba(255,53,75,0.16);
}

.blocker-theme-agent .blocker-atmosphere {
  background:
    repeating-linear-gradient(180deg, rgba(125,255,178,0.26) 0 12px, transparent 12px 22px),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(125,255,178,0.12) 18px 20px);
  opacity: 0.24;
  animation: matrixRain 0.7s infinite linear;
}

.blocker-theme-agent .blocked-screen h1,
.blocker-theme-agent h1 {
  color: var(--green);
}

@keyframes wizardRumble {
  0%, 100% { transform: translate(0, 0); }
  47% { transform: translate(0, 0); }
  50% { transform: translate(1px, -1px); }
  53% { transform: translate(-1px, 1px); }
}

@keyframes smokeDrift {
  0% { transform: translateY(70px) scale(0.7); opacity: 0; }
  25% { opacity: 0.8; }
  100% { transform: translateY(-190px) scale(1.6); opacity: 0; }
}

@keyframes firePulse {
  from { opacity: 0.42; transform: scaleY(0.85); }
  to { opacity: 0.86; transform: scaleY(1.2); }
}

@keyframes halBlink {
  0%, 86%, 100% { filter: brightness(1); }
  90% { filter: brightness(0.42); }
  94% { filter: brightness(1.4); }
}

@keyframes spaceDrift {
  from { transform: translateX(-8px) translateY(3px); }
  to { transform: translateX(10px) translateY(-5px); }
}

@keyframes textPulse {
  0%, 100% { opacity: 0.78; }
  50% { opacity: 1; }
}

@keyframes agentGlitch {
  0%, 92%, 100% { transform: translate(0, 0) skewX(0); }
  94% { transform: translate(-4px, 1px) skewX(4deg); }
  96% { transform: translate(3px, -1px) skewX(-3deg); }
}

@keyframes corruptSweep {
  0% { top: -20%; opacity: 0; }
  18% { opacity: 0.75; }
  100% { top: 120%; opacity: 0; }
}

@keyframes matrixRain {
  from { background-position: 0 0, 0 0; }
  to { background-position: 0 22px, 20px 0; }
}

@keyframes networkPulse {
  0%, 100% { transform: translateX(-3px); opacity: 0.34; }
  42% { transform: translateX(4px); opacity: 0.72; }
  48% { transform: translateX(-1px); opacity: 0.2; }
  55% { transform: translateX(2px); opacity: 0.62; }
}

@media (max-width: 860px) {
  .site-shell {
    align-items: stretch;
    padding: 12px 0;
    width: min(100vw - 18px, 1180px);
  }

  .home-grid,
  .action-grid {
    grid-template-columns: 1fr;
  }

  .network-head,
  .sector-grid {
    grid-template-columns: 1fr;
  }

  .anomaly-counter {
    border-left: 0;
    border-top: 1px solid rgba(125, 255, 178, 0.28);
    padding: 12px 0 0;
    text-align: left;
  }

  .network-panel {
    padding: 16px;
  }

  .blocked-screen {
    min-height: calc(100dvh - 18px);
    padding: 10px 10px;
  }

  .blocked-screen h1 {
    font-size: clamp(19px, 6.4vw, 30px);
    margin: 6px 0 8px;
  }

  .system-line {
    font-size: 12px;
    margin: 0 0 4px;
  }

  .blocker-message {
    font-size: clamp(14px, 3.85vw, 17px);
    max-width: 30ch;
    line-height: 1.32;
  }

  .blocker-visual {
    width: min(220px, 66vw);
    height: min(195px, 32dvh);
    min-height: 145px;
    margin-bottom: 8px;
  }

  .blocker-visual.hal {
    width: min(188px, 54vw);
    height: min(188px, 54vw);
    min-height: 148px;
  }

  .blocker-visual.wizard .one {
    width: 94px;
    height: 112px;
    margin-left: -47px;
  }

  .blocker-visual.wizard .two {
    top: 72px;
    width: 126px;
    height: 104px;
    margin-left: -63px;
  }

  .blocker-visual.wizard .three {
    height: 165px;
  }

  .blocker-visual.agent .one {
    top: 6px;
    width: 88px;
    height: 78px;
    margin-left: -44px;
  }

  .blocker-visual.agent .two {
    top: 84px;
    width: 118px;
    height: 88px;
    margin-left: -59px;
  }

  .blocker-visual.agent .three {
    top: 80px;
  }
}

@media (max-height: 700px) and (max-width: 860px) {
  .blocker-visual {
    width: min(190px, 58vw);
    height: min(166px, 28dvh);
    min-height: 128px;
  }

  .blocker-visual.hal {
    width: min(160px, 48vw);
    height: min(160px, 48vw);
    min-height: 132px;
  }

  .blocked-screen h1 {
    font-size: clamp(18px, 5.9vw, 27px);
  }

  .blocker-message {
    font-size: clamp(13px, 3.65vw, 16px);
  }
}

.intro-puzzle,
.intro-complete {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 88px);
  overflow: hidden;
  border: 1px solid rgba(125, 255, 178, 0.26);
  background:
    radial-gradient(circle at 50% 45%, rgba(28, 94, 54, 0.18), transparent 42%),
    #000;
  box-shadow: inset 0 0 60px rgba(125, 255, 178, 0.08), 0 0 30px rgba(0,0,0,0.9);
}

.intro-noise {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(125,255,178,0.08) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 11px);
  opacity: 0.42;
  pointer-events: none;
  animation: matrixRain 1.4s infinite linear;
}

.intro-terminal {
  position: relative;
  z-index: 1;
  padding: clamp(22px, 5vw, 48px);
  color: #7dffb2;
  font-size: clamp(18px, 3vw, 30px);
  line-height: 1.6;
  text-shadow: 0 0 12px rgba(125,255,178,0.48);
}

.terminal-output p {
  margin: 0 0 12px;
}

.terminal-output.terminal-dim {
  opacity: 0.23;
  transition: opacity 1.8s ease;
}

.terminal-cursor {
  display: inline-block;
  width: 14px;
  height: 28px;
  margin-right: 10px;
  background: #7dffb2;
  box-shadow: 0 0 14px rgba(125,255,178,0.7);
  animation: caretBlink 0.9s step-end infinite;
}

.glitch {
  transform: translateX(2px);
  color: #fff;
  text-shadow: 2px 0 var(--red), -2px 0 var(--blue);
}

.rabbit-zone {
  position: fixed;
  z-index: 60;
  width: 88px;
  height: 54px;
  margin: 0;
  border: 0;
  background: transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.rabbit-zone.is-visible {
  opacity: 0.88;
}

.rabbit-zone.is-fading {
  opacity: 0;
  transition: opacity 0.9s ease, filter 0.9s ease;
  filter: blur(5px);
}

.rabbit-zone.is-armed:not(.is-visible) {
  opacity: 0;
  pointer-events: auto;
}

.white-rabbit {
  position: absolute;
  left: 18px;
  top: 20px;
  width: 32px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.88);
  filter: drop-shadow(0 0 14px rgba(255,255,255,0.95)) drop-shadow(0 0 18px rgba(125,255,178,0.5));
}

.white-rabbit::before {
  content: '';
  position: absolute;
  right: 3px;
  top: -12px;
  width: 7px;
  height: 18px;
  border-radius: 8px 8px 0 0;
  background: rgba(255,255,255,0.86);
  box-shadow: -9px 2px 0 rgba(255,255,255,0.74);
}

.white-rabbit::after {
  content: '';
  position: absolute;
  left: -16px;
  top: 10px;
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(125,255,178,0.5), transparent);
}

.pill-scene {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  padding: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 25%, rgba(125,255,178,0.2), transparent 32%),
    rgba(0, 0, 0, 0.92);
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.9s ease, transform 0.9s ease;
}

.pill-scene.is-visible {
  opacity: 1;
  transform: scale(1);
}

.morpheus-figure {
  position: relative;
  width: 230px;
  height: 250px;
  filter: drop-shadow(0 0 22px rgba(125,255,178,0.22));
}

.morpheus-head {
  position: absolute;
  left: 74px;
  top: 8px;
  width: 82px;
  height: 92px;
  border-radius: 44% 44% 36% 36%;
  background: linear-gradient(#8f6448, #523322);
}

.morpheus-glasses {
  position: absolute;
  left: 63px;
  top: 44px;
  width: 104px;
  height: 24px;
  background: linear-gradient(90deg, #060606 0 42%, transparent 43% 57%, #060606 58% 100%);
  border-radius: 14px;
  box-shadow: 0 0 10px rgba(125,255,178,0.45);
}

.morpheus-coat {
  position: absolute;
  left: 34px;
  top: 100px;
  width: 162px;
  height: 140px;
  background: linear-gradient(180deg, #161719, #050506);
  clip-path: polygon(22% 0, 78% 0, 100% 100%, 0 100%);
}

.morpheus-hand {
  position: absolute;
  top: 150px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #6d4934;
}

.morpheus-hand::after {
  content: '';
  position: absolute;
  inset: 15px;
  border-radius: 50%;
}

.morpheus-hand.left { left: 0; }
.morpheus-hand.right { right: 0; }
.morpheus-hand.left::after { background: #3d7cff; box-shadow: 0 0 16px rgba(61,124,255,0.9); }
.morpheus-hand.right::after { background: #ff354b; box-shadow: 0 0 16px rgba(255,53,75,0.9); }

.pill-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 16px;
  width: min(480px, 100%);
}

.pill-button.blue {
  border-color: #3d7cff;
  color: #9ec1ff;
  background: rgba(61,124,255,0.14);
}

.pill-button.red {
  border-color: var(--red);
  color: #ffb8c0;
  background: rgba(255,53,75,0.16);
}

.relic-puzzle {
  position: relative;
  width: 100%;
  min-height: calc(100vh - 88px);
  overflow: hidden;
  border: 1px solid rgba(255, 178, 56, 0.26);
  background:
    radial-gradient(circle at 50% 42%, rgba(84, 35, 16, 0.28), transparent 34%),
    radial-gradient(circle at 20% 15%, rgba(108, 255, 136, 0.09), transparent 28%),
    linear-gradient(180deg, #070506 0%, #020203 52%, #090704 100%);
  box-shadow: inset 0 0 90px rgba(0,0,0,0.96), inset 0 0 34px rgba(255,178,56,0.08), 0 0 36px rgba(0,0,0,0.9);
  color: #f3c46b;
}

.relic-puzzle::before {
  content: '';
  position: absolute;
  inset: -18px;
  background:
    linear-gradient(rgba(255,255,255,0.035) 50%, rgba(0,0,0,0.14) 50%),
    repeating-linear-gradient(90deg, rgba(255,44,69,0.035) 0 1px, transparent 1px 5px);
  background-size: 100% 4px, 11px 100%;
  opacity: 0.62;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: crtDrift 6s infinite linear;
}

.relic-puzzle::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 42%, rgba(0,0,0,0.74) 100%);
  pointer-events: none;
}

.relic-static,
.relic-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.relic-static {
  background:
    repeating-radial-gradient(circle at 17% 23%, rgba(255,255,255,0.065) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(12deg, rgba(255,178,56,0.05) 0 1px, transparent 1px 13px);
  opacity: 0.22;
  animation: staticPulse 0.36s infinite steps(2);
}

.relic-sparks {
  background:
    radial-gradient(circle at 15% 70%, rgba(255,53,75,0.22), transparent 2px),
    radial-gradient(circle at 82% 22%, rgba(125,255,178,0.18), transparent 2px),
    radial-gradient(circle at 65% 78%, rgba(255,178,56,0.18), transparent 2px);
  opacity: 0.8;
  filter: blur(0.3px);
}

.relic-boot,
.relic-console {
  position: relative;
  z-index: 2;
}

.relic-boot {
  min-height: calc(100vh - 88px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  padding: 28px 28px clamp(190px, 25vh, 260px);
  text-align: center;
  transform: translateY(clamp(-96px, -10vh, -54px));
  transition: opacity 1.1s ease, filter 1.1s ease;
}

.relic-boot.is-dim {
  opacity: 0.14;
  filter: blur(1px);
}

.relic-code,
.relic-whisper,
.relic-status,
.relic-continue-label {
  font-family: 'Share Tech Mono', monospace;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.relic-code {
  color: #81ff9f;
  font-size: clamp(11px, 1.5vw, 15px);
  text-shadow: 0 0 12px rgba(129,255,159,0.32);
}

.relic-boot h1 {
  margin: 0;
  max-width: 14ch;
  color: #ffbe54;
  font-family: 'Press Start 2P', system-ui;
  font-size: clamp(24px, 5.4vw, 70px);
  line-height: 1.15;
  text-shadow: 0 0 18px rgba(255,178,56,0.28), 3px 0 rgba(255,53,75,0.22), -3px 0 rgba(125,255,178,0.14);
}

.relic-whisper,
.relic-status {
  color: rgba(243,196,107,0.76);
  font-size: clamp(13px, 1.7vw, 17px);
}

.relic-controller {
  position: absolute;
  z-index: 6;
  left: 50%;
  top: 50%;
  width: min(640px, 88vw);
  height: 248px;
  transform: translate(-50%, -50%) scale(0.86) skewX(-1deg);
  border: 4px solid rgba(224, 199, 160, 0.44);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(155,32,36,0.86) 0 28%, transparent 28% 72%, rgba(155,32,36,0.86) 72% 100%),
    linear-gradient(180deg, rgba(184,184,176,0.94), rgba(52,52,58,0.96));
  box-shadow: 0 0 76px rgba(255,178,56,0.24), 0 0 22px rgba(125,255,178,0.18), inset 0 0 30px rgba(0,0,0,0.74);
  opacity: 0;
  filter: blur(8px) contrast(1.8);
  pointer-events: none;
  transition: opacity 0.04s steps(1), filter 0.04s steps(1), transform 0.04s steps(1);
}

.relic-controller.is-visible {
  opacity: 0.98;
  filter: blur(0) contrast(1.1);
  transform: translate(-50%, -50%) scale(1) skewX(-1deg);
  animation: padMemory 1.05s steps(3);
}

.relic-controller::before,
.relic-controller::after {
  content: '';
  position: absolute;
  background: rgba(9,9,10,0.96);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.08), 0 0 14px rgba(129,255,159,0.18);
}

.relic-controller::before {
  left: 92px;
  top: 102px;
  width: 132px;
  height: 38px;
}

.relic-controller::after {
  left: 139px;
  top: 55px;
  width: 38px;
  height: 132px;
}

.relic-controller .pad,
.relic-controller .button-a,
.relic-controller .button-b {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #111;
  font-family: 'Press Start 2P', system-ui;
}

.relic-controller .pad {
  width: 36px;
  height: 36px;
  background: #7dffb2;
  border: 2px solid rgba(216,255,225,0.72);
  box-shadow: 0 0 24px rgba(125,255,178,0.88), inset 0 0 12px rgba(255,255,255,0.42);
  color: #04170b;
  font-size: 12px;
  line-height: 1;
}

.relic-controller .pad::after {
  display: block;
  content: '';
  width: 0;
  height: 0;
}

.relic-controller .up { left: 140px; top: 56px; }
.relic-controller .up::after { border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 13px solid #04170b; transform: translateY(-1px); }
.relic-controller .down { left: 140px; top: 150px; }
.relic-controller .down::after { border-left: 8px solid transparent; border-right: 8px solid transparent; border-top: 13px solid #04170b; transform: translateY(1px); }
.relic-controller .left { left: 93px; top: 103px; }
.relic-controller .left::after { border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-right: 13px solid #04170b; transform: translateX(-1px); }
.relic-controller .right { left: 187px; top: 103px; }
.relic-controller .right::after { border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 13px solid #04170b; transform: translateX(1px); }

.relic-controller .button-a,
.relic-controller .button-b {
  right: 92px;
  top: 92px;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #ff354b;
  color: #ffd6da;
  box-shadow: 0 0 28px rgba(255,53,75,0.9), inset 0 0 12px rgba(255,255,255,0.22);
  font-size: 13px;
}

.relic-controller .button-b {
  right: 190px;
  background: #ffbe54;
  color: #2b1603;
  box-shadow: 0 0 28px rgba(255,178,56,0.9), inset 0 0 12px rgba(255,255,255,0.22);
}

.relic-console {
  position: absolute;
  left: 50%;
  bottom: clamp(34px, 8vh, 86px);
  width: min(920px, calc(100% - 34px));
  transform: translateX(-50%);
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid rgba(255,178,56,0.28);
  background: rgba(5, 4, 5, 0.76);
  box-shadow: inset 0 0 34px rgba(255,178,56,0.04), 0 0 28px rgba(0,0,0,0.68);
}

.relic-inputs {
  display: flex;
  gap: 10px;
  min-height: 58px;
  padding: 10px 0;
  overflow: hidden;
}

.relic-token {
  display: inline-grid;
  place-items: center;
  width: 54px;
  min-width: 54px;
  height: 42px;
  padding: 0 12px;
  border: 2px solid rgba(129,255,159,0.48);
  background: linear-gradient(180deg, rgba(129,255,159,0.16), rgba(255,178,56,0.06));
  color: #d7ffd9;
  font-family: 'Press Start 2P', system-ui;
  font-size: 13px;
  text-shadow: 0 0 10px rgba(129,255,159,0.58);
  box-shadow: 0 0 18px rgba(129,255,159,0.1);
  animation: tokenPop 0.14s steps(2);
}

.relic-token-start {
  width: 104px;
  min-width: 104px;
}

.relic-token-up::after,
.relic-token-down::after,
.relic-token-left::after,
.relic-token-right::after {
  content: '';
  width: 0;
  height: 0;
  filter: drop-shadow(0 0 7px rgba(129,255,159,0.9));
}

.relic-token-up::after {
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 15px solid #d7ffd9;
  transform: translateY(-1px);
}

.relic-token-down::after {
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 15px solid #d7ffd9;
  transform: translateY(1px);
}

.relic-token-left::after {
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-right: 15px solid #d7ffd9;
  transform: translateX(-1px);
}

.relic-token-right::after {
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 15px solid #d7ffd9;
  transform: translateX(1px);
}

.relic-result {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px dashed rgba(255,178,56,0.28);
}

.relic-result h2 {
  margin: 10px 0 16px;
  color: #81ff9f;
  font-family: 'Press Start 2P', system-ui;
  font-size: clamp(22px, 4.6vw, 56px);
  line-height: 1.16;
  text-shadow: 0 0 20px rgba(129,255,159,0.48);
}

.relic-continue-label {
  color: #ffbe54;
}

.relic-awake {
  background:
    radial-gradient(circle at 50% 42%, rgba(129,255,159,0.22), transparent 38%),
    radial-gradient(circle at 18% 18%, rgba(255,53,75,0.12), transparent 28%),
    linear-gradient(180deg, #0d1110 0%, #050706 58%, #0b0803 100%);
  box-shadow: inset 0 0 80px rgba(129,255,159,0.12), 0 0 50px rgba(129,255,159,0.08);
}

.relic-awake .relic-static {
  opacity: 0.08;
}

.relic-fail {
  animation: relicFail 0.42s steps(2);
}

@keyframes crtDrift {
  from { transform: translateY(0); }
  to { transform: translateY(14px); }
}

@keyframes staticPulse {
  0%, 100% { opacity: 0.18; transform: translate(0,0); }
  50% { opacity: 0.29; transform: translate(2px,-1px); }
}

@keyframes tokenPop {
  from { transform: translateY(8px) scale(0.94); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes relicFail {
  0% { transform: translateX(0); filter: hue-rotate(0deg); }
  25% { transform: translateX(-12px); filter: hue-rotate(80deg); }
  50% { transform: translateX(9px); filter: hue-rotate(-60deg); }
  100% { transform: translateX(0); filter: hue-rotate(0deg); }
}

@keyframes padMemory {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.74) skewX(2deg); filter: blur(12px) brightness(2.2); }
  12% { opacity: 1; transform: translate(-49%, -51%) scale(1.03) skewX(-2deg); filter: blur(0) brightness(1.9); }
  28% { opacity: 0.38; transform: translate(-51%, -50%) scale(0.98) skewX(1deg); }
  42% { opacity: 0.96; transform: translate(-50%, -50%) scale(1) skewX(-1deg); }
  76% { opacity: 0.78; filter: blur(0.8px) brightness(1.2); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1.08) skewX(-3deg); filter: blur(10px) brightness(2.6); }
}

@media (max-width: 700px) {
  .relic-boot {
    padding-bottom: 210px;
    transform: translateY(-56px);
  }

  .relic-console {
    bottom: 18px;
  }

  .relic-inputs {
    flex-wrap: wrap;
    max-height: 150px;
    overflow: auto;
  }

  .relic-controller {
    height: 180px;
  }
}

.intro-complete {
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: 28px;
}

.intro-complete h1 {
  color: #7dffb2;
  font-family: 'Press Start 2P', system-ui;
  font-size: clamp(28px, 6vw, 64px);
}

.door-pulse {
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(125,255,178,0.36);
  box-shadow: 0 0 50px rgba(125,255,178,0.16), inset 0 0 60px rgba(125,255,178,0.08);
  animation: doorPulse 2s infinite alternate;
  pointer-events: none;
}

.code-label {
  color: var(--amber);
  margin-bottom: 0;
}

.intro.small {
  font-size: 15px;
}

@keyframes doorPulse {
  from { transform: scale(0.96); opacity: 0.5; }
  to { transform: scale(1.04); opacity: 1; }
}

@keyframes caretBlink {
  50% { opacity: 0; }
}

@media (max-width: 720px) {
  .pill-actions {
    grid-template-columns: 1fr;
  }
}

.irc-sector .signal-canvas {
  display: none;
}

.irc-puzzle {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: calc(100vh - 88px);
  border: 1px solid rgba(125, 255, 178, 0.28);
  background:
    linear-gradient(180deg, rgba(125,255,178,0.06), transparent 42%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 4px),
    #050706;
  color: #baf8c8;
  box-shadow: 0 0 44px rgba(125,255,178,0.1), inset 0 0 70px rgba(0,0,0,0.88);
  font-family: 'Share Tech Mono', monospace;
}

.irc-puzzle::before,
.irc-puzzle::after,
.irc-noise {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.irc-puzzle::before {
  background:
    radial-gradient(circle at 28% 16%, rgba(66,198,255,0.08), transparent 34%),
    radial-gradient(circle at 78% 70%, rgba(255,53,75,0.07), transparent 28%);
}

.irc-puzzle::after {
  border: 10px solid rgba(0,0,0,0.38);
  box-shadow: inset 0 0 0 1px rgba(125,255,178,0.12);
}

.irc-noise {
  opacity: 0.16;
  background:
    repeating-linear-gradient(90deg, transparent 0 33px, rgba(125,255,178,0.16) 33px 34px),
    repeating-linear-gradient(180deg, transparent 0 19px, rgba(255,178,56,0.1) 19px 20px);
  animation: ircNoise 1.4s infinite steps(4, end);
}

.irc-titlebar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(125,255,178,0.24);
  background: rgba(1, 17, 8, 0.86);
  color: var(--amber);
  text-transform: uppercase;
}

.irc-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(250px, 0.32fr) minmax(0, 1fr);
  min-height: calc(100vh - 132px);
}

.irc-sidebar {
  border-right: 1px solid rgba(125,255,178,0.2);
  background: rgba(0, 0, 0, 0.32);
  padding: 18px;
}

.irc-label {
  margin: 18px 0 8px;
  color: rgba(255,178,56,0.78);
  font-size: 13px;
  text-transform: uppercase;
}

.irc-sidebar h1 {
  margin: 0;
  color: #d6ffd8;
  font-size: clamp(26px, 4vw, 48px);
  line-height: 1;
  text-shadow: 2px 0 rgba(255,53,75,0.46), -2px 0 rgba(66,198,255,0.34), 0 0 16px rgba(125,255,178,0.28);
}

.irc-capacity {
  margin: 10px 0 18px;
  color: var(--muted);
}

.irc-fragment {
  border: 1px dashed rgba(125,255,178,0.32);
  background: rgba(0,0,0,0.42);
  padding: 14px;
}

.irc-fragment span {
  display: block;
  color: var(--amber);
  font-size: 13px;
}

.irc-fragment strong {
  display: block;
  margin-top: 5px;
  color: #fff6d8;
  font-size: 26px;
  overflow-wrap: anywhere;
}

.irc-fragment small {
  display: block;
  margin-top: 7px;
  color: rgba(183,167,125,0.86);
}

.irc-users,
.irc-channels {
  list-style: none;
  margin: 0;
  padding: 0;
  color: #9eeeb3;
}

.irc-users li,
.irc-channels li {
  padding: 4px 0;
  border-bottom: 1px dotted rgba(125,255,178,0.12);
}

.irc-user-traced {
  color: rgba(255, 122, 122, 0.86);
  text-shadow: 1px 0 rgba(66,198,255,0.28), -1px 0 rgba(255,53,75,0.32);
}

.irc-main {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  min-width: 0;
}

.irc-topic {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(125,255,178,0.18);
  color: rgba(255,178,56,0.86);
  background: rgba(0,0,0,0.2);
}

.irc-log {
  min-height: 420px;
  max-height: calc(100vh - 250px);
  overflow: auto;
  padding: 14px;
  scrollbar-color: rgba(125,255,178,0.45) rgba(0,0,0,0.25);
}

.irc-line {
  display: grid;
  grid-template-columns: 82px minmax(90px, 150px) minmax(0, 1fr);
  gap: 8px;
  margin: 0 0 5px;
  line-height: 1.35;
}

.irc-line span:first-child {
  color: rgba(183,167,125,0.86);
}

.irc-line strong {
  color: var(--blue);
  font-weight: normal;
  overflow-wrap: anywhere;
}

.irc-line-traced strong {
  color: rgba(255, 122, 122, 0.92);
  text-shadow: 1px 0 rgba(255,53,75,0.36), -1px 0 rgba(66,198,255,0.28);
}

.irc-line-traced span:last-child {
  color: rgba(214, 255, 216, 0.88);
}

.irc-line-system strong,
.irc-line-system span:last-child {
  color: var(--amber);
}

.irc-input-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(125,255,178,0.2);
  background: rgba(0,0,0,0.44);
}

.irc-input-row span {
  color: var(--amber);
}

.irc-input-row input {
  min-height: 38px;
  border: 0;
  background: transparent;
  color: #d6ffd8;
  padding: 0;
}

.irc-complete {
  border-top: 1px solid rgba(255,178,56,0.3);
  background: rgba(255,178,56,0.06);
  padding: 14px;
}

.irc-complete p {
  color: var(--amber);
  margin: 0 0 8px;
}

@keyframes ircNoise {
  0%, 100% { transform: translate(0, 0); opacity: 0.12; }
  35% { transform: translate(2px, -1px); opacity: 0.19; }
  70% { transform: translate(-1px, 1px); opacity: 0.14; }
}

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

  .irc-sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(125,255,178,0.2);
  }

  .irc-log {
    min-height: 360px;
  }

  .irc-line {
    grid-template-columns: 70px minmax(70px, 110px) minmax(0, 1fr);
    font-size: 14px;
  }
}

body.sector-trace {
  background:
    radial-gradient(circle at 24% 18%, rgba(104, 18, 10, 0.32), transparent 28%),
    linear-gradient(135deg, #020303 0%, #111313 42%, #050505 100%);
  color: #f0d29a;
}

body.sector-trace .site-shell {
  width: 100%;
  min-height: 100svh;
  padding: 0;
  display: block;
}

body.sector-trace .signal-canvas {
  display: none;
}

.trace-puzzle {
  --trace-level: 46;
  position: relative;
  height: 100svh;
  overflow: hidden;
  padding: clamp(16px, 2vw, 28px);
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: "Courier New", monospace;
  background:
    linear-gradient(rgba(255, 72, 31, 0.04) 1px, transparent 1px) 0 0 / 100% 4px,
    radial-gradient(circle at 78% 24%, rgba(255, 37, 18, 0.12), transparent 28%),
    radial-gradient(circle at 18% 76%, rgba(204, 128, 42, 0.12), transparent 34%),
    #050606;
}

.trace-puzzle::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
  background:
    repeating-linear-gradient(to bottom, rgba(255,255,255,0.045) 0 1px, transparent 1px 4px),
    linear-gradient(90deg, rgba(255,0,0,0.08), transparent 22%, rgba(255,180,78,0.04) 55%, transparent);
  mix-blend-mode: screen;
  opacity: 0.42;
}

.trace-puzzle::after {
  content: "";
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: 7;
  background: radial-gradient(circle, transparent 48%, rgba(0,0,0,0.62) 100%);
}

.trace-noise,
.trace-grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.trace-noise {
  z-index: 1;
  opacity: 0.18;
  background-image:
    linear-gradient(37deg, rgba(255,255,255,0.11) 1px, transparent 1px),
    linear-gradient(123deg, rgba(255,60,20,0.08) 1px, transparent 1px);
  background-size: 17px 19px, 29px 31px;
  animation: traceNoise 0.8s steps(2) infinite;
}

.trace-grid {
  z-index: 0;
  opacity: 0.35;
  background:
    linear-gradient(rgba(204, 134, 66, 0.12) 1px, transparent 1px) 0 0 / 64px 64px,
    linear-gradient(90deg, rgba(204, 134, 66, 0.1) 1px, transparent 1px) 0 0 / 64px 64px;
}

.trace-header,
.trace-layout,
.trace-outcome {
  position: relative;
  z-index: 3;
}

.trace-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  border-bottom: 1px solid rgba(255, 68, 36, 0.28);
  padding-bottom: 12px;
}

.trace-header p,
.trace-feed-head,
.trace-telemetry span,
.trace-level-head span {
  margin: 0;
  color: rgba(252, 176, 86, 0.78);
  font-size: 12px;
  letter-spacing: 0;
}

.trace-header h1 {
  margin: 4px 0 0;
  color: #ff4d33;
  font-size: clamp(24px, 4vw, 54px);
  line-height: 0.95;
  text-shadow: 0 0 18px rgba(255, 31, 16, 0.42);
}

.trace-status {
  max-width: 340px;
  color: #f2c16e;
  text-align: right;
  font-size: 13px;
}

.trace-layout {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(320px, 1.35fr) minmax(240px, 0.7fr);
  grid-template-rows: minmax(0, 1fr) minmax(150px, 0.58fr);
  gap: 14px;
  margin-top: 0;
}

.trace-panel {
  min-height: 0;
  border: 1px solid rgba(255, 76, 41, 0.24);
  background: rgba(4, 7, 7, 0.72);
  box-shadow: inset 0 0 34px rgba(255, 47, 20, 0.08), 0 0 18px rgba(0,0,0,0.48);
}

.trace-main {
  position: relative;
  overflow: hidden;
  grid-row: span 2;
  padding: clamp(12px, 1.5vw, 18px);
}

.trace-level-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 14px;
}

.trace-level-head span {
  color: rgba(255, 208, 138, 0.96);
  font-size: 13px;
  font-weight: bold;
  text-shadow: 0 0 10px rgba(255, 96, 44, 0.42);
}

.trace-level-head strong {
  color: #ff3f2c;
  font-size: clamp(34px, 6vw, 82px);
  line-height: 0.9;
  text-shadow: 0 0 20px rgba(255, 36, 20, 0.52);
}

.trace-bar {
  height: 22px;
  margin: 12px 0 16px;
  border: 1px solid rgba(255, 180, 92, 0.3);
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 3px, transparent 3px 11px),
    rgba(0,0,0,0.58);
}

.trace-bar i {
  display: block;
  width: 46%;
  height: 100%;
  background: linear-gradient(90deg, #bb741f, #ff4d24 72%, #fff0b8);
  box-shadow: 0 0 18px rgba(255, 62, 30, 0.55);
  transition: width 0.18s linear;
}

.trace-scope {
  position: absolute;
  inset: 98px clamp(12px, 1.5vw, 18px) clamp(12px, 1.5vw, 18px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 18%, rgba(255, 73, 36, 0.08) 18.2% 18.7%, transparent 19% 34%, rgba(255, 73, 36, 0.08) 34.3% 34.8%, transparent 35% 51%, rgba(255, 73, 36, 0.08) 51.2% 51.7%, transparent 52%),
    linear-gradient(rgba(255, 88, 36, 0.1) 1px, transparent 1px) 0 0 / 38px 38px,
    linear-gradient(90deg, rgba(255, 88, 36, 0.08) 1px, transparent 1px) 0 0 / 38px 38px;
}

.trace-arming-message {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  width: min(520px, 82%);
  padding: 14px 18px;
  border: 1px solid rgba(255, 82, 39, 0.46);
  background: rgba(8, 5, 4, 0.64);
  color: #ffd08a;
  font-size: clamp(20px, 4vw, 50px);
  line-height: 1;
  text-align: center;
  text-shadow: 0 0 16px rgba(255, 66, 31, 0.62);
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: traceArmingText 0.9s steps(2) infinite;
}

.trace-radar {
  position: absolute;
  right: 8%;
  top: 15%;
  width: min(34vw, 420px);
  aspect-ratio: 1;
  border: 1px solid rgba(255, 67, 34, 0.22);
  border-radius: 50%;
  opacity: 0.28;
  z-index: 2;
}

.trace-radar span {
  position: absolute;
  inset: 50% 50% 0 50%;
  width: 50%;
  height: 1px;
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(255, 60, 25, 0.84), transparent);
  animation: traceRadar 6.8s linear infinite;
}

.trace-reticle,
.trace-scan {
  position: absolute;
  display: block;
}

.trace-reticle {
  width: 76px;
  height: 76px;
  border: 1px solid rgba(255, 69, 34, 0.52);
  box-shadow: 0 0 16px rgba(255, 56, 25, 0.25);
}

.trace-reticle::before,
.trace-reticle::after {
  content: "";
  position: absolute;
  background: rgba(255, 86, 39, 0.7);
}

.trace-reticle::before {
  left: 50%;
  top: -12px;
  width: 1px;
  height: 100px;
}

.trace-reticle::after {
  top: 50%;
  left: -12px;
  width: 100px;
  height: 1px;
}

.trace-reticle-a { left: 18%; top: 28%; animation: traceDriftA 8s infinite alternate; }
.trace-reticle-b { left: 62%; top: 18%; animation: traceDriftB 7s infinite alternate; }
.trace-reticle-c { left: 44%; top: 66%; animation: traceDriftC 9s infinite alternate; }

.trace-scan {
  left: -8%;
  right: -8%;
  height: 1px;
  background: rgba(255, 191, 106, 0.58);
  box-shadow: 0 0 18px rgba(255, 90, 42, 0.5);
}

.trace-scan-a { top: 35%; animation: traceScan 3.2s linear infinite; }
.trace-scan-b { top: 68%; animation: traceScan 4.7s linear infinite reverse; }

.trace-telemetry {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  padding: 0;
}

.trace-telemetry div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(8px, 1.2vh, 12px) 14px;
  border-bottom: 1px solid rgba(255, 86, 42, 0.14);
}

.trace-telemetry b {
  color: #ffd08a;
  font-weight: normal;
  text-align: right;
}

.trace-feed {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.trace-feed-head {
  display: flex;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 86, 42, 0.16);
}

.trace-log {
  flex: 1;
  overflow: hidden;
  padding: 10px 14px;
  color: rgba(244, 198, 126, 0.86);
  font-size: clamp(11px, 1.35vh, 13px);
  line-height: 1.32;
}

.trace-log p {
  margin: 0 0 5px;
}

.trace-log span {
  color: #ff4b30;
}

.trace-outcome {
  position: fixed;
  inset: 0;
  z-index: 9;
  display: grid;
  place-content: center;
  gap: 14px;
  text-align: center;
  padding: 24px;
  background: rgba(0,0,0,0.78);
}

.trace-outcome h2 {
  margin: 0;
  color: #ff3d27;
  font-size: clamp(42px, 9vw, 120px);
  text-shadow: 0 0 24px rgba(255, 36, 16, 0.7);
}

.trace-outcome p {
  margin: 0;
  color: #ffd08a;
}

.trace-outcome .continue-code-field {
  justify-self: center;
  width: min(520px, 86vw);
  text-align: center;
}

.trace-flag-note {
  justify-self: center;
  width: fit-content;
  max-width: 86vw;
  padding: 6px 12px;
  border: 1px solid rgba(255, 67, 38, 0.44);
  background: rgba(38, 3, 3, 0.74);
  color: #ff8d78 !important;
  font-size: 12px;
  text-shadow: 0 0 9px rgba(255, 54, 31, 0.45);
}

.trace-code-flagged {
  color: #ff7058;
  border-color: rgba(255, 67, 38, 0.58);
  background:
    repeating-linear-gradient(90deg, rgba(255, 65, 38, 0.12) 0 2px, transparent 2px 9px),
    rgba(23, 3, 3, 0.82);
  box-shadow: inset 0 0 18px rgba(255, 42, 24, 0.18), 0 0 14px rgba(255, 35, 18, 0.18);
  animation: traceCodeFlagged 1.8s steps(2) infinite;
}

.trace-danger .trace-level-head strong,
.trace-critical .trace-level-head strong {
  animation: traceShake 0.18s infinite;
}

.trace-glitching,
.trace-critical,
.trace-arming-pulse {
  animation: traceFrameGlitch 0.28s steps(2) infinite;
}

.trace-arming .trace-reticle {
  animation-play-state: paused;
}

.trace-masked .trace-scope {
  filter: blur(2px) contrast(1.4);
}

.trace-captured {
  background: #2a0202;
}

.trace-lost .trace-panel,
.trace-lost .trace-header {
  opacity: 0.22;
  filter: grayscale(0.8);
}

@keyframes traceNoise {
  0%, 100% { transform: translate(0,0); }
  50% { transform: translate(3px,-2px); }
}

@keyframes traceRadar {
  to { transform: rotate(360deg); }
}

@keyframes traceScan {
  0% { transform: translateY(-80px); opacity: 0; }
  15%, 82% { opacity: 1; }
  100% { transform: translateY(170px); opacity: 0; }
}

@keyframes traceDriftA {
  to { transform: translate(18px, -12px); }
}

@keyframes traceDriftB {
  to { transform: translate(-14px, 20px); }
}

@keyframes traceDriftC {
  to { transform: translate(24px, 10px); }
}

@keyframes traceShake {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(2px, -1px); }
}

@keyframes traceFrameGlitch {
  0%, 100% { filter: hue-rotate(0deg); transform: translate(0,0); }
  50% { filter: hue-rotate(-12deg) contrast(1.18); transform: translate(1px,0); }
}

@keyframes traceArmingText {
  0%, 100% { opacity: 0.84; }
  50% { opacity: 1; text-shadow: -1px 0 rgba(255, 196, 120, 0.54), 1px 0 rgba(255, 30, 18, 0.72); }
}

@keyframes traceCodeFlagged {
  0%, 100% { text-shadow: 0 0 8px rgba(255, 54, 31, 0.45); }
  50% { text-shadow: -1px 0 rgba(255, 196, 120, 0.45), 1px 0 rgba(255, 30, 18, 0.65); }
}

@media (max-width: 920px) {
  .trace-puzzle {
    min-height: 100svh;
    padding: 12px;
  }

  .trace-header {
    display: block;
  }

  .trace-status {
    margin-top: 10px;
    text-align: left;
  }

  .trace-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .trace-main {
    min-height: 430px;
    grid-row: auto;
  }

  .trace-scope {
    inset: 106px 14px 14px;
  }
}

.treasure-puzzle {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 73% 17%, rgba(255, 210, 126, 0.22), transparent 18%),
    radial-gradient(circle at 18% 82%, rgba(41, 23, 12, 0.5), transparent 32%),
    linear-gradient(135deg, #3b1f0f 0%, #1b0d07 54%, #070403 100%);
}

.treasure-table {
  position: relative;
  min-height: 100vh;
  padding: clamp(14px, 2vw, 32px);
  background:
    linear-gradient(90deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 12%),
    repeating-linear-gradient(92deg, rgba(84, 43, 21, 0.82) 0 74px, rgba(42, 20, 10, 0.86) 74px 80px),
    #271309;
  box-shadow: inset 0 0 140px rgba(0, 0, 0, 0.7);
}

.treasure-table::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 62% 42%, transparent 0 44%, rgba(0, 0, 0, 0.5) 100%),
    radial-gradient(circle at 81% 19%, rgba(255, 198, 98, 0.28), transparent 18%);
  animation: treasureShadow 13s ease-in-out infinite alternate;
}

.treasure-dust {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  overflow: hidden;
}

.treasure-dust i {
  position: absolute;
  left: var(--x);
  top: -8px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 226, 166, 0.48);
  filter: blur(0.5px);
  animation: treasureDust var(--dur) linear var(--delay) infinite;
}

.treasure-map {
  position: relative;
  z-index: 2;
  min-height: calc(100vh - clamp(28px, 4vw, 64px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  gap: clamp(14px, 2vw, 28px);
  align-items: stretch;
}

.treasure-heading {
  position: absolute;
  left: clamp(18px, 3vw, 42px);
  top: clamp(18px, 3vw, 36px);
  z-index: 4;
  max-width: min(520px, 48vw);
  color: #452614;
  text-shadow: 0 1px 0 rgba(255, 234, 177, 0.42);
}

.treasure-heading p,
.panel-kicker {
  margin: 0 0 8px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #7f2e18;
  text-transform: uppercase;
}

.treasure-heading h1 {
  margin: 0 0 8px;
  font-size: clamp(34px, 5.4vw, 72px);
  font-weight: 500;
  line-height: 0.95;
  color: #442713;
}

.treasure-heading span {
  display: block;
  max-width: 440px;
  color: #70411f;
  font-size: clamp(15px, 1.5vw, 19px);
}

.map-paper {
  position: relative;
  min-height: min(760px, calc(100vh - 64px));
  margin: clamp(12px, 2vw, 24px) 0 clamp(12px, 2vw, 24px) clamp(8px, 2vw, 22px);
  overflow: hidden;
  border-radius: 3px 11px 4px 8px;
  background:
    radial-gradient(circle at 22% 28%, rgba(92, 50, 22, 0.15), transparent 11%),
    radial-gradient(circle at 71% 66%, rgba(54, 73, 50, 0.18), transparent 15%),
    radial-gradient(circle at 55% 46%, rgba(120, 27, 18, 0.12), transparent 8%),
    linear-gradient(145deg, #d8b06b 0%, #f1d48e 42%, #c98f4d 100%);
  box-shadow:
    0 26px 60px rgba(0, 0, 0, 0.54),
    inset 0 0 42px rgba(94, 42, 18, 0.36);
  transform: rotate(-1.4deg);
  transition: transform 0.5s ease, filter 0.5s ease;
}

.map-paper.is-shaking {
  animation: mapShake 0.34s ease;
}

.treasure-puzzle.is-transitioning .map-paper {
  transform: scale(1.14) rotate(0deg);
  filter: sepia(0.24) brightness(1.08);
}

.treasure-puzzle.is-transitioning::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  background: rgba(255, 182, 91, 0.18);
  animation: warmFade 1.3s ease forwards;
}

.burn-edge,
.map-fold,
.map-route,
.map-coast,
.map-symbol,
.map-corner {
  position: absolute;
  pointer-events: none;
}

.burn-edge-a {
  inset: -16px auto auto -12px;
  width: 48%;
  height: 54px;
  background: radial-gradient(ellipse at center, rgba(42, 18, 8, 0.86), transparent 64%);
  transform: rotate(-3deg);
}

.burn-edge-b {
  right: -22px;
  bottom: 16%;
  width: 58px;
  height: 44%;
  background: radial-gradient(ellipse at center, rgba(34, 13, 6, 0.82), transparent 63%);
}

.map-fold-x {
  left: 0;
  right: 0;
  top: 49%;
  height: 2px;
  background: rgba(105, 61, 28, 0.2);
  box-shadow: 0 10px 18px rgba(75, 35, 16, 0.12);
}

.map-fold-y {
  top: 0;
  bottom: 0;
  left: 52%;
  width: 2px;
  background: rgba(105, 61, 28, 0.18);
}

.map-route {
  left: 20%;
  top: 37%;
  width: 58%;
  height: 38%;
  border-top: 4px dashed rgba(128, 23, 19, 0.58);
  border-right: 3px dashed rgba(128, 23, 19, 0.48);
  border-radius: 50%;
  transform: rotate(17deg);
}

.map-coast {
  left: 8%;
  bottom: 8%;
  width: 78%;
  height: 30%;
  border: 2px solid rgba(68, 73, 46, 0.28);
  border-left-width: 0;
  border-bottom-width: 0;
  border-radius: 54% 44% 0 0;
  transform: rotate(-6deg);
}

.map-symbol {
  color: rgba(69, 39, 18, 0.42);
  font-size: clamp(24px, 3vw, 44px);
}

.map-symbol.skull { left: 48%; top: 23%; transform: rotate(11deg); }
.map-symbol.waves { left: 68%; bottom: 19%; font-family: 'Share Tech Mono', monospace; }

.map-corner {
  right: 24px;
  bottom: 22px;
  padding: 8px 12px;
  color: rgba(112, 33, 22, 0);
  font-family: 'Share Tech Mono', monospace;
  font-size: 13px;
  background: rgba(255, 231, 168, 0.32);
  border: 1px dashed rgba(104, 49, 23, 0.22);
  transform: rotate(-8deg);
  transition: color 0.7s ease, box-shadow 0.7s ease;
}

.map-corner.is-revealed {
  color: rgba(112, 33, 22, 0.9);
  box-shadow: 0 0 24px rgba(132, 33, 21, 0.24);
}

.map-graffiti {
  position: absolute;
  z-index: 2;
  margin: 0;
  max-width: 210px;
  color: rgba(69, 39, 18, 0.72);
  font-size: clamp(13px, 1.15vw, 16px);
  line-height: 1.25;
  transform: rotate(var(--rot));
}

.map-graffiti b {
  display: block;
  margin-top: 4px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  color: rgba(123, 33, 22, 0.65);
}

.graffiti-a { --rot: -8deg; left: 11%; top: 59%; }
.graffiti-b { --rot: 7deg; right: 12%; top: 42%; }
.graffiti-c { --rot: -4deg; left: 55%; top: 14%; }

.map-hotspot {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 3;
  width: clamp(68px, 9vw, 110px);
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(165, 24, 18, 0.72) 0 5px, rgba(165, 24, 18, 0.2) 6px 12px, transparent 13px),
    radial-gradient(circle, rgba(255, 224, 151, 0.18), transparent 58%);
  color: #5c2115;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: filter 0.24s ease, transform 0.24s ease;
}

.map-hotspot::before {
  content: '';
  position: absolute;
  inset: 20%;
  border: 1px solid rgba(105, 28, 18, 0.45);
  border-radius: 50%;
}

.map-hotspot span {
  position: absolute;
  left: 50%;
  top: calc(100% - 8px);
  width: max-content;
  max-width: 132px;
  padding: 5px 8px;
  border: 1px solid rgba(92, 39, 18, 0.2);
  background: rgba(245, 209, 132, 0.74);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  transform: translateX(-50%) rotate(-2deg);
  box-shadow: 0 6px 14px rgba(58, 26, 11, 0.18);
}

.map-hotspot:hover,
.map-hotspot:focus-visible {
  outline: none;
  filter: drop-shadow(0 0 14px rgba(186, 42, 25, 0.72));
  transform: translate(-50%, -50%) scale(1.08);
}

.map-hotspot.is-found {
  background:
    radial-gradient(circle, rgba(38, 88, 58, 0.82) 0 5px, rgba(38, 88, 58, 0.24) 6px 13px, transparent 14px),
    radial-gradient(circle, rgba(255, 224, 151, 0.22), transparent 58%);
}

.map-hotspot.is-locked {
  filter: saturate(0.55);
}

.treasure-panel {
  position: relative;
  z-index: 3;
  align-self: center;
  min-height: min(650px, calc(100vh - 64px));
  margin: clamp(12px, 2vw, 24px) clamp(8px, 2vw, 22px) clamp(12px, 2vw, 24px) 0;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 16px;
  background:
    linear-gradient(180deg, rgba(239, 202, 134, 0.9), rgba(183, 121, 62, 0.86)),
    #c98c4d;
  border: 1px solid rgba(86, 39, 18, 0.32);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.35), inset 0 0 24px rgba(93, 44, 19, 0.2);
  transform: rotate(1.1deg);
}

.treasure-panel h2 {
  margin: 0 0 10px;
  color: #3f2412;
  font-size: clamp(24px, 3vw, 36px);
  font-weight: 500;
  line-height: 1;
}

.treasure-panel p {
  margin: 0;
  color: #583217;
  font-size: 16px;
  line-height: 1.42;
}

.symbol-inventory {
  min-height: 92px;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  border: 1px dashed rgba(79, 36, 18, 0.36);
  background: rgba(255, 236, 176, 0.35);
}

.symbol-inventory span {
  width: 100%;
  color: #6b3418;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.symbol-inventory b {
  padding: 5px 8px;
  color: #5c2115;
  background: rgba(255, 247, 207, 0.54);
  border: 1px solid rgba(104, 49, 23, 0.2);
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
}

.act-track {
  display: grid;
  gap: 7px;
  align-self: end;
}

.act-track span,
.future-act {
  padding: 7px 9px;
  color: rgba(72, 40, 20, 0.62);
  border: 1px solid rgba(76, 38, 17, 0.18);
  font-family: 'Share Tech Mono', monospace;
  font-size: 11px;
  text-transform: uppercase;
}

.act-track .is-current {
  color: #6f2317;
  background: rgba(255, 239, 182, 0.42);
}

.treasure-complete {
  padding: 12px;
  background: rgba(255, 240, 184, 0.46);
  border: 1px solid rgba(116, 47, 20, 0.25);
}

.treasure-complete button {
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  border: 1px solid rgba(70, 33, 15, 0.45);
  background: #6f2819;
  color: #ffe8a8;
  font-family: 'Share Tech Mono', monospace;
  cursor: pointer;
}

.treasure-candle,
.treasure-compass,
.treasure-coins,
.treasure-rope,
.treasure-key,
.future-act {
  position: absolute;
  z-index: 1;
}

.treasure-candle {
  right: 8%;
  top: 7%;
  width: 42px;
  height: 98px;
  border-radius: 10px 10px 5px 5px;
  background: linear-gradient(90deg, #d6b57e, #fff0bd 48%, #a66e43);
  box-shadow: 0 20px 38px rgba(0, 0, 0, 0.34);
}

.treasure-candle span {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 22px;
  height: 36px;
  border-radius: 50% 50% 48% 48%;
  background: radial-gradient(circle at 50% 70%, #fff4b9 0 16%, #ffb33c 42%, rgba(255, 112, 30, 0.08) 72%);
  transform: translateX(-50%);
  filter: blur(0.2px);
  animation: candleFlicker 0.18s ease-in-out infinite alternate;
}

.treasure-compass {
  left: 7%;
  bottom: 8%;
  width: 118px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #d6a755 0 48%, #68401f 49% 54%, #1d1109 55%);
  box-shadow: 0 16px 32px rgba(0,0,0,0.42);
  transform: rotate(-14deg);
}

.treasure-compass b {
  position: absolute;
  left: 50%;
  top: 10px;
  transform: translateX(-50%);
  font-family: 'Share Tech Mono', monospace;
  color: #552717;
}

.treasure-compass i {
  position: absolute;
  left: 50%;
  top: 23%;
  width: 4px;
  height: 54%;
  background: #8d2419;
  transform: translateX(-50%) rotate(39deg);
  transform-origin: center;
}

.treasure-coins {
  right: 20%;
  bottom: 10%;
  width: 120px;
  height: 70px;
}

.treasure-coins i {
  position: absolute;
  width: 46px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe18a, #b57525 68%, #5a3213);
  box-shadow: 0 9px 18px rgba(0,0,0,0.35);
}

.treasure-coins i:nth-child(1) { left: 0; top: 18px; }
.treasure-coins i:nth-child(2) { left: 34px; top: 8px; }
.treasure-coins i:nth-child(3) { left: 70px; top: 22px; }

.treasure-rope {
  left: 2%;
  top: 13%;
  width: 190px;
  height: 190px;
  border: 15px solid #8f6639;
  border-right-color: transparent;
  border-radius: 50%;
  opacity: 0.76;
  transform: rotate(-25deg);
}

.treasure-key {
  right: 4%;
  bottom: 22%;
  width: 118px;
  height: 28px;
  background: linear-gradient(90deg, #452414, #93653b, #452414);
  border-radius: 20px;
  transform: rotate(23deg);
}

.treasure-key::before {
  content: '';
  position: absolute;
  left: -34px;
  top: -18px;
  width: 48px;
  aspect-ratio: 1;
  border: 9px solid #70451f;
  border-radius: 50%;
}

.treasure-key::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: -16px;
  width: 32px;
  height: 18px;
  border-left: 10px solid #503019;
  border-right: 10px solid #503019;
}

.future-act {
  left: -999px;
  top: -999px;
}

@keyframes candleFlicker {
  from { transform: translateX(-50%) scaleY(0.9) rotate(-2deg); opacity: 0.82; }
  to { transform: translateX(-50%) scaleY(1.1) rotate(2deg); opacity: 1; }
}

@keyframes treasureShadow {
  from { opacity: 0.86; transform: translateX(-1.2%); }
  to { opacity: 1; transform: translateX(1.2%); }
}

@keyframes treasureDust {
  from { transform: translate3d(0, -10px, 0); opacity: 0; }
  12% { opacity: 0.62; }
  to { transform: translate3d(32px, 110vh, 0); opacity: 0; }
}

@keyframes mapShake {
  0%, 100% { transform: rotate(-1.4deg) translate(0, 0); }
  30% { transform: rotate(-1.1deg) translate(4px, -2px); }
  60% { transform: rotate(-1.8deg) translate(-3px, 2px); }
}

@keyframes warmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (max-width: 880px) {
  .treasure-table {
    padding: 8px;
  }

  .treasure-map {
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .treasure-heading {
    position: relative;
    left: auto;
    top: auto;
    max-width: none;
    padding: 10px 8px 0;
  }

  .map-paper {
    min-height: 560px;
    margin: 4px;
    transform: rotate(-0.6deg);
  }

  .treasure-panel {
    min-height: auto;
    margin: 4px;
    transform: none;
  }

  .treasure-candle,
  .treasure-compass,
  .treasure-coins,
  .treasure-rope,
  .treasure-key {
    opacity: 0.42;
  }
}
