/* unlocker.bet — sealed-bag theater, not crypto-green SaaS */

:root {
  /* Emotion: precision + sealed heat. Warm ink neutrals, brass evidence accent. */
  --bg: oklch(0.14 0.012 55);
  --bg-elev: oklch(0.18 0.014 55);
  --bg-soft: oklch(0.22 0.016 55);
  --line: oklch(0.32 0.02 55);
  --line-strong: oklch(0.42 0.03 55);
  --text: oklch(0.93 0.015 75);
  --text-dim: oklch(0.72 0.02 65);
  --muted: oklch(0.58 0.025 60);
  --amber: oklch(0.82 0.14 85);
  --amber-deep: oklch(0.68 0.14 75);
  --cream: oklch(0.94 0.02 90);
  --steel: oklch(0.78 0.04 230);
  --cursed: oklch(0.78 0.12 310);
  --danger: oklch(0.68 0.18 25);
  --hit: oklch(0.86 0.16 95);

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-press: cubic-bezier(0.4, 0, 0.2, 1);
  --radius: 4px;
  --radius-lg: 12px;
  --measure: 38rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-optical-sizing: auto;
  font-size: 15.5px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  isolation: isolate;
  background-image:
    radial-gradient(ellipse 90% 55% at 18% -5%, oklch(0.35 0.06 75 / 0.35), transparent 55%),
    radial-gradient(ellipse 50% 40% at 95% 10%, oklch(0.3 0.04 50 / 0.25), transparent 50%),
    linear-gradient(180deg, oklch(0.16 0.014 55), var(--bg) 40%);
}

/* Film grain */
.noise {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0.045;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vignette {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 1;
  background: radial-gradient(ellipse 75% 70% at 50% 40%, transparent 40%, oklch(0.08 0.02 50 / 0.65) 100%);
}

/* ── Top bar ── */
.top {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand right"
    "tag tag";
  gap: 0.65rem 1.25rem;
  align-items: end;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid var(--line);
}

.top__brand {
  grid-area: brand;
}

.top__right {
  grid-area: right;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.55rem;
}

.top__wallet {
  min-height: 2.5rem;
}

.btn--quiet {
  height: 2rem;
  padding: 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.btn--quiet:hover {
  color: var(--text-dim);
  border-color: var(--line-strong);
}

.btn--quiet[aria-pressed='true'] {
  color: var(--danger);
  border-color: oklch(0.5 0.1 25 / 0.45);
}

.streak {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  border: 1px solid oklch(0.55 0.1 80 / 0.4);
  background: oklch(0.28 0.05 75 / 0.35);
  font-family: var(--font-mono);
  animation: streak-in 0.35s var(--ease-out);
}

.streak__n {
  font-size: 1rem;
  font-weight: 700;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.streak__l {
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.streak__best {
  font-size: 0.55rem;
  color: var(--text-dim);
  opacity: 0.8;
}

.streak--hot {
  border-color: oklch(0.75 0.14 85 / 0.55);
  box-shadow: 0 0 20px oklch(0.6 0.12 85 / 0.25);
  animation: streak-hot 1.2s ease-in-out infinite alternate;
}

@keyframes streak-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes streak-hot {
  from {
    box-shadow: 0 0 12px oklch(0.55 0.1 85 / 0.2);
  }
  to {
    box-shadow: 0 0 28px oklch(0.7 0.14 90 / 0.35);
  }
}

.case-no {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--amber-deep);
  border: 1px solid oklch(0.55 0.1 75 / 0.45);
  background: oklch(0.22 0.03 70 / 0.5);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
  transition: border-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}

.case-no[data-live="1"] {
  color: var(--steel);
  border-color: oklch(0.6 0.05 230 / 0.5);
}

.wordmark {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--cream);
}

.wordmark em {
  font-style: italic;
  font-weight: 500;
  color: var(--amber);
}

.top__tagline {
  grid-area: tag;
  margin: 0;
  max-width: 36rem;
  font-size: 0.92rem;
  color: var(--text-dim);
  line-height: 1.45;
}

/* ── Layout: stage dominates, rail supports ── */
.layout {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

@media (max-width: 900px) {
  .layout {
    grid-template-columns: 1fr;
  }
  .top {
    grid-template-areas:
      "brand brand"
      "tag tag"
      "right right";
  }
  .top__right {
    justify-content: flex-start;
  }
}

/* ── Stage (open action) ── */
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 2rem 1.25rem 1.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(165deg, oklch(0.2 0.02 55 / 0.9), oklch(0.15 0.015 50 / 0.95));
  overflow: hidden;
  min-height: 32rem;
}

.stage__glow {
  position: absolute;
  inset: -20% 10% auto;
  height: 55%;
  background: radial-gradient(ellipse at 50% 0%, oklch(0.55 0.12 80 / 0.22), transparent 70%);
  pointer-events: none;
  transition: opacity 0.4s var(--ease-out);
}

.stage__ring {
  position: absolute;
  left: 50%;
  top: 28%;
  width: min(320px, 80vw);
  height: min(320px, 80vw);
  transform: translate(-50%, -50%) scale(0.7);
  border-radius: 50%;
  border: 1px solid oklch(0.7 0.12 85 / 0);
  pointer-events: none;
  opacity: 0;
}

.stage.is-charging .stage__glow {
  opacity: 1.4;
  background: radial-gradient(ellipse at 50% 20%, oklch(0.65 0.16 85 / 0.4), transparent 65%);
}

.stage.is-charging .stage__ring {
  opacity: 1;
  animation: charge-ring 0.9s var(--ease-out) infinite;
}

@keyframes charge-ring {
  0% {
    transform: translate(-50%, -50%) scale(0.55);
    border-color: oklch(0.75 0.14 85 / 0.55);
    opacity: 0.9;
  }
  100% {
    transform: translate(-50%, -50%) scale(1.15);
    border-color: oklch(0.75 0.14 85 / 0);
    opacity: 0;
  }
}

/* Sealed bag */
.seal {
  position: relative;
  width: min(280px, 72vw);
  margin: 0.5rem auto 1.75rem;
  perspective: 800px;
}

.seal__pulse {
  position: absolute;
  z-index: 0;
  inset: -12%;
  border-radius: 18px;
  background: radial-gradient(circle, oklch(0.7 0.14 85 / 0.2), transparent 65%);
  opacity: 0;
  pointer-events: none;
}

.seal.is-charging .seal__pulse {
  opacity: 1;
  animation: seal-pulse 0.7s ease-in-out infinite alternate;
}

.seal.is-charging .seal__bag {
  animation: charge-wobble 0.35s ease-in-out infinite alternate;
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.1) inset,
    0 0 40px oklch(0.6 0.14 85 / 0.35),
    0 24px 48px oklch(0.08 0.02 50 / 0.55);
}

.seal.is-burst .seal__bag {
  animation: bag-burst 0.45s var(--ease-out);
}

@keyframes seal-pulse {
  from {
    transform: scale(0.92);
    opacity: 0.45;
  }
  to {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes charge-wobble {
  from {
    transform: translateY(-2px) scale(1.01);
  }
  to {
    transform: translateY(-6px) scale(1.03);
  }
}

@keyframes bag-burst {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.06);
  }
  100% {
    transform: scale(1);
  }
}

.seal__tape {
  position: absolute;
  z-index: 3;
  top: 38%;
  left: -8%;
  right: -8%;
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  padding: 0.35rem 0;
  background: repeating-linear-gradient(
    -12deg,
    oklch(0.78 0.14 85),
    oklch(0.78 0.14 85) 10px,
    oklch(0.2 0.02 55) 10px,
    oklch(0.2 0.02 55) 20px
  );
  color: oklch(0.18 0.02 55);
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  transform: rotate(-6deg);
  box-shadow: 0 4px 20px oklch(0.1 0.02 50 / 0.5);
  pointer-events: none;
}

.seal__tape span {
  background: oklch(0.88 0.12 90);
  padding: 0.15rem 0.4rem;
}

.seal__bag {
  position: relative;
  z-index: 2;
  aspect-ratio: 3 / 4;
  border-radius: 6px 6px 10px 10px;
  background:
    linear-gradient(145deg, oklch(0.28 0.025 55), oklch(0.16 0.02 50) 55%, oklch(0.12 0.015 48));
  border: 1px solid var(--line-strong);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.06) inset,
    0 24px 48px oklch(0.08 0.02 50 / 0.55);
  transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
}

.seal:hover .seal__bag {
  transform: translateY(-4px) rotateX(2deg);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.08) inset,
    0 32px 56px oklch(0.08 0.02 50 / 0.65);
}

.seal__bag-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 2rem 1.25rem;
  gap: 0.35rem;
}

.seal__crest {
  width: 3.25rem;
  height: 3.25rem;
  display: grid;
  place-items: center;
  border: 1px solid oklch(0.55 0.08 80 / 0.55);
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--amber);
  margin-bottom: 0.75rem;
  background: oklch(0.2 0.02 55 / 0.6);
}

.seal__case {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--amber-deep);
}

.seal__sub {
  margin: 0.35rem 0 0;
  max-width: 16ch;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
}

.seal__stitch {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 12%;
  border-top: 1px dashed oklch(0.45 0.03 55 / 0.55);
}

.seal__shadow {
  position: absolute;
  z-index: 1;
  left: 12%;
  right: 12%;
  bottom: -0.75rem;
  height: 1.25rem;
  background: radial-gradient(ellipse at center, oklch(0.05 0.02 50 / 0.55), transparent 70%);
  filter: blur(4px);
}

.seal.is-opening .seal__bag {
  animation: shake 0.55s var(--ease-press);
}

.seal.is-opening .seal__tape {
  animation: tape-rip 0.55s var(--ease-out) forwards;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  15% {
    transform: translateX(-5px) rotate(-1deg);
  }
  30% {
    transform: translateX(5px) rotate(1deg);
  }
  45% {
    transform: translateX(-4px) rotate(-0.6deg);
  }
  60% {
    transform: translateX(3px);
  }
  80% {
    transform: translateX(-2px);
  }
}

@keyframes tape-rip {
  0% {
    opacity: 1;
  }
  40% {
    transform: rotate(-10deg) translateY(-4px) scaleX(1.02);
  }
  100% {
    opacity: 0.15;
    transform: rotate(-18deg) translateY(-14px) translateX(12px);
  }
}

.vital__v.is-pulse {
  animation: num-pop 0.4s var(--ease-out);
  color: var(--amber);
}

@keyframes num-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

.vital__v {
  transition: color 0.25s var(--ease-out);
}

/* Vitals */
.vitals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  width: min(100%, 28rem);
  margin-bottom: 1.35rem;
}

@media (max-width: 480px) {
  .vitals {
    grid-template-columns: repeat(2, 1fr);
  }
}

.vital {
  padding: 0.65rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: oklch(0.12 0.015 50 / 0.65);
  transition: border-color 0.2s var(--ease-out), background 0.2s var(--ease-out);
}

.vital:hover {
  border-color: var(--line-strong);
  background: oklch(0.18 0.018 55 / 0.75);
}

.vital__k {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.vital__v {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.vital__v--amber {
  color: var(--amber);
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  align-items: stretch;
  width: 100%;
}

.btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-weight: 600;
  border-radius: var(--radius);
  transition:
    transform 0.15s var(--ease-press),
    background 0.2s var(--ease-out),
    border-color 0.2s var(--ease-out),
    box-shadow 0.2s var(--ease-out),
    opacity 0.2s;
}

.btn:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}

.btn:active:not(:disabled) {
  transform: scale(0.98);
}

.btn--primary {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  min-width: min(100%, 16rem);
  padding: 0.9rem 1.75rem;
  background: linear-gradient(180deg, oklch(0.86 0.13 88), oklch(0.72 0.14 78));
  color: oklch(0.18 0.03 55);
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.25) inset,
    0 10px 32px oklch(0.45 0.1 80 / 0.28);
  position: relative;
  overflow: hidden;
}

.btn--primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    oklch(1 0 0 / 0.28) 50%,
    transparent 60%
  );
  transform: translateX(-120%);
  transition: none;
}

.btn--primary:hover:not(:disabled)::after {
  animation: btn-sheen 0.7s var(--ease-out);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, oklch(0.9 0.12 90), oklch(0.76 0.14 80));
  box-shadow:
    0 1px 0 oklch(1 0 0 / 0.3) inset,
    0 14px 36px oklch(0.5 0.12 82 / 0.35);
  transform: translateY(-1px);
}

@keyframes btn-sheen {
  to {
    transform: translateX(120%);
  }
}

.btn--primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn__label {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.btn__hint {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.btn--ghost {
  padding: 0 1.1rem;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.btn--ghost:hover:not(:disabled) {
  color: var(--text);
  border-color: var(--line-strong);
  background: oklch(0.2 0.015 55 / 0.5);
}

.btn--mini {
  height: 1.85rem;
  padding: 0 0.7rem;
  font-size: 0.7rem;
  font-weight: 600;
  background: transparent;
  color: var(--amber);
  border: 1px solid oklch(0.55 0.1 75 / 0.45);
  border-radius: 999px;
}

.btn--mini:hover:not(:disabled) {
  background: oklch(0.35 0.06 75 / 0.25);
  border-color: var(--amber-deep);
}

.status-line {
  margin: 1rem 0 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  max-width: 36rem;
  line-height: 1.45;
}

/* Console (collapsed by default) */
.console {
  width: 100%;
  max-width: 28rem;
  margin-top: 1.25rem;
  text-align: left;
  border-top: 1px solid var(--line);
  padding-top: 0.75rem;
}

.console summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  list-style: none;
  user-select: none;
}

.console summary::-webkit-details-marker {
  display: none;
}

.console summary:hover {
  color: var(--text-dim);
}

.console[open] summary {
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.console__body {
  margin: 0;
  max-height: 7rem;
  overflow: auto;
  padding: 0.65rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  line-height: 1.4;
  color: var(--muted);
  background: oklch(0.1 0.01 50);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: pre-wrap;
}

/* ── Rail ── */
.rail {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.rail__block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: oklch(0.16 0.014 55 / 0.85);
  padding: 1rem 1rem 1.1rem;
}

.rail__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.rail__head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--cream);
}

.rail__meta {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Pool cards */
.pool {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.pool-card {
  display: grid;
  grid-template-columns: 3.1rem 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: oklch(0.13 0.012 52);
  animation: card-rise 0.4s var(--ease-out) both;
  transition:
    border-color 0.2s var(--ease-out),
    transform 0.25s var(--ease-out),
    opacity 0.25s var(--ease-out);
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.pool-card:hover {
  border-color: var(--line-strong);
  transform: translateX(2px);
}

.pool-card--dim {
  opacity: 0.42;
}

.pool-card--blocked {
  opacity: 0.72;
  border-style: dashed;
}

.pill--blocked {
  color: var(--muted);
  border-color: var(--line-strong);
  background: oklch(0.2 0.015 55 / 0.5);
}

.pool-card--cursed {
  border-color: oklch(0.45 0.08 310 / 0.45);
}

.pool-card--cursed:hover {
  border-color: oklch(0.55 0.1 310 / 0.55);
}

.pool-card__mark {
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  border-radius: 3px;
  font-size: 1.35rem;
  background:
    linear-gradient(145deg, oklch(0.24 0.02 55), oklch(0.16 0.015 50));
  border: 1px solid var(--line);
  box-shadow: 0 1px 0 oklch(1 0 0 / 0.04) inset;
}

.pool-card--cursed .pool-card__mark {
  box-shadow: 0 0 16px oklch(0.5 0.1 310 / 0.2);
}

.pool-card__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}

.pool-card__meta {
  margin-top: 0.15rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  color: var(--muted);
  line-height: 1.35;
}

.pool-card__meta strong {
  color: var(--amber-deep);
  font-weight: 500;
}

.pill {
  font-family: var(--font-mono);
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.28rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
}

.pill--pool {
  color: var(--amber);
  border-color: oklch(0.55 0.1 80 / 0.4);
  background: oklch(0.3 0.05 75 / 0.2);
}

.pill--held {
  color: var(--steel);
  border-color: oklch(0.5 0.05 230 / 0.4);
}

.pill--shipped {
  color: var(--hit);
  border-color: oklch(0.7 0.12 95 / 0.4);
}

/* Inventory */
.inventory {
  min-height: 3rem;
}

.inv-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: oklch(0.12 0.012 50);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-dim);
  animation: chip-in 0.35s var(--ease-out) both;
  transition: border-color 0.2s var(--ease-out), transform 0.15s var(--ease-press);
}

.chip:active {
  transform: scale(0.96);
}

@keyframes chip-in {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.chip:hover {
  border-color: var(--line-strong);
}

.chip--phys {
  color: var(--amber);
  border-color: oklch(0.55 0.1 80 / 0.45);
  background: oklch(0.28 0.04 75 / 0.25);
}

.claim-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--line);
}

.claim-row:first-of-type {
  margin-top: 0.75rem;
}

.section-label {
  width: 100%;
  margin: 0 0 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
  font-family: var(--font-display);
}

/* Feed */
.feed {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 14rem;
  overflow: auto;
}

.feed-row {
  display: grid;
  grid-template-columns: 1.5rem 1fr auto;
  gap: 0.5rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid oklch(0.28 0.015 55 / 0.8);
  font-size: 0.8rem;
  animation: feed-in 0.35s var(--ease-out);
}

.feed-row:last-child {
  border-bottom: 0;
}

.feed-row--hit .feed-title {
  color: var(--hit);
  font-weight: 600;
}

.feed-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feed-meta {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  color: var(--muted);
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Footer */
.claim-row--dim {
  opacity: 0.55;
}
.chip--dim {
  opacity: 0.85;
}

.tos {
  margin-top: 1rem;
  max-width: 42rem;
  margin-inline: auto;
  text-align: left;
  font-size: 0.78rem;
  color: rgba(245, 240, 232, 0.55);
}
.tos summary {
  cursor: pointer;
  color: rgba(245, 240, 232, 0.7);
  font-family: 'IBM Plex Mono', monospace;
  letter-spacing: 0.04em;
  list-style: none;
}
.tos summary::-webkit-details-marker { display: none; }
.tos[open] summary { color: #e8b86d; margin-bottom: 0.6rem; }
.tos__body {
  padding: 0.75rem 0.9rem;
  border: 1px solid rgba(232, 184, 109, 0.18);
  border-radius: 8px;
  background: rgba(12, 10, 9, 0.65);
  line-height: 1.45;
}
.tos__body ol {
  margin: 0.4rem 0 0.6rem 1.1rem;
  padding: 0;
}
.tos__body li { margin: 0.35rem 0; }
.tos__meta {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  opacity: 0.75;
  word-break: break-all;
}
.tos__meta code { color: #e8b86d; }

.foot {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem 2.5rem;
}

.foot p {
  margin: 0;
  max-width: 42rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
}

/* Toast */
.toast {
  position: fixed;
  z-index: 90;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 0.7rem 1.1rem;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: oklch(0.18 0.02 55);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 12px 40px oklch(0.05 0.02 50 / 0.55);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s var(--ease-out),
    transform 0.25s var(--ease-out);
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.err {
  border-color: oklch(0.55 0.15 25 / 0.6);
  color: oklch(0.85 0.08 30);
}

/* Reveal modal */
.reveal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: oklch(0.08 0.02 50 / 0.88);
  backdrop-filter: blur(6px);
}

.reveal[hidden] {
  display: none;
}

.reveal-stage {
  position: relative;
  width: min(22rem, 100%);
}

.reveal-back {
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 22rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background:
    repeating-linear-gradient(
      -12deg,
      oklch(0.22 0.02 55),
      oklch(0.22 0.02 55) 12px,
      oklch(0.18 0.015 50) 12px,
      oklch(0.18 0.015 50) 24px
    );
  box-shadow: 0 24px 64px oklch(0.05 0.02 50 / 0.65);
  animation: back-pulse 0.7s ease-in-out infinite alternate;
}

.reveal-back__crest {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: 1px solid oklch(0.55 0.08 80 / 0.5);
  border-radius: 50%;
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--amber);
}

.reveal-back p {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  color: var(--muted);
}

@keyframes back-pulse {
  from {
    transform: scale(0.98);
    filter: brightness(0.95);
  }
  to {
    transform: scale(1.02);
    filter: brightness(1.08);
  }
}

.reveal-card {
  position: relative;
  width: 100%;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background:
    linear-gradient(165deg, oklch(0.24 0.025 55), oklch(0.14 0.015 50));
  box-shadow: 0 24px 64px oklch(0.05 0.02 50 / 0.65);
  overflow: hidden;
}

.reveal-card--soft {
  animation: card-in 0.45s var(--ease-out);
}

.reveal-card--slam {
  animation: card-slam 0.55s cubic-bezier(0.2, 1.3, 0.35, 1);
}

.reveal-card--phys {
  border-color: oklch(0.7 0.12 85 / 0.55);
  box-shadow:
    0 0 0 1px oklch(0.75 0.1 85 / 0.15),
    0 24px 64px oklch(0.35 0.08 80 / 0.25),
    0 0 80px oklch(0.6 0.12 85 / 0.2);
}

.reveal-card--cursed {
  border-color: oklch(0.65 0.12 310 / 0.55);
  box-shadow:
    0 0 0 1px oklch(0.6 0.1 310 / 0.2),
    0 24px 64px oklch(0.35 0.08 310 / 0.22),
    0 0 80px oklch(0.5 0.12 310 / 0.22);
}

.reveal-card--tag {
  border-color: oklch(0.45 0.03 55 / 0.8);
}

.reveal-rays {
  pointer-events: none;
  position: absolute;
  inset: -40%;
  background: conic-gradient(
    from 0deg,
    transparent 0deg 18deg,
    oklch(0.85 0.1 90 / 0.07) 18deg 22deg,
    transparent 22deg 40deg
  );
  animation: rays-spin 8s linear infinite;
  opacity: 0.7;
}

.reveal-card--tag .reveal-rays {
  opacity: 0.25;
}

@keyframes rays-spin {
  to {
    transform: rotate(360deg);
  }
}

.reveal-kicker {
  position: relative;
  margin: 0 0 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--amber-deep);
}

.reveal-icon {
  position: relative;
  font-size: 3.2rem;
  line-height: 1;
  margin: 0.5rem 0 0.85rem;
  filter: drop-shadow(0 8px 16px oklch(0.1 0.02 50 / 0.5));
  animation: icon-pop 0.5s var(--ease-out) 0.05s both;
}

.reveal-title {
  position: relative;
  margin: 0 0 0.4rem;
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--cream);
}

.reveal-meta {
  position: relative;
  margin: 0 0 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.4;
}

.reveal-meta b {
  color: var(--amber);
  font-weight: 600;
}

.reveal-actions {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: stretch;
}

.reveal-actions .btn--primary {
  min-width: 0;
  width: 100%;
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes card-slam {
  0% {
    opacity: 0;
    transform: scale(0.5) rotate(-8deg);
  }
  55% {
    opacity: 1;
    transform: scale(1.08) rotate(1deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes icon-pop {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* FX layer */
.fx {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 110;
  overflow: hidden;
}

.fx-bit {
  position: absolute;
  border-radius: 1px;
  animation: bit-fly 0.85s var(--ease-out) forwards;
  opacity: 0.95;
}

@keyframes bit-fly {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.2);
    opacity: 0;
  }
}

.flash {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 95;
  opacity: 0;
  transition: opacity 0.35s var(--ease-out);
}

.flash.is-on {
  opacity: 1;
  transition: opacity 0.05s linear;
}

.flash--hit {
  background: radial-gradient(circle at 50% 45%, oklch(0.85 0.12 90 / 0.28), transparent 55%);
}

.flash--cursed {
  background: radial-gradient(circle at 50% 45%, oklch(0.7 0.14 310 / 0.3), transparent 55%);
}

.flash--tag {
  background: radial-gradient(circle at 50% 50%, oklch(0.7 0.04 70 / 0.12), transparent 50%);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .fx,
  .flash,
  .stage__ring,
  .seal__pulse {
    display: none !important;
  }
}
