:root {
  --bg: #050805;
  --panel: rgba(8, 16, 10, .82);
  --line: #1c3a22;
  --green: #39ff7a;
  --green-dim: #1f9c4b;
  --amber: #ffb000;
  --text: #b8f5c8;
  --muted: #6b9a78;
  --mono: ui-monospace, "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh;
  background: var(--bg); color: var(--text);
  font-family: var(--mono); font-size: 16px; line-height: 1.55;
}
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; opacity: .5; }
.crt {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background:
    repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0 2px, rgba(0,0,0,.22) 2px 3px),
    radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,.6) 100%);
  animation: flicker 6s infinite;
}
@keyframes flicker { 0%,100% { opacity: 1 } 50% { opacity: .93 } 52% { opacity: 1 } }

.shell { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 0 16px 40px; }

.top {
  display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--green); }
.sym {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 2px solid var(--green); border-radius: 4px; font-weight: 700; font-size: 18px;
  text-shadow: 0 0 8px var(--green); box-shadow: 0 0 12px rgba(57,255,122,.35) inset;
}
.word { letter-spacing: .25em; font-weight: 700; text-shadow: 0 0 8px rgba(57,255,122,.6); }

.tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabs a {
  padding: 6px 12px; color: var(--muted); text-decoration: none; font-size: 14px; letter-spacing: .12em;
  border: 1px solid transparent; border-radius: 3px;
}
.tabs a:hover { color: var(--green); border-color: var(--line); }
.tabs a.on { color: var(--bg); background: var(--green); box-shadow: 0 0 12px rgba(57,255,122,.5); }

.panel { display: none; padding: 32px 0; }
.panel.on { display: block; animation: in .25s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(6px) } to { opacity: 1; transform: none } }

h1 { font-size: clamp(26px, 5vw, 46px); line-height: 1.15; margin: 8px 0 16px; color: var(--green); text-shadow: 0 0 14px rgba(57,255,122,.5); min-height: 1.2em; }
h2 { margin: 0 0 12px; color: var(--amber); letter-spacing: .2em; font-size: 22px; text-shadow: 0 0 10px rgba(255,176,0,.4); }
h2::before { content: "// "; color: var(--green-dim); }
.prompt { color: var(--muted); margin: 0; }
.cursor { color: var(--green); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0 } }
.lede { color: var(--muted); max-width: 62ch; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-top: 20px; }
.card {
  display: block; padding: 16px; text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: var(--green); box-shadow: 0 0 16px rgba(57,255,122,.25); transform: translateY(-2px); }
.card b { display: block; color: var(--green); letter-spacing: .15em; margin-bottom: 4px; }
.card span { color: var(--muted); font-size: 14px; }
.card .tag { display: inline-block; margin-top: 8px; font-size: 12px; color: var(--amber); border: 1px solid #5a4100; padding: 0 6px; border-radius: 2px; }

.screen {
  margin-top: 16px; padding: 10px; background: #000; border: 1px solid var(--green-dim);
  border-radius: 6px; box-shadow: 0 0 24px rgba(57,255,122,.15), inset 0 0 30px rgba(57,255,122,.06);
}
.screen iframe { display: block; width: 100%; aspect-ratio: 16/9; border: 0; }
.screen.forge iframe { aspect-ratio: auto; height: max(560px, calc(100vh - 300px)); }
#ruffle-host { min-height: 120px; }
#ruffle-host ruffle-player, #ruffle-host ruffle-embed { display: block; width: 100%; max-width: 800px; height: 600px; margin: 0 auto; }
.note { margin: 8px 0 0; color: var(--amber); font-size: 14px; }
.empty { padding: 28px; text-align: center; color: var(--muted); }
.empty code { color: var(--green); }

.links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.links a { color: var(--green); border: 1px solid var(--line); padding: 6px 12px; text-decoration: none; border-radius: 3px; }
.links a:hover { border-color: var(--green); box-shadow: 0 0 12px rgba(57,255,122,.3); }

.foot { border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); font-size: 13px; }

@media (max-width: 560px) {
  .tabs a { padding: 6px 8px; font-size: 13px; }
  #ruffle-host ruffle-player, #ruffle-host ruffle-embed { height: 360px; }
}
@media (prefers-reduced-motion: reduce) {
  .crt, .cursor, .panel.on { animation: none; }
}

.bigbtn {
  display: inline-block; padding: 14px 26px; font-weight: 700; letter-spacing: .1em; text-decoration: none;
  color: var(--bg); background: var(--green); border-radius: 4px; box-shadow: 0 0 16px rgba(57,255,122,.45);
}
