/* DrunKev site. Look taken from the stream overlay: near-black navy, thin orange frames with corner
   brackets, wide sci-fi headings. The chat column uses Twitch's own dark look so it feels familiar. */
:root {
  --bg: #06090E;
  --panel: #0C1118;
  --panel-2: #121A24;
  --line: #1F2A37;
  --frame: rgba(255, 122, 26, 0.45);
  --text: #E8EDF3;
  --muted: #94A0B0;
  --accent: #FF7A1A;
  --accent-soft: #FFA45C;
  --accent-ink: #120700;
  --win: #5EE08A;
  --loss: #FF7B72;
  --live: #EB0400;
  --souls: #5FF2DC;
  --header-h: 60px;
  --side-w: 340px;
  --display: Orbitron, "Rajdhani", system-ui, sans-serif;
  --label: Rajdhani, Inter, system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, sans-serif;
  overflow: hidden;
}
a { color: var(--accent-soft); }
a:hover { color: #FFC08F; }
button, input, select { font: inherit; }
h1, h2, h3 { margin: 0; font-weight: 700; font-family: var(--display); letter-spacing: 0.06em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------------- header ---------------- */
.topbar {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--frame);
  background: #04070B;
}
.brand {
  font-family: var(--display); font-weight: 800; font-size: 22px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--accent-soft); }
.live-pill {
  font-family: var(--label); font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--live); color: #fff; padding: 1px 10px; border-radius: 4px;
}
.tabs { display: flex; gap: 4px; margin-left: 8px; }
.tabs a {
  font-family: var(--label); font-size: 16px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: 0 14px; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.balance { font-family: var(--label); font-size: 17px; font-weight: 700; color: var(--souls); white-space: nowrap; letter-spacing: 0.04em; }
.balance small { color: var(--muted); font-weight: 600; font-size: 14px; text-transform: uppercase; letter-spacing: 0.1em; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--panel-2); }
.chat-toggle { display: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 6px; border: 0; cursor: pointer;
  font-family: var(--label); font-size: 16px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none;
}
.btn-twitch { background: #9147FF; color: #fff; }
.btn-twitch:hover { background: #A970FF; color: #fff; }
.btn-plain { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-plain:hover { box-shadow: inset 0 0 0 1px var(--accent); color: var(--text); }
.btn-gold { background: var(--accent); color: var(--accent-ink); }
.btn-gold:hover { background: var(--accent-soft); color: var(--accent-ink); }
.btn:disabled { opacity: 0.6; cursor: wait; }

/* ---------------- layout ---------------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--side-w);
  height: calc(100vh - var(--header-h));
}
.main { overflow-y: auto; min-width: 0; }
.view { padding: 28px 32px 48px; }
.view:focus { outline: none; }

/* ---------------- stream ---------------- */
.stage { background: #000; border-bottom: 1px solid var(--frame); }
.player-slot {
  width: min(100%, calc(64vh * 16 / 9));
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}
.player { width: 100%; height: 100%; background: #000; position: relative; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-bar {
  display: flex; justify-content: flex-end; gap: 6px; padding: 6px 12px; background: #04070B;
}
.pbtn {
  font-family: var(--label); font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  background: transparent; color: var(--muted); border: 1px solid var(--line); border-radius: 4px;
  min-height: 36px; padding: 0 12px; cursor: pointer;
}
.pbtn:hover { color: var(--text); border-color: var(--accent); }
.pbtn[aria-pressed="true"] { color: var(--accent); border-color: var(--frame); }

/* Stream and chat hidden (viewer has Twitch open elsewhere): the pages get the whole width. */
.media-toggle { min-height: 36px; padding: 0 12px; font-size: 14px; white-space: nowrap; }
.media-toggle[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--accent); color: var(--accent); }
body.no-media .stage, body.no-media .side, body.no-media .chat-toggle { display: none !important; }
body.no-media .layout { grid-template-columns: minmax(0, 1fr); }
body.no-media .view { max-width: 1320px; margin: 0 auto; }

/* Mini player: the same element pinned to a corner (it is never moved, so the stream doesn't reload). */
.float-bar { display: none; }
.player.floating {
  position: fixed; right: calc(var(--side-w) + 20px); bottom: 20px; z-index: 30;
  width: 400px; height: auto; aspect-ratio: 16 / 9;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px var(--frame);
}
.player.floating .float-bar {
  display: flex; justify-content: space-between; position: absolute; left: 0; right: 0; top: -36px; gap: 6px;
}
.float-btn {
  font-family: var(--label); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  background: #04070B; color: var(--text); border: 1px solid var(--frame); border-radius: 4px;
  min-height: 32px; min-width: 32px; padding: 0 10px; cursor: pointer;
}
.float-btn:hover { color: var(--accent); }

/* ---------------- chat: Twitch's own dark theme ---------------- */
.side { display: flex; flex-direction: column; min-height: 0; background: #18181B; border-left: 1px solid #2F2F35; }
.chat {
  flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative;
  font-family: Inter, Roobert, "Helvetica Neue", Helvetica, Arial, sans-serif; color: #EFEFF1;
}
.chat-head {
  display: flex; justify-content: center; align-items: center; position: relative;
  height: 50px; border-bottom: 1px solid #2F2F35;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: #EFEFF1;
}
.chat-state { position: absolute; right: 12px; font-weight: 400; text-transform: none; letter-spacing: 0; color: #ADADB8; font-size: 12px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 10px 0; overscroll-behavior: contain; }
.msg { padding: 5px 20px; line-height: 20px; overflow-wrap: anywhere; font-size: 13px; }
.msg:hover { background: rgba(83, 83, 95, 0.38); }
.msg.mention { background: rgba(145, 71, 255, 0.22); }
.msg.notice { color: #ADADB8; }
.msg .badge { height: 18px; width: 18px; vertical-align: middle; margin: -3px 3px 0 0; }
.msg .bet-badge { height: 18px; width: 18px; vertical-align: middle; margin: -3px 4px 0 0; }
.msg .name { font-weight: 700; }
.msg.action .text { font-style: italic; }
.emote-wrap { display: inline-grid; vertical-align: middle; margin: -5px 0; }
.emote-wrap > img { grid-area: 1 / 1; place-self: center; }
.emote { height: 28px; width: auto; }
.msg a { color: #BF94FF; }
.chat-more {
  position: absolute; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: #9147FF; color: #fff; border: 0; border-radius: 4px; padding: 6px 14px;
  font-weight: 600; font-size: 13px; cursor: pointer; min-height: 32px;
}
.chat-form { padding: 10px; display: flex; gap: 8px; align-items: center; }
.chat-form input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 10px; border-radius: 4px;
  border: 2px solid #464649; background: #18181B; color: #EFEFF1; font-size: 13px;
}
.chat-form input:hover { border-color: #53535F; }
.chat-form input:focus { border-color: #9147FF; outline: none; }
.chat-form input::placeholder { color: #ADADB8; }
.chat-form .btn { font-family: Inter, sans-serif; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; border-radius: 4px; min-height: 40px; }
.chat-form .btn-plain { background: #9147FF; color: #fff; box-shadow: none; }
.chat-form .btn-plain:hover { background: #772CE8; }
.chat-form .hint { flex: 1; color: #ADADB8; font-size: 13px; }
.chat-error { color: #FF8280; font-size: 13px; padding: 0 20px 8px; }

/* ---------------- pages ---------------- */
.page { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; line-height: 1.1; color: var(--text); text-transform: uppercase; letter-spacing: 0.14em; }
.page-head p { margin: 6px 0 0; color: var(--muted); }
.synced { color: var(--muted); font-size: 13px; }

/* Panels: thin frame with orange corner brackets, like the overlay. */
.card {
  position: relative; background: var(--panel); padding: 22px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.card::before, .card::after {
  content: ""; position: absolute; width: 14px; height: 14px; pointer-events: none;
  border-color: var(--accent); border-style: solid;
}
.card::before { top: 0; left: 0; border-width: 2px 0 0 2px; }
.card::after { bottom: 0; right: 0; border-width: 0 2px 2px 0; }
.card h2 {
  font-family: var(--label); font-size: 20px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 14px;
}
.card-sub { color: var(--muted); margin: -8px 0 14px; font-size: 14px; }
h3.card-sub { font-family: var(--label); font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; margin: 0 0 10px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { background: var(--panel-2); padding: 14px 16px; box-shadow: inset 0 -2px 0 var(--line); }
.stat .label { font-family: var(--label); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.stat .value { font-family: var(--display); font-size: 24px; font-weight: 700; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.pos { color: var(--win); }
.neg { color: var(--loss); }
.souls { color: var(--souls); }

table.data { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
table.data th {
  text-align: left; font-family: var(--label); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--frame);
}
table.data td { padding: 9px 8px; border-bottom: 1px solid var(--line); }
table.data tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; }
table.data th.num { text-align: right; }
.rank { color: var(--muted); width: 28px; }
.table-scroll { overflow-x: auto; }
.player-link { color: var(--text); text-decoration: none; font-weight: 600; }
.player-link:hover { color: var(--accent-soft); text-decoration: underline; }

.seg { display: inline-flex; gap: 2px; box-shadow: inset 0 0 0 1px var(--line); padding: 3px; }
.seg button {
  border: 0; background: transparent; color: var(--muted);
  font-family: var(--label); font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0 14px; min-height: 38px; cursor: pointer;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.badge-card { display: flex; gap: 12px; align-items: center; background: var(--panel-2); padding: 12px; }
.badge-card img { width: 44px; height: 44px; flex-shrink: 0; }
.badge-card .t { font-family: var(--label); font-size: 17px; font-weight: 700; letter-spacing: 0.06em; }
.badge-card .d { color: var(--muted); font-size: 13px; }
.badge-card .h { font-size: 14px; margin-top: 2px; }
.my-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.my-badges span { display: inline-flex; align-items: center; gap: 6px; background: var(--panel-2); padding: 4px 12px 4px 6px; font-weight: 600; }
.my-badges img { width: 26px; height: 26px; }

.phrase { font-size: 18px; font-style: italic; color: var(--accent-soft); }
.empty { color: var(--muted); }
.lookup { display: flex; gap: 8px; }
.lookup .btn { white-space: nowrap; }
.lookup input {
  min-height: 44px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); width: 220px;
}
.lookup input:focus { border-color: var(--accent); outline: none; }
.lookup label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.hero { display: flex; gap: 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.hero h1 { font-size: 44px; color: var(--text); line-height: 1; text-transform: uppercase; letter-spacing: 0.2em; }
.hero p { color: var(--accent); margin: 10px 0 0; max-width: 560px; font-family: var(--label); font-size: 18px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.round { display: flex; flex-direction: column; gap: 10px; }
.round .status { font-weight: 700; }
.round .open { color: var(--win); }
.coming { display: flex; gap: 16px; align-items: center; }
.coming img { width: 64px; height: 64px; }
.coming h2 { margin-bottom: 4px; }

/* ---------------- bet forms ---------------- */
.bet-card { box-shadow: inset 0 0 0 1px var(--frame); }
.timer { font-family: var(--display); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.action-form { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-family: var(--label); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.field-hint { font-size: 12px; color: var(--muted); }
.field input[type=number], .field input[type=text], .field select {
  min-height: 44px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); width: 160px;
}
.field input:focus, .field select:focus { border-color: var(--accent); outline: none; }
.field input[type=text] { width: min(420px, 100%); }
.field select { width: 260px; }
.chips { display: flex; gap: 6px; align-self: center; }
.chip {
  min-height: 44px; padding: 0 12px; border-radius: 4px; border: 1px solid var(--line);
  background: transparent; color: var(--text); cursor: pointer;
  font-family: var(--label); font-size: 15px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.chip:hover { border-color: var(--accent); }
.choice { display: flex; gap: 6px; flex-wrap: wrap; }
.choice-item { position: relative; }
.choice-item input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice-item span {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 14px;
  border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line);
  font-family: var(--label); font-size: 16px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.choice-item small { color: var(--muted); font-weight: 600; }
.choice-item input:checked + span { border-color: var(--accent); background: #2A1606; color: var(--accent-soft); }
.choice-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Click-to-bet: big buttons for every choice. */
.bet-step { margin-top: 16px; }
.bet-step:first-of-type { margin-top: 4px; }
.step-label { display: block; margin-bottom: 8px; font-family: var(--label); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tiles-num { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; }
.tile {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; min-width: 52px; padding: 6px 16px; border-radius: 4px; cursor: pointer;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  font-family: var(--label); font-size: 18px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.tiles-num .tile { padding: 6px 0; }
.tile:hover:not(:disabled) { border-color: var(--accent); }
.tile[aria-pressed="true"] { border-color: var(--accent); background: #2A1606; color: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.tile:disabled { opacity: 0.35; cursor: not-allowed; }
.tile-sub { font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: 0.04em; text-transform: none; }
.tile[aria-pressed="true"] .tile-sub { color: var(--accent-soft); }
.tile-big { min-width: 140px; min-height: 64px; font-size: 20px; }
.tile.win[aria-pressed="true"] { border-color: var(--win); background: #0D2617; color: var(--win); box-shadow: 0 0 0 1px var(--win); }
.tile.loss[aria-pressed="true"] { border-color: var(--loss); background: #2B1112; color: var(--loss); box-shadow: 0 0 0 1px var(--loss); }
.tile-champ { min-width: 150px; align-items: flex-start; text-align: left; }
.team-label { width: 100%; font-family: var(--label); font-size: 13px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }
.other-num { display: flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 14px; }
.amount { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.stepper button { width: 44px; min-height: 52px; border: 0; background: var(--panel-2); color: var(--text); font-size: 22px; font-weight: 700; cursor: pointer; }
.stepper button:hover { color: var(--accent); }
.stepper input, .other-num input {
  width: 110px; min-height: 52px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line);
  background: var(--bg); color: var(--text); text-align: center; font-family: var(--label); font-size: 20px; font-weight: 700;
}
.other-num input { width: 80px; min-height: 44px; border: 1px solid var(--line); border-radius: 4px; font-size: 17px; }
.stepper input:focus, .other-num input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.amount .tile { min-height: 52px; font-size: 16px; padding: 6px 14px; }
.bet-go { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.bet-go .btn { min-height: 56px; padding: 0 28px; font-size: 18px; }
.bet-go .btn:disabled { cursor: not-allowed; }
.my-bet { margin: 4px 0 0; font-size: 17px; }
.my-bet strong { color: var(--accent-soft); }
.action-note { margin: 10px 0 0; min-height: 1.5em; color: var(--muted); }
.action-note.ok { color: var(--win); }
.action-note.bad { color: var(--loss); }
.markets { display: flex; flex-direction: column; gap: 18px; }
.market { border-top: 1px solid var(--line); padding-top: 14px; }
.market:first-child { border-top: 0; padding-top: 0; }
.market-title { font-family: var(--label); font-weight: 700; font-size: 17px; letter-spacing: 0.06em; margin-bottom: 10px; }

/* ---------------- phone / small screens ---------------- */
@media (max-width: 1000px) {
  body { overflow: auto; }
  .topbar { height: auto; flex-wrap: wrap; padding: 10px 16px; gap: 10px; }
  .tabs { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .layout { display: block; height: auto; }
  .main { overflow: visible; }
  .player-slot { width: 100%; }
  #btn-mini { display: none; }
  .view { padding: 20px 16px 96px; }
  .side { display: none; }
  body.chat-open .side {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: 65vh; z-index: 20;
    border-top: 2px solid #9147FF; border-left: 0;
  }
  .chat-toggle {
    display: inline-flex; position: fixed; right: 16px; bottom: 16px; z-index: 21;
    background: #9147FF; color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
  }
  body.chat-open .chat-toggle { bottom: calc(65vh + 12px); }
  .grid-2, .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-head h1 { font-size: 24px; }
  .hero h1 { font-size: 30px; }
  .lookup input { width: 100%; }
  .lookup { width: 100%; }
  .field input[type=number], .field select { width: 100%; }
  .field { flex: 1 1 140px; }
}

/* Fullscreen fills the screen even if it started from the mini player. */
.player:fullscreen { position: static; width: 100%; height: 100%; aspect-ratio: auto; }
.player:fullscreen .float-bar { display: none; }
