/* Build 4.05 — Edge Radio seal gate */
.he-gate {
  position: relative;
  margin-top: 1.5rem;
  border-radius: 10px;
  border: 2px solid rgba(201, 168, 76, 0.4);
  background:
    repeating-linear-gradient(92deg, rgba(255,200,120,0.03) 0 1px, transparent 1px 7px),
    linear-gradient(160deg, #4a2c18, #1a0e08);
  box-shadow:
    0 0 0 3px #2a1810,
    0 20px 50px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,210,140,0.12);
  padding: 1.25rem 1.1rem 1.4rem;
  overflow: hidden;
}
.he-gate-kicker {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #c9a84c;
  margin: 0 0 0.5rem;
}
.he-gate-title {
  font-family: Fraunces, ui-serif, Georgia, serif;
  font-size: clamp(1.5rem, 2vw + 1vh, 2.1rem);
  color: #efe7d9;
  margin: 0 0 0.4rem;
  line-height: 1.15;
}
.he-gate-copy {
  max-width: 36rem;
  color: rgba(239,231,217,0.72);
  font-size: 0.92rem;
  line-height: 1.5;
  margin: 0 0 1.1rem;
}

.he-seal-stage {
  position: relative;
  min-height: 220px;
  border-radius: 8px;
  border: 1px solid rgba(201,168,76,0.3);
  background: radial-gradient(ellipse at 50% 30%, #3a2418, #100804 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  touch-action: manipulation;
  overflow: hidden;
}
.he-seal-stage:focus-visible {
  outline: 2px solid #e3975a;
  outline-offset: 3px;
}
.he-seal-stage.is-cracked { cursor: default; }

.he-seal-plate {
  position: absolute;
  inset: 12%;
  border-radius: 6px;
  border: 2px solid rgba(201,168,76,0.45);
  background:
    linear-gradient(145deg, rgba(80,50,24,0.9), rgba(20,10,6,0.95));
  box-shadow: inset 0 0 40px rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  transition: transform 0.15s, filter 0.2s, opacity 0.4s;
}
.he-seal-stage.hit .he-seal-plate {
  transform: translate(var(--jx, 0), var(--jy, 0)) rotate(var(--jr, 0deg));
  filter: brightness(1.15);
}
.he-seal-stage.is-cracked .he-seal-plate {
  opacity: 0.15;
  filter: grayscale(0.4);
  pointer-events: none;
}

.he-wax {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #ff6b3d, #a32018 55%, #4a0c08 100%);
  border: 3px solid #6a1810;
  box-shadow:
    0 8px 20px rgba(0,0,0,0.55),
    inset 0 2px 4px rgba(255,180,120,0.35),
    0 0 24px rgba(227,80,40,0.25);
  display: grid;
  place-items: center;
  position: relative;
  transition: transform 0.12s, box-shadow 0.2s, filter 0.3s;
}
.he-wax::after {
  content: "HE";
  font-family: Fraunces, serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: rgba(255, 220, 180, 0.85);
  letter-spacing: 0.08em;
}
.he-seal-stage.hit .he-wax { transform: scale(0.92); }
.he-seal-stage.is-cracked .he-wax {
  transform: scale(1.4) rotate(18deg);
  filter: blur(1px) brightness(0.7);
  opacity: 0.35;
  box-shadow: none;
}

.he-crack {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(115deg, transparent 48%, rgba(255,220,160,0.55) 49.5%, transparent 51%),
    linear-gradient(40deg, transparent 46%, rgba(255,200,120,0.4) 50%, transparent 54%),
    linear-gradient(-20deg, transparent 42%, rgba(227,151,90,0.35) 50%, transparent 58%);
  mix-blend-mode: screen;
  transition: opacity 0.25s;
}
.he-seal-stage.crack-1 .he-crack { opacity: 0.35; }
.he-seal-stage.crack-2 .he-crack { opacity: 0.55; }
.he-seal-stage.crack-3 .he-crack { opacity: 0.75; }
.he-seal-stage.crack-4 .he-crack,
.he-seal-stage.is-cracked .he-crack { opacity: 1; }

.he-seal-hint {
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #aa9c8a;
  text-align: center;
  padding: 0 1rem;
}
.he-hits {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: #e3975a;
}

/* Code dials after seal cracks */
.he-code-row {
  display: none;
  margin-top: 1.1rem;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
}
.he-code-row.show { display: flex; }
.he-code-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}
.he-code-dial label {
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #8a7040;
}
.he-code-dial button {
  appearance: none;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #2a1c08;
  cursor: pointer;
  font-family: Fraunces, serif;
  font-size: 1.45rem;
  color: #1a1008;
  background: radial-gradient(circle at 32% 28%, #f0d78a, #c9a84c 45%, #7a5e28);
  box-shadow:
    0 5px 0 #4a3818,
    0 8px 14px rgba(0,0,0,0.45),
    inset 0 2px 2px rgba(255,240,180,0.45);
  transition: transform 0.08s, box-shadow 0.08s;
}
.he-code-dial button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #4a3818, 0 3px 6px rgba(0,0,0,0.4);
}
.he-code-dial button:focus-visible {
  outline: 2px solid #e3975a;
  outline-offset: 3px;
}

.he-latch {
  appearance: none;
  display: none;
  margin: 1rem auto 0;
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  border: 2px solid rgba(201,168,76,0.55);
  background: linear-gradient(180deg, #3a281c, #1a100c);
  color: #e3975a;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 #0a0604, inset 0 1px 0 rgba(255,200,120,0.12);
}
.he-latch.show { display: inline-flex; }
.he-latch:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.he-latch:not(:disabled):hover {
  border-color: #e3975a;
  background: rgba(227,151,90,0.12);
}
.he-latch:not(:disabled):active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0a0604;
}

.he-gate-status {
  margin-top: 0.75rem;
  min-height: 1.2rem;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: #aa9c8a;
  text-align: center;
}
.he-gate-status.ok { color: #e3975a; }

.he-radio-reveal {
  display: none;
  margin-top: 1.25rem;
  animation: heReveal 0.7s ease-out;
}
.he-radio-reveal.open { display: block; }
@keyframes heReveal {
  from { opacity: 0; transform: translateY(16px) scale(0.98); filter: blur(4px); }
  to { opacity: 1; transform: none; filter: none; }
}

.he-gate.unlocked .he-seal-stage,
.he-gate.unlocked .he-code-row,
.he-gate.unlocked .he-latch,
.he-gate.unlocked .he-gate-copy,
.he-gate.unlocked .he-gate-status { display: none !important; }

.he-gate-open-banner {
  display: none;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #e3975a;
  margin-bottom: 0.75rem;
}
.he-gate.unlocked .he-gate-open-banner { display: block; }

/* --- Discoverable breadcrumbs (4 · 0 · 5) --- */
.he-clueboard {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin: 0 0 1rem;
}
@media (min-width: 640px) {
  .he-clueboard { grid-template-columns: 1fr 1fr; }
}
.he-clue {
  position: relative;
  border-radius: 4px;
  border: 1px dashed rgba(201,168,76,0.35);
  background: rgba(0,0,0,0.28);
  padding: 0.55rem 0.65rem;
  min-height: 3.2rem;
}
.he-clue-cap {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7040;
  margin-bottom: 0.25rem;
}
.he-clue-plaque {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}
.he-clue-digit {
  font-family: Fraunces, serif;
  font-size: 1.55rem;
  color: #e3975a;
  text-shadow: 0 0 12px rgba(227,151,90,0.35);
  min-width: 1.1rem;
  text-align: center;
}
.he-clue-digit.ghost {
  color: rgba(170,156,138,0.35);
  text-decoration: line-through;
  filter: blur(0.4px);
}
.he-clue-digit.d4 { transform: rotate(-6deg); }
.he-clue-digit.d5 { transform: rotate(5deg); margin-left: 0.6rem; }

.he-clue-freq { text-align: center; }
.he-freq-readout {
  display: block;
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.45rem;
  letter-spacing: 0.18em;
  color: #ffb060;
  text-shadow: 0 0 16px rgba(255,140,60,0.45);
}

.he-greg-note {
  display: block;
  font-family: Fraunces, serif;
  font-style: italic;
  font-size: 0.95rem;
  color: #efe7d9;
  line-height: 1.35;
}

.he-clue-build {
  grid-column: 1 / -1;
  border-style: solid;
  border-color: rgba(227,151,90,0.2);
  background:
    repeating-linear-gradient(-12deg, transparent 0 8px, rgba(227,151,90,0.04) 8px 9px),
    rgba(0,0,0,0.2);
  text-align: center;
  padding: 0.4rem;
}
.he-build-stamp {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: rgba(227,151,90,0.55);
  text-transform: uppercase;
}

.he-graffiti {
  margin: 0.35rem 0 0;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(227,151,90,0.4);
}
.he-watermark {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(227,151,90,0.28);
  pointer-events: none;
  transform: rotate(-8deg);
}

.he-gate.unlocked .he-clueboard { display: none !important; }
