:root {
  --bg: #0a0d0b;
  --panel: #111612;
  --line: #1f2a22;
  --fg: #c9f5d2;
  --dim: #5f7d66;
  --green: #39ff6a;
  --red: #ff3b4e;
  --amber: #ffb02e;
  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
}

body {
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 50% -10%, rgba(57, 255, 106, .08), transparent 60%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .015) 0 1px, transparent 1px 3px),
    var(--bg);
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

header { text-align: center; margin-bottom: 28px; }

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 8vw, 5rem);
  letter-spacing: -.04em;
  line-height: 1;
}
h1 .any { color: var(--fg); }
h1 .two { color: var(--red); text-shadow: 0 0 18px rgba(255, 59, 78, .6); }
h1 .shell { color: var(--green); text-shadow: 0 0 18px rgba(57, 255, 106, .5); }

.tagline { color: var(--dim); margin: 12px 0 0; font-size: 1rem; }
.tagline em { color: var(--amber); font-style: normal; }

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}

/* ---------- wheel ---------- */
.wheel-box {
  position: relative;
  width: 100%;
  max-width: 620px;
  aspect-ratio: 1;
  margin: 0 auto;
}

#wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: 0 0 0 6px #1a221c, 0 0 0 8px var(--green), 0 0 60px rgba(57, 255, 106, .25);
}

.pointer {
  position: absolute;
  top: 50%;
  right: -34px;
  width: 0;
  height: 0;
  transform: translateY(-50%);
  border-top: 18px solid transparent;
  border-bottom: 18px solid transparent;
  border-right: 38px solid var(--red);
  filter: drop-shadow(0 0 10px rgba(255, 59, 78, .8));
  z-index: 2;
}

.hub {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 3px solid var(--green);
  background: radial-gradient(circle, #16201a, #070907);
  color: var(--green);
  font: 700 clamp(.8rem, 2.4vw, 1.15rem) var(--mono);
  letter-spacing: .08em;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(57, 255, 106, .35), inset 0 0 18px rgba(57, 255, 106, .15);
  transition: transform .15s, box-shadow .15s;
}
.hub:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.05);
  box-shadow: 0 0 36px rgba(57, 255, 106, .6), inset 0 0 18px rgba(57, 255, 106, .25);
}
.hub:disabled { cursor: wait; color: var(--dim); border-color: var(--dim); }
.hub:focus-visible { outline: 3px solid var(--amber); outline-offset: 4px; }

/* ---------- terminal ---------- */
.terminal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #0c100d;
  border-bottom: 1px solid var(--line);
  font-size: .75rem;
  color: var(--dim);
}
.term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #2a352c; }
.term-bar i:first-child { background: var(--red); }
.term-bar i:nth-child(2) { background: var(--amber); }
.term-bar i:nth-child(3) { background: var(--green); }
.term-bar span { margin-left: 8px; }

#out {
  margin: 0;
  padding: 16px;
  min-height: 220px;
  font-size: .9rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.dim { color: var(--dim); }
.ok { color: var(--green); }
.bad { color: var(--red); }
.warn { color: var(--amber); }
.big {
  display: inline-block;
  margin: 6px 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--red);
  text-shadow: 0 0 14px rgba(255, 59, 78, .6);
}
.cursor { animation: blink 1s steps(1) infinite; color: var(--green); }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- history ---------- */
.history { margin-top: 20px; }
.history h2 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--dim);
  margin: 0 0 8px;
}
#history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
#history li {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .8rem;
  background: var(--panel);
}
#history li:first-child { border-color: var(--red); color: var(--red); }
#history:empty::before { content: attr(data-empty); color: var(--dim); font-size: .8rem; }

footer {
  margin-top: 40px;
  text-align: center;
  color: var(--dim);
  font-size: .75rem;
}

/* ---------- shake on hit ---------- */
.shake { animation: shake .5s; }
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}

@media (max-width: 860px) {
  .stage { grid-template-columns: 1fr; }
  .wheel-box { width: calc(100% - 24px); margin-left: 0; }
  .pointer { right: -24px; border-right-width: 28px; border-top-width: 13px; border-bottom-width: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .shake, .cursor { animation: none; }
}
