:root {
  --bg: #0b0c10;
  --panel: #14171f;
  --panel-2: #1a1f2b;
  --text: #f3efe6;
  --muted: #9aa3b5;
  --line: #2a3142;
  --accent: #d6ff3c;
  --accent-2: #ff4d6d;
  --accent-3: #5ce1ff;
  --good: #7dffb3;
  --bad: #ff7575;
  --warn: #ffd166;
  --font-display: "Archivo Black", sans-serif;
  --font-body: "Outfit", sans-serif;
  --font-mono: "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font-body); }
body {
  background:
    radial-gradient(900px 500px at 0% 0%, rgba(214,255,60,.10), transparent 50%),
    radial-gradient(800px 500px at 100% 0%, rgba(255,77,109,.12), transparent 45%),
    var(--bg);
}
.noise {
  pointer-events: none; position: fixed; inset: 0; opacity: .045; z-index: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
#app { position: relative; z-index: 1; }

.lang-switch {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 30;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(20, 23, 31, 0.92);
  backdrop-filter: blur(10px);
}
.lang-btn {
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.lang-btn.active {
  background: var(--accent);
  color: #111;
}

button, input { font: inherit; }
button { cursor: pointer; }
h1,h2,h3 { font-family: var(--font-display); letter-spacing: -.03em; margin: 0; }

.landing {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 48px;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 18px;
}
.hero-card, .start-card, .panel, .modal {
  background: linear-gradient(160deg, rgba(26,31,43,.96), rgba(14,16,22,.96));
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35);
}
.hero-card { padding: 28px; }
.kicker {
  display: inline-flex; gap: 8px; align-items: center;
  padding: 6px 10px; border-radius: 999px;
  border: 1px solid rgba(214,255,60,.35); color: var(--accent);
  font-family: var(--font-mono); font-size: 12px; text-transform: uppercase;
}
.hero-card h1 { font-size: clamp(42px, 7vw, 68px); line-height: .95; margin: 14px 0 10px; }
.hero-card h1 span { color: var(--accent); }
.lead { color: var(--muted); line-height: 1.55; max-width: 58ch; }
.stat-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px;
}
.stat-pill {
  padding: 12px; border-radius: 14px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.stat-pill b { display: block; font-size: 22px; }
.stat-pill span { color: var(--muted); font-family: var(--font-mono); font-size: 11px; }

.start-card { padding: 22px; }
.start-card h2 { margin-bottom: 14px; }
.draw-grid { display: grid; gap: 10px; }
.draw-slot {
  padding: 14px; border-radius: 16px; border: 1px dashed var(--line); background: rgba(255,255,255,.02);
}
.draw-slot .label { color: var(--muted); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; }
.draw-slot .value { font-size: 20px; font-weight: 700; margin-top: 4px; }
.draw-slot .desc { color: var(--muted); font-size: 13px; margin-top: 4px; }
.draw-slot.rolling .value { color: var(--accent-3); }
.nick-input {
  width: 100%; margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: #0f1218; color: var(--text);
}
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn {
  border: 0; border-radius: 12px; padding: 12px 16px; font-weight: 700;
}
.btn-primary { background: var(--accent); color: #111; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: var(--accent-2); color: #fff; }
.btn-ghost { background: rgba(255,255,255,.04); color: var(--text); border: 1px solid var(--line); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.active { outline: 2px solid var(--accent); }

.shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr; }
.topbar {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: rgba(10,11,14,.94); backdrop-filter: blur(10px);
  position: sticky; top: 0; z-index: 50;
}
.top-left, .top-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip {
  padding: 8px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); font-family: var(--font-mono); font-size: 12px;
}
.networth { font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.icon-btn {
  width: 40px; height: 36px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--text); font-weight: 700;
}

.dashboard {
  width: min(1280px, calc(100% - 20px));
  margin: 14px auto 24px;
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 12px;
}
.side, .main {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}
.identity h3 { font-size: 22px; }
.identity .sub { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }
.money-line { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.money-line b { font-family: var(--font-mono); }
.bars { display: grid; gap: 10px; margin: 12px 0; }
.bar-row .meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.track { height: 8px; border-radius: 999px; background: #0d1016; overflow: hidden; border: 1px solid var(--line); }
.fill { height: 100%; border-radius: 999px; }
.fill.energy { background: #ff4d6d; }
.fill.mindset { background: #5ce1ff; }
.fill.skill { background: #7dffb3; }
.fill.hype { background: #ffd166; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini {
  padding: 10px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.mini span { display: block; color: var(--muted); font-size: 11px; font-family: var(--font-mono); }
.mini b { font-size: 15px; }

.main-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; margin-bottom: 10px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; background: var(--good); }
.status-dot.paused { background: var(--warn); }
.focus-btn, .ff-btn {
  width: 100%; text-align: left; margin-bottom: 10px; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: rgba(214,255,60,.06); color: var(--text);
}
.feed { display: grid; gap: 8px; max-height: 48vh; overflow: auto; padding-right: 4px; }
.feed-item {
  padding: 12px; border-radius: 12px; background: rgba(255,255,255,.03); border: 1px solid var(--line);
}
.feed-item .when { color: var(--muted); font-family: var(--font-mono); font-size: 11px; margin-bottom: 4px; }
.feed-item .title { font-weight: 700; margin-bottom: 4px; }
.feed-item .body { color: var(--muted); font-size: 13px; line-height: 1.45; }
.controls-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }

.peer-list, .log-list { display: grid; gap: 8px; max-height: 34vh; overflow: auto; }
.peer, .log-line {
  padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.03); font-size: 13px;
}
.peer.you { border-color: rgba(214,255,60,.45); background: rgba(214,255,60,.06); }
.peer .row { display: flex; justify-content: space-between; gap: 8px; }
.side h4 { margin: 0 0 10px; font-size: 14px; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; }

.modal-backdrop {
  position: fixed; inset: 0; top: 58px; background: rgba(0,0,0,.55); display: grid; place-items: center;
  z-index: 20; padding: 16px;
}
.modal { width: min(560px, 100%); padding: 20px; position: relative; }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 34px; height: 34px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.04); color: var(--text);
}
.decision-banner {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 45; display: flex; gap: 8px; align-items: center;
  padding: 10px 12px; border-radius: 14px;
  border: 1px solid rgba(214,255,60,.35); background: rgba(20,23,31,.96);
  box-shadow: 0 12px 40px rgba(0,0,0,.4);
}
.decision-banner span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.modal h2 { margin-bottom: 8px; }
.modal p { color: var(--muted); line-height: 1.5; }
.choice-list { display: grid; gap: 8px; margin-top: 14px; }
.choice {
  text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.03); color: var(--text);
}
.choice:hover { border-color: rgba(214,255,60,.5); }
.choice strong { display: block; margin-bottom: 3px; }
.choice span { color: var(--muted); font-size: 12px; }

.ending-wrap {
  width: min(820px, calc(100% - 24px)); margin: 28px auto; padding: 22px;
  border-radius: 22px; border: 1px solid var(--line); background: var(--panel);
}
.ending-wrap h1 { font-size: clamp(34px, 6vw, 54px); margin: 8px 0 10px; }
.ending-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0; }

@media (max-width: 980px) {
  .landing, .dashboard { grid-template-columns: 1fr; }
  .stat-row, .ending-grid { grid-template-columns: repeat(2, 1fr); }
  .feed { max-height: none; }
}
