@font-face { font-family: CodyCoin; src: url(/shared/codycoin.woff) format('woff'); unicode-range: U+20A1; font-display: block; }
:root {
  --bg: #0b0f1a;
  --bg2: #121829;
  --card: #171f35;
  --line: #26304d;
  --text: #e8ecf6;
  --muted: #8b95b3;
  --gold: #f5c542;
  --green: #35d07f;
  --red: #ff5d6c;
  --blue: #4da3ff;
  --purple: #a77bff;
  --radius: 14px;
  --font: CodyCoin, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: CodyCoin, ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 20% -10%, #1d2a55 0%, transparent 60%), var(--bg);
  color: var(--text);
  min-height: 100vh;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.pos { color: var(--green); }
.neg { color: var(--red); }
.gold { color: var(--gold); }

/* ---------- HUD ---------- */
.gc-hud {
  position: sticky; top: 0; z-index: 50;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 10px 20px;
  background: rgba(11, 15, 26, .88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.gc-brand { font-weight: 800; font-size: 1.1rem; color: var(--gold); white-space: nowrap; }
.gc-brand:hover { text-decoration: none; }
.gc-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.gc-nav a {
  padding: 6px 12px; border-radius: 999px; color: var(--text); font-weight: 600; font-size: .9rem;
}
.gc-nav a:hover, .gc-nav a.active { background: var(--card); text-decoration: none; }
.gc-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.gc-chip {
  display: flex; flex-direction: column; padding: 4px 12px; border-radius: 10px;
  background: var(--card); border: 1px solid var(--line); min-width: 84px;
}
.gc-chip small { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; }
.gc-chip b { font-family: var(--mono); font-size: .95rem; }
.gc-chip.flash-up { animation: flashUp .8s; }
.gc-chip.flash-down { animation: flashDown .8s; }
@keyframes flashUp { 0% { background: rgba(53, 208, 127, .45); } 100% { background: var(--card); } }
@keyframes flashDown { 0% { background: rgba(255, 93, 108, .45); } 100% { background: var(--card); } }
.gc-daybar { height: 3px; background: var(--line); border-radius: 2px; margin-top: 3px; overflow: hidden; }
.gc-daybar > i { display: block; height: 100%; background: var(--purple); }

.gc-acct {
  display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .9rem; white-space: nowrap;
}
.gc-acct:hover, .gc-acct.active { text-decoration: none; border-color: var(--gold); }
.gc-acct.guest .gc-un { color: var(--gold); }
.gc-acct.err { border-color: var(--red); }
.gc-av { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--bg2); font-size: 1.15rem; }
.gc-act-btn.on { border-color: var(--green); color: var(--green); }

/* ---------- activity chart ---------- */
.gc-activity {
  position: fixed; right: 16px; bottom: 16px; z-index: 60; width: min(420px, calc(100vw - 32px));
  background: rgba(23, 31, 53, .97); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.gc-activity[hidden] { display: none; }
.gc-act-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.gc-act-head b { margin-right: auto; }
.gc-act-head .muted { display: none; }
.gc-activity canvas { width: 100%; height: 180px; display: block; background: var(--bg2); border-radius: 10px; }
.gc-act-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; margin-top: 8px; font-family: var(--mono); font-size: .82rem; }
.gc-act-stats small { display: block; color: var(--muted); font-family: var(--font); font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; }

@media (max-width: 700px) {
  .gc-activity { left: 6px; right: 6px; bottom: 6px; width: auto; padding: 8px; }
  .gc-activity canvas { height: 110px; }
  .gc-act-stats { grid-template-columns: repeat(5, 1fr); font-size: .7rem; gap: 4px 6px; }
  .gc-act-stats > div:nth-child(n+6) { display: none; }
  body.gc-act-open { padding-bottom: 250px; }
}

/* ---------- store / jobs ---------- */
.item-card { display: flex; flex-direction: column; gap: 10px; }
.item-card .swatch { height: 90px; border-radius: 10px; border: 1px solid var(--line); display: grid; place-items: center; font-size: 2.6rem; background: var(--bg2); }
.item-card.owned .swatch { outline: 2px solid var(--line); }
.item-card.equipped { border-color: var(--gold); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; background: var(--bg2); border: 1px solid var(--line); color: var(--muted); }
.tag.gold { color: var(--gold); border-color: var(--gold); }
.tag.green { color: var(--green); border-color: var(--green); }
.tag.red { color: var(--red); border-color: var(--red); }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs button { background: var(--card); border: 1px solid var(--line); color: var(--text); padding: 7px 14px; border-radius: 999px; font-weight: 700; cursor: pointer; }
.tabs button.active { border-color: var(--gold); color: var(--gold); }

/* ---------- layout ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 28px 20px 60px; }
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px;
}
.card h3 { font-size: 1rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.big { font-size: 2rem; font-weight: 800; font-family: var(--mono); }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  padding: 10px 18px; border-radius: 10px; background: var(--blue); color: #fff;
  transition: transform .06s, filter .15s;
}
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; filter: none; }
.btn.gold { background: var(--gold); color: #1a1300; }
.btn.green { background: var(--green); color: #002611; }
.btn.red { background: var(--red); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
input, select {
  font: inherit; color: var(--text); background: var(--bg2); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; min-width: 0;
}
input:focus, select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: .78rem; text-transform: uppercase; }
td.num, th.num { text-align: right; font-family: var(--mono); }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700;
  background: var(--line); color: var(--text); text-transform: uppercase; letter-spacing: .04em;
}
.badge.green { background: rgba(53, 208, 127, .18); color: var(--green); }
.badge.red { background: rgba(255, 93, 108, .18); color: var(--red); }
.badge.gold { background: rgba(245, 197, 66, .18); color: var(--gold); }

/* ---------- toasts ---------- */
.gc-toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.gc-toast {
  padding: 12px 16px; border-radius: 10px; background: var(--card); border-left: 4px solid var(--blue);
  box-shadow: 0 8px 30px rgba(0,0,0,.4); max-width: 340px; animation: toastIn .25s;
}
.gc-toast.success { border-color: var(--green); }
.gc-toast.warn { border-color: var(--gold); }
.gc-toast.error { border-color: var(--red); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

/* ---------- bet picker (shared by games) ---------- */
.betbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.betbar input { width: 120px; font-family: var(--mono); }
.chip-btn {
  width: 46px; height: 46px; border-radius: 50%; border: 3px dashed rgba(255,255,255,.55);
  font-weight: 800; cursor: pointer; color: #fff; font-size: .8rem;
}
.chip-btn[data-v="100"] { background: #6b7280; }
.chip-btn[data-v="500"] { background: #d23b4a; }
.chip-btn[data-v="2500"] { background: #2e9e5b; }
.chip-btn[data-v="10000"] { background: #1f2937; }
.chip-btn[data-v="50000"] { background: #7c3aed; }

.game-stage {
  background: var(--stage-bg, radial-gradient(800px 400px at 50% 0%, #1d6b45 0%, #0f3d27 70%));
  border: 6px solid #3b2b14; border-radius: 22px; padding: 24px; min-height: 320px;
  box-shadow: inset 0 0 60px rgba(0,0,0,.5);
}

@media (max-width: 700px) {
  .gc-stats { margin-left: 0; width: 100%; }
  .gc-chip { flex: 1; min-width: 70px; }
  .big { font-size: 1.5rem; }
}
