/* ============================================================
   HYDRA — v0.4 "Vertical Tanks"
   Deep charcoal, faint silver lines, red accent.
   ============================================================ */
:root{
  --bg: #0B0D12;
  --panel: rgba(255,255,255,0.02);
  --line: rgba(226,232,240,0.10);
  --text: #E8EAF0;
  --dim: #8B92A5;
  --red: #E23B3B;
  --red-deep: #B3222A;
  --silver: #C9CFDD;
  --gold: #D9A62E;
  --ok: #4ade80;
}

*{ margin:0; padding:0; box-sizing:border-box; }
html,body{ min-height:100%; background: var(--bg); overflow-x: hidden; max-width: 100%; }
body{
  background: radial-gradient(1200px 800px at 50% 20%, #10131B 0%, var(--bg) 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding: 0 16px 14px;
  max-width: 1140px;
  margin: 0 auto;
}

.panel{
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
}

/* ===== Header ===== */
.header{
  display:flex; align-items:center; justify-content:space-between;
  padding: 4px 14px;
  margin: 0 -16px 6px;
  border-radius: 0;
  border-left: none; border-right: none; border-top: none;
}
.brand{ display:flex; align-items:center; gap:12px; }
.brand-logo{ height: 29px; }
.brand-sign{ height: 23px; }
.brand-text{ font-weight:800; letter-spacing:.3em; font-size:26px; }
.header-right{ display:flex; align-items:center; gap:16px; position:relative; }
.wallet{ font-weight:700; font-size:14px; color: var(--silver); letter-spacing:.02em; font-variant-numeric: tabular-nums; }
.burger{
  width:30px; height:24px; background:none; border:1px solid var(--line); border-radius:8px;
  display:flex; flex-direction:column; justify-content:center; gap:4px; align-items:center; cursor:pointer;
}
.burger span{ display:block; width:16px; height:2px; background:var(--dim); border-radius:2px; }

/* ===== Scene ===== */
.scene{ padding: 14px 16px; }
.stage{
  display:grid;
  grid-template-columns: 1fr 1fr;   /* the 50/50 rule: wheel half + tanks half */
  gap: 18px;
  align-items: stretch;
}

/* Wheel */
.wheel-wrap{ position:relative; width:100%; max-width:440px; margin:0 auto; }
#wheel{ width:100%; display:block; filter: drop-shadow(0 10px 30px rgba(0,0,0,.5)); }
#wheel .disc{ transform-origin: 200px 200px; }

.hub{
  position:absolute; left:50%; top:50%; transform:translate(-50%,-50%);
  width: 31%; aspect-ratio: 1/1; border-radius:50%;
  background: radial-gradient(circle at 35% 30%, #171B25, #0B0D12 70%);
  border: 1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  overflow:hidden;
}
.hub-logo{ width:84%; opacity:.9; transition: opacity .4s; }
.hub.dimmed .hub-logo{ opacity:.16; }
.hub-overlay{
  position:absolute; inset:0; display:flex; flex-direction:column;
  align-items:center; justify-content:center; gap:2px;
  opacity:0; transition: opacity .4s;
}
.hub.dimmed .hub-overlay{ opacity:1; }
.hub-label{ font-size:10px; letter-spacing:.22em; color:var(--dim); }
.hub-value{ font-size:30px; font-weight:800; color:var(--text); font-variant-numeric: tabular-nums; }
.hub-value.word{ font-size:15px; letter-spacing:.2em; }
.hub-value.result-red{ color: var(--red); }
.hub-value.result-black{ color: var(--silver); }
.hub-value.result-bankrupt{ color: var(--gold); }
.hub-sub{ min-height:18px; font-size:15px; font-weight:800; font-variant-numeric: tabular-nums; }
.hub-sub.result-red{ color: var(--red); }
.hub-sub.result-black{ color: var(--silver); }

.pointer{
  position:absolute; right:-6px; top:50%; transform:translateY(-50%);
  width:0; height:0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-right: 22px solid var(--silver);
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.6));
}

/* Right column: vertical tanks, full height */
.right-col{
  display:flex; flex-direction:column;
  min-height: 0;
}

/* Mini hydra in the header — takes the winner's color */
.mini-hydra{
  height: 38px;
  filter: drop-shadow(0 0 5px rgba(201,207,221,.45)) drop-shadow(0 4px 10px rgba(0,0,0,.5));
}
.mini-hydra.pop{ animation: hydraPop .55s ease; }
@keyframes hydraPop{
  0%{ transform: scale(1); }
  40%{ transform: scale(1.3) rotate(-4deg); }
  100%{ transform: scale(1); }
}

/* Vertical tanks */
.vtanks{
  flex:1;
  display:grid; grid-template-columns: 1fr 1fr; gap:14px;
  align-items:stretch;
  min-height: 340px;
  width:100%; max-width: 400px; margin: 0;
}
.vtank{ display:flex; flex-direction:column; gap:8px; }
.vt-label{
  text-align:center; font-size:19px; font-weight:700; font-variant-numeric: tabular-nums;
  display:flex; justify-content:center; gap:7px;
  white-space:nowrap;
}
.vt-label.black{ color: var(--silver); }
.vt-label.red{ color: var(--red); }
.vt-label b{ font-weight:600; opacity:.75; }

.vessel{
  position:relative; flex:1;
  border:1px solid var(--line);
  border-radius:14px;
  background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.01));
  box-shadow: inset 0 6px 18px rgba(0,0,0,.45);
  overflow:hidden;
  min-height: 190px;
}
.liquid{
  position:absolute; left:0; right:0; bottom:0;
  height: 50%;
  min-height: 3px;
  transition: height 1.1s cubic-bezier(.22,.9,.35,1);
}
.liquid.black{
  background: linear-gradient(180deg, #2E3546, #191D27);
  border-top: 1px solid rgba(201,207,221,.4);
  box-shadow: inset 0 0 14px rgba(201,207,221,.2);
}
.liquid.red{
  background: linear-gradient(180deg, var(--red), #8E1B21);
  border-top: 1px solid rgba(255,255,255,.4);
}
.liquid::after{
  content:""; position:absolute; inset:0;
  background: linear-gradient(0deg, transparent, rgba(255,255,255,.12), transparent);
  transform: translateY(100%);
}
.liquid.flow::after{ animation: rise 1.2s ease; }
@keyframes rise{ to{ transform: translateY(-100%); } }

/* ===== Buttons panel ===== */
.buttons{ margin-top:10px; padding: 14px; position:relative; overflow:hidden; }
.bet-row{
  display:grid;
  grid-template-columns: 1fr minmax(180px, 240px) 1fr;
  gap: 12px;
  align-items: stretch;
}
.bet-btn{
  border:1px solid var(--line);
  border-radius: 14px;
  cursor:pointer;
  display:flex; flex-direction:column; align-items:center; justify-content:center; gap:2px;
  padding: 12px 8px;
  transition: transform .08s ease, filter .2s;
  color:#fff;
}
.bet-btn:active{ transform: scale(.98); }
.bet-btn .bet-word{ font-weight:800; letter-spacing:.24em; font-size:15px; }
.bet-btn .bet-amt{ font-size:13px; opacity:.85; font-variant-numeric: tabular-nums; }
.bet-btn.black{
  background: linear-gradient(180deg, #2A3040, #171B25);
  box-shadow: inset 0 0 12px rgba(201,207,221,.14);
  color: var(--silver);
}
.bet-btn.red{ background: linear-gradient(180deg, var(--red), var(--red-deep)); }
.bet-btn:hover{ filter: brightness(1.12); }

.amount-col{ display:flex; flex-direction:column; gap:8px; }
.amount-box{
  display:flex; align-items:stretch;
  border:1px solid var(--line); border-radius:12px; overflow:hidden;
  background:#0E1118;
}
.amount-box button{
  width:44px; background:none; border:none; color:var(--silver);
  font-size:20px; cursor:pointer;
}
.amount-box button:hover{ background: rgba(255,255,255,.05); }
.amount-box input{
  flex:1; min-width:0; background:none; border:none; outline:none;
  color:var(--text); text-align:center; font-size:18px; font-weight:700;
  font-variant-numeric: tabular-nums;
}
.amount-box input.bad{ color: var(--red); }

.chips{ display:grid; grid-template-columns: repeat(4, 1fr); gap:8px; }
.chips button{
  border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.03);
  color:var(--dim); padding:7px 0; cursor:pointer; font-weight:600;
}
.chips button:hover{ color:var(--text); background:rgba(255,255,255,.07); }

.cashout{
  margin-top:12px; width:100%;
  display:flex; align-items:center; justify-content:space-between;
  padding: 13px 20px;
  border:none; border-radius:14px; cursor:pointer;
  background: linear-gradient(180deg, #F08A2E, #D96F14);
  color:#1A1005; font-weight:800;
  box-shadow: 0 10px 26px rgba(240,138,46,.25);
  transition: filter .2s, transform .08s;
}
.cashout:hover{ filter: brightness(1.08); }
.cashout:active{ transform: scale(.995); }
.cashout #posValue{ font-size:18px; font-variant-numeric: tabular-nums; }
.cashout .co-label{ letter-spacing:.2em; font-size:15px; }

button:disabled{
  opacity:.4; cursor:not-allowed; filter:none !important; transform:none !important;
}

/* ===== Info strip ===== */
.infostrip{
  margin-top:10px;
  padding: 9px 14px;
  display:flex; align-items:center; gap:12px;
  min-height: 42px;
}
#feed{ list-style:none; flex:1; overflow:hidden; }
#feed li{
  font-size:13px; color:var(--dim);
  line-height:1.5;
  animation: fadein .4s ease;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#feed li.bankrupt{ color: var(--gold); }
#feed li.system{ color: var(--silver); }
#feed li.you{ color: var(--silver); }
#feed li.cash{ color: #E8B75A; }
@keyframes fadein{ from{ opacity:0; transform:translateY(4px);} to{ opacity:1; transform:none;} }
.online-badge{
  font-size:11px; letter-spacing:.14em; color:var(--dim);
  border:1px solid var(--line); border-radius:8px; padding:5px 10px;
  white-space:nowrap;
}
.online-badge b{ color: var(--ok); }

.foot{
  text-align:center; margin-top: 12px;
  font-size:11px; letter-spacing:.18em; color: rgba(139,146,165,.45);
}

/* ===== Mobile: compact ===== */
@media (max-width: 720px){
  body{ padding: 8px; }
  .header{ padding: 8px 12px; margin-bottom:8px; }
  .brand-logo{ height: 26px; }
  .brand-sign{ height: 18px; }
  .brand-text{ font-size:20px; }
  .wallet{ font-size:15px; }

  .scene{ padding: 4px 8px; }
  .wheel-wrap{ padding: 0; }
  .stage{
    grid-template-columns: minmax(0, 1.4fr) minmax(116px, 1fr);
    gap: 10px;
    align-items: center;
  }
  .hub{ width: 38%; }
  .hub-overlay{ gap:0; }
  .hub-value{ font-size:18px; }
  .hub-value.word{ font-size:10px; letter-spacing:.16em; }
  .hub-label{ font-size:7px; letter-spacing:.14em; }
  .hub-sub{ font-size:11px; min-height:12px; }
  #wheel text{ font-size: 20px; }

  .mini-hydra{ height: 32px; }
  .right-col{ height:100%; }
  .vtanks{ min-height: 200px; gap:8px; max-width:none; margin:0; height:100%; }
  .vessel{ min-height: 165px; }
  .vt-label{
    font-size:13px; gap:2px;
    flex-direction: column; align-items:center; line-height:1.15;
  }
  .vt-label b{ font-size:11px; }

  .buttons{ padding: 12px; margin-top:8px; }
  .bet-row{ grid-template-columns: 1fr 1fr; gap:10px; }
  .amount-col{ grid-column: 1 / -1; order:-1; }
  .cashout{ margin-top:10px; padding: 12px 16px; }

  .infostrip{ margin-top:8px; }
  #feed li{ font-size:12px; }
  .foot{ margin-top:10px; }
}

@media (prefers-reduced-motion: reduce){
  .mini-hydra.pop{ animation:none; }
  .liquid{ transition:none; }
}


/* ============================================================
   v0.6 — Positions & History drawer
   ============================================================ */
.poshist-toggle{
  margin-top:10px; width:100%;
  padding: 11px 16px;
  background: rgba(255,255,255,.03);
  border:1px solid var(--line); border-radius:12px;
  color: var(--dim); font-weight:700; letter-spacing:.16em; font-size:12px;
  cursor:pointer; transition: color .2s, background .2s;
}
.poshist-toggle:hover{ color:var(--text); background: rgba(255,255,255,.06); }
.poshist-toggle b{ color: var(--silver); }

.layout{ display:block; }

.pospanel{
  background: #0D1017;
  display:flex; flex-direction:column;
  animation: drawerIn .22s ease;
}
@keyframes drawerIn{ from{ opacity:0; transform: translateY(8px);} to{ opacity:1; transform:none;} }

/* Rail: permanent from 1001px up (tablet-wide keeps it too) */
@media (min-width: 1001px){
  .layout{
    display:grid;
    grid-template-columns: minmax(0,1fr) 320px;
    gap: 12px;
    align-items: stretch;
  }
  .pospanel{
    display:flex !important;
    min-height: 0;          /* v0.50 — the panel may not inflate the grid row… */
    overflow: hidden;       /* …so a full positions list scrolls INSIDE, like the lobby */
  }
  .pospanel .drawer-x{ display:none; }
  .poshist-toggle{ display:none; }
}

/* Tablet-wide with rail (1001-1180px): tanks narrow so the wheel keeps its space */
@media (min-width: 1001px) and (max-width: 1180px){
  .stage{ gap: 14px; }
  .vtanks{ max-width: 280px; min-height: 300px; }
  .vt-label{ font-size: 15px; }
}

@media (min-width: 1001px){
  body{ min-height: 100vh; display:flex; flex-direction:column; }
  .layout{ flex:1; grid-template-rows: 1fr auto auto; }   /* content row absorbs all leftover height */
  .wheel-wrap{ align-self: center; }   /* wrap = disc height, so hub & pointer sit dead center */
  .main-col{ display:flex; flex-direction:column; }
  .scene{ flex:1; display:flex; flex-direction:column; }
  .stage{ flex:1; }
  .foot{ margin-top: 4px; }
}

/* Desktop (>=1181px): full-bleed like Aviator */
@media (min-width: 1181px){
  body{ max-width: none; padding: 0 24px 18px; }
  .header{ margin: 0 -24px 8px; }
  .layout{ grid-template-columns: minmax(0,1fr) 400px; }
  .stage{ gap: 28px; }
  .wheel-wrap{
    max-width: min(100%, max(420px, calc(100vh - 460px)));
  }
  .vtanks{ max-width: 940px; }
  .vt-label{ font-size: 22px; }
}

/* Narrow: bottom sheet, toggled */
@media (max-width: 1000px){
  .pospanel{
    position: fixed; left:8px; right:8px; bottom:8px;
    height: 54.5vh; max-height: 54.5vh; min-height: 250px;
    z-index: 50;
    border-radius: 16px;
    box-shadow: 0 -14px 50px rgba(0,0,0,.6);
  }
  .pospanel::before{
    content:""; display:block;
    width:44px; height:4px; border-radius:4px;
    background: rgba(226,232,240,.18);
    margin: 8px auto 0;
  }
  .pospanel.hidden{ display:none; }
}

.drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 12px; border-bottom: 1px solid var(--line);
}
.tabs{ display:flex; gap:8px; }
.tab{
  background:none; border:1px solid transparent; border-radius:9px;
  color: var(--dim); font-weight:700; letter-spacing:.14em; font-size:12px;
  padding: 7px 12px; cursor:pointer;
}
.tab.active{ color: var(--text); border-color: var(--line); background: rgba(255,255,255,.04); }
.drawer-x{
  background:none; border:none; color:var(--dim); font-size:18px; cursor:pointer;
  width:34px; height:34px; border-radius:9px;
}
.drawer-x:hover{ color:var(--text); background: rgba(255,255,255,.06); }

.plist{
  list-style:none; flex:1; min-height:0; overflow-y:auto; padding: 8px 12px;
  display:flex; flex-direction:column; gap:8px;
}
.plist.hidden{ display:none; }
.plist::-webkit-scrollbar{ width:8px; }
.plist::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.08); border-radius:8px; }

.prow{
  display:flex; flex-direction:column; gap:8px;
  border:1px solid var(--line); border-radius:12px;
  border-left-width: 4px;
  padding: 11px 12px;
  font-size:14px; font-variant-numeric: tabular-nums;
}
.prow.side-red{ border-left-color: var(--red); }
.prow.side-black{ border-left-color: #97A2B8; }
.prow-top{ display:flex; align-items:center; gap:10px; }
.prow .rnd{ margin-left:auto; color:var(--dim); }
.prow-top .pnl{ font-size:13px; white-space:nowrap; }
.prow.up{ animation: flashUp 1s ease; }
.prow.down{ animation: flashDown 1s ease; }
@keyframes flashUp{ from{ background: rgba(74,222,128,.16);} to{ background: transparent;} }
@keyframes flashDown{ from{ background: rgba(226,59,59,.16);} to{ background: transparent;} }
.side-txt{
  font-size:12px; font-weight:800; letter-spacing:.12em;
  min-width:48px;
}
.side-txt.black{ color: var(--silver); }
.side-txt.red{ color: var(--red); }
.prow .pmid{ flex:1; color:var(--text); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.prow .pmid small{ color: var(--dim); }
.pnl.up{ color: var(--ok); }
.pnl.down{ color: var(--red); }
.mini-cash{
  border:none; border-radius:10px; cursor:pointer;
  background: linear-gradient(180deg, #F08A2E, #D96F14);
  color:#1A1005; font-weight:800; font-size:13px; letter-spacing:.08em;
  padding: 10px 12px; white-space:nowrap;
  width:100%;
  font-variant-numeric: tabular-nums;
}
.mini-cash:hover{ filter: brightness(1.08); }
.plist .empty{
  border:1px dashed var(--line); border-radius:11px;
  color: var(--dim); text-align:center; padding: 18px 12px; font-size:13px;
}

/* ============================================================
   v0.14 — Admin panel
   ============================================================ */
.admin-body{ max-width: 760px; }
.admin-title{ font-weight:800; letter-spacing:.3em; font-size:18px; color:var(--silver); }
.admin-back{ color:var(--dim); text-decoration:none; font-size:14px; }
.admin-back:hover{ color:var(--text); }
.hidden{ display:none; }

.acard{ padding: 16px 18px; margin-top: 12px; }
.acard h3{ font-size:14px; letter-spacing:.12em; color:var(--silver); margin-bottom: 12px; }
.acard.dim{ opacity:.6; }

.arow{ display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-top:10px; }
.arow:first-of-type{ margin-top:0; }
.arow label{ display:flex; align-items:center; gap:8px; color:var(--dim); font-size:14px; }

.arow input[type="number"], .arow input[type="text"], .arow input[type="password"], .arow select{
  background:#0E1118; border:1px solid var(--line); border-radius:10px;
  color:var(--text); padding: 9px 12px; font-size:15px; outline:none;
  font-variant-numeric: tabular-nums;
}
.arow input[type="number"]{ width: 76px; }
.arow input[type="text"], .arow input[type="password"]{ flex:1; min-width:200px; }

.abtn{
  border:1px solid var(--line); border-radius:10px; cursor:pointer;
  background: rgba(255,255,255,.05); color:var(--text);
  font-weight:800; letter-spacing:.08em; font-size:13px;
  padding: 10px 16px;
}
.abtn:hover{ background: rgba(255,255,255,.1); }
.abtn.ok{ background: rgba(74,222,128,.12); border-color: rgba(74,222,128,.3); }
.abtn.warn{ background: rgba(240,138,46,.12); border-color: rgba(240,138,46,.35); }

.stats{ display:grid; grid-template-columns: repeat(4, 1fr); gap:10px; }
.stat{
  border:1px solid var(--line); border-radius:11px; padding:10px 12px;
  display:flex; flex-direction:column; gap:4px;
}
.stat span{ font-size:11px; letter-spacing:.1em; color:var(--dim); }
.stat b{ font-size:16px; font-variant-numeric: tabular-nums; }
@media (max-width: 640px){ .stats{ grid-template-columns: repeat(2,1fr); } }

.chk{ display:flex; align-items:center; gap:8px; color:var(--text) !important; }
.chk input{ width:18px; height:18px; accent-color: var(--red); }


/* ============================================================
   v0.16 — Menu + rules modal
   ============================================================ */
.menu{
  position:absolute; top: calc(100% + 10px); right: 0;
  min-width: 250px;
  background: #0D1017;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  z-index: 70;
  overflow:hidden;
  animation: drawerIn .18s ease;
}
.menu.hidden{ display:none; }
.mitem{
  width:100%;
  display:flex; align-items:center; justify-content:space-between; gap:16px;
  background:none; border:none; cursor:pointer;
  padding: 14px 16px;
  color: var(--text); font-size:14px; font-weight:600; letter-spacing:.03em;
  border-bottom: 1px solid var(--line);
}
.mitem:last-child{ border-bottom:none; }
.mitem:hover{ background: rgba(255,255,255,.05); }
.mitem:disabled{ opacity:.4; cursor:not-allowed; }
.mstate{
  font-size:11px; font-weight:800; letter-spacing:.14em;
  color: var(--dim);
}
.mstate.on{ color: var(--ok); }

.modal{
  position:fixed; inset:0; z-index: 90;
  background: rgba(5,7,11,.72);
  display:flex; align-items:center; justify-content:center;
  padding: 18px;
}
.modal.hidden{ display:none; }
.modal-card{
  width: min(480px, 100%);
  background: #0D1017;
  animation: drawerIn .2s ease;
}
.modal-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.modal-head h3{ font-size:14px; letter-spacing:.16em; color:var(--silver); }
.modal .drawer-x{ display:block; }
.rules-body{ padding: 16px 18px 20px; }
.rules-body p{ color: var(--dim); font-size:14px; line-height:1.65; margin-bottom: 12px; }
.rules-body b.rb{ color: var(--silver); }
.rules-body b.rr{ color: var(--red); }
.rules-note{ font-size:12.5px !important; opacity:.8; border-top:1px solid var(--line); padding-top:12px; }


/* ============================================================
   v0.21 — Solo mode
   ============================================================ */
.spinbtn{
  margin-top:12px; width:100%;
  padding: 15px 20px;
  border:none; border-radius:14px; cursor:pointer;
  background: linear-gradient(90deg, #2A3040 0%, #171B25 48%, var(--red-deep) 52%, var(--red) 100%);
  color:#fff; font-weight:800; letter-spacing:.34em; font-size:17px;
  box-shadow: 0 12px 30px rgba(226,59,59,.22);
  transition: filter .2s, transform .08s;
}
.spinbtn:hover{ filter: brightness(1.15); }
.spinbtn:active{ transform: scale(.995); }
.spinbtn.hidden{ display:none; }

.mode-chip{
  border:1px solid var(--line); border-radius:8px;
  background: rgba(255,255,255,.03);
  color: var(--silver); font-size:11px; font-weight:800; letter-spacing:.1em;
  padding: 6px 10px; cursor:pointer; white-space:nowrap;
}
.mode-chip:hover{ background: rgba(255,255,255,.07); color:var(--text); }


/* ============================================================
   v0.22 — Mode bar
   ============================================================ */
.modebar{
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding: 3px 12px;
  margin-bottom: 6px;
}
.lastspins{ display:flex; align-items:center; gap:7px; overflow:hidden; }
.ls-cap{ font-size:9px; letter-spacing:.18em; color:var(--dim); white-space:nowrap; }
#lastSpins{ display:flex; gap:6px; }
.ls-chip{
  font-size:10px; font-weight:800; font-variant-numeric: tabular-nums;
  border-radius:6px; padding:2px 6px; white-space:nowrap;
}
.ls-chip.red{ background: rgba(226,59,59,.16); color: var(--red); }
.ls-chip.black{ background: rgba(201,207,221,.1); color: var(--silver); }
.ls-chip.bankrupt{ background: rgba(217,166,46,.14); color: var(--gold); }

.mode-link{
  border:none; background:none;
  color: var(--silver); font-weight:800; letter-spacing:.14em; font-size:12.5px;
  padding: 5px 4px; cursor:pointer; white-space:nowrap;
  transition: color .2s;
}
.mode-link:hover{ color: #fff; }

@media (max-width: 720px){
  .modebar{ padding: 7px 10px; margin-bottom: 6px; }
  .mode-link{ font-size:10.5px; padding: 4px 2px; letter-spacing:.08em; }
  .ls-chip:nth-child(n+6){ display:none; }
}


/* ============================================================
   v0.23 — Wheel builder
   ============================================================ */
.builder-chip{
  position:absolute; top: 2px; left: 2px; z-index: 12;
  border:1px solid var(--line); border-radius:9px;
  background: rgba(13,16,23,.85);
  color: var(--silver); font-weight:800; letter-spacing:.14em; font-size:10.5px;
  padding: 6px 10px; cursor:pointer;
  transition: color .2s, border-color .2s;
}
.builder-chip:hover{ color:#fff; }
.builder-chip.hidden{ display:none; }
/* v0.53 — MY WHEEL and DEFAULT WHEEL are twins: same white style, same left edge */

.builder-card{ width: min(560px, 100%); }
.builder-body{ padding: 14px 16px 16px; }

.picked-row{
  display:flex; flex-wrap:wrap; gap:7px;
  min-height: 40px;
  border:1px dashed var(--line); border-radius:11px;
  padding: 7px;
  margin-bottom: 12px;
}
.pick{
  display:flex; align-items:center; gap:5px;
  background: rgba(226,59,59,.14); color: var(--text);
  border-radius:8px; padding: 4px 6px 4px 9px;
  font-weight:800; font-size:13px; font-variant-numeric: tabular-nums;
  animation: drawerIn .18s ease;
}
.pick button{
  background:none; border:none; color: var(--dim); cursor:pointer;
  font-size:12px; padding:2px;
}
.pick button:hover{ color: var(--red); }

.builder-mid{ display:flex; gap:14px; }
.tiles{
  flex:1;
  display:grid; grid-template-columns: repeat(5, 1fr); gap:7px;
  align-content:start;
}
.tiles button{
  border:1px solid var(--line); border-radius:9px;
  background: rgba(255,255,255,.03); color: var(--text);
  font-weight:800; font-size:13px; padding: 9px 0; cursor:pointer;
  font-variant-numeric: tabular-nums;
  transition: background .15s, transform .08s;
}
.tiles button:hover{ background: rgba(226,59,59,.16); }
.tiles button:active{ transform: scale(.94); }
.tiles.full button{ opacity:.35; pointer-events:none; }

.mini-wrap{ width: 150px; text-align:center; }
#miniWheel{ width:150px; height:150px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }
.mini-cap{ margin-top:8px; font-size:10.5px; letter-spacing:.08em; color:var(--dim); }

.builder-foot{
  display:flex; justify-content:space-between; gap:10px;
  margin-top: 14px;
}
#builderOk{ flex:1; }

@media (max-width: 560px){
  .builder-mid{ flex-direction:column; align-items:center; }
  .tiles{ width:100%; grid-template-columns: repeat(5, 1fr); }
}

.builder-lock{
  border:1px solid rgba(217,166,46,.4); border-radius:10px;
  background: rgba(217,166,46,.08); color: var(--gold);
  font-size:12.5px; padding: 9px 12px; margin-bottom: 12px;
}
.builder-lock.hidden{ display:none; }
.tiles.locked button{ opacity:.3; pointer-events:none; }


/* Big builder on desktop */
@media (min-width: 1001px){
  .builder-card{ width: min(94vw, 1400px); max-height: 92vh; overflow:auto; }
  .builder-body{ padding: 26px 30px 30px; }
  .tiles{ gap:12px; }
  .tiles button{ font-size:21px; padding: 24px 0; border-radius:13px; }
  .mini-wrap{ width: 340px; }
  #miniWheel, #aMiniWheel{ width: 340px; height: 340px; }
  .mini-cap{ font-size:14px; margin-top:12px; }
  .pick{ font-size:17px; padding: 8px 10px 8px 13px; }
  .picked-row{ min-height:54px; }
  .builder-foot .abtn{ font-size:16px; padding: 15px 22px; }
}
#aMiniWheel{ width:150px; height:150px; filter: drop-shadow(0 6px 16px rgba(0,0,0,.5)); }


/* ============================================================
   v0.34 — Live lobby: ALL BETS + TOP
   ============================================================ */
.lobby{
  background:#0D1017;
  display:flex; flex-direction:column;
  min-height:0;
  margin-top:12px;               /* mobile flow: sits under the info strip */
}
.lobby-head{
  display:flex; align-items:center; justify-content:space-between;
  padding: 8px 10px; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.llist{ padding: 8px 10px; gap: 6px; max-height: 300px; }
.lrow{
  display:flex; align-items:center; gap:8px;
  border:1px solid var(--line); border-radius:11px;
  padding: 7px 10px;
  font-size:13px; font-variant-numeric: tabular-nums;
}
.lrow.you{ background: rgba(255,255,255,.055); border-color: rgba(226,232,240,0.22); }
.lwho{ font-weight:800; letter-spacing:.05em; color: var(--text); flex:0 0 auto; }
.lmid{ color: var(--dim); flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.lmid b{ color: var(--text); font-weight:700; }
.lchip{
  flex:0 0 auto;
  font-size:10px; font-weight:800; letter-spacing:.12em;
  padding: 3px 7px; border-radius: 7px;
}
.lchip.red{ background: rgba(194,39,48,.20); color:#FF8A93; }
.lchip.black{ background: #1B202B; color:#C9CFDD; border:1px solid var(--line); }
.lpnl{ flex:0 0 auto; font-weight:800; }
.lpnl.up{ color: var(--ok); }
.lpnl.down{ color: var(--red); }
.lrank{ flex:0 0 auto; color: var(--dim); font-weight:800; min-width:18px; text-align:right; }
.lsub{ font-size:12px; }
body.solo .lobby{ display:none; }

/* mid desktop (2 columns): lobby spans full width under the table */
@media (min-width: 1001px) and (max-width: 1479px){
  .lobby{ grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .layout > .foot{ grid-column: 1 / -1; grid-row: 3; }
  body.solo .layout > .foot{ grid-row: 2; }
  .llist{ max-height: 240px; }
}

/* wide desktop (3 columns): lobby is the left rail */
@media (min-width: 1480px){
  .layout{ grid-template-columns: 360px minmax(0,1fr) 360px; grid-template-rows: 1fr auto; }
  .lobby{ grid-column: 1; grid-row: 1; margin-top: 0; }
  .main-col{ grid-column: 2; grid-row: 1; }
  .pospanel{ grid-column: 3; grid-row: 1; }
  .layout > .foot{ grid-column: 1 / -1; grid-row: 2; }
  .llist{ max-height: none; }
  body.solo .layout{ grid-template-columns: minmax(0,1fr) 360px; }
  body.solo .main-col{ grid-column: 1; }
  body.solo .pospanel{ grid-column: 2; }
}


/* ============================================================
   v0.35 — Fixes: music volume slider, desktop lobby rail
   ============================================================ */
.mitem.mvol{ cursor: default; }
.mitem.mvol input[type=range]{
  width: 116px;
  accent-color: #B22730;
}

/* wide desktop: the lobby matches the table column height and scrolls inside,
   so the page itself never grows a scrollbar because of it */
@media (min-width: 1480px){
  .lobby{ min-height: 0; }
  .lobby .llist{
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
}


/* ============================================================
   v0.36 — Info bar under the stage (results / online / messages),
   DEFAULT WHEEL chip
   ============================================================ */
.infobar{
  margin-top: 10px;
  padding: 4px 14px;
  display: flex; flex-direction: column;
}
.ib-row{ display: flex; align-items: center; min-height: 34px; padding: 3px 0; }
.ib-row + .ib-row{ border-top: 1px solid var(--line); }
.ib-top{ justify-content: space-between; gap: 10px; }
.ib-feed #feed{ list-style: none; flex: 1; overflow: hidden; margin: 0; padding: 0; }
.ib-feed #feed li:not(:first-child){ display: none; }   /* one rotating line */
.infobar .online-badge{ border: none; padding: 0; }

.default-chip{ top: 37px; }
@media (min-width: 1001px){ .default-chip{ top: 46px; } }
@media (max-width: 1000px){ .default-chip{ top: auto; bottom: 2px; } }

/* ============================================================
   v0.38 — Solo keeps only the top info line (results + mode link);
   ONLINE and the message line are multiplayer furniture
   ============================================================ */
body.solo .infobar .ib-row:not(.ib-top){ display:none; }


/* ============================================================
   v0.40 — Rules: two tabs, admin-editable text
   ============================================================ */
.rtabs{ margin-bottom: 10px; }
.rules-body p{ margin: 0 0 10px; line-height: 1.55; }
.rules-body p:last-child{ margin-bottom: 0; }
.acard textarea{
  width: 100%;
  margin-top: 4px;
  background: #0D1017;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
  line-height: 1.5;
  resize: vertical;
}

/* ============================================================
   v0.41 — Rules modal: same fixed size on both tabs,
   smooth finger scroll inside the text
   ============================================================ */
#rulesModal .modal-card{
  display: flex;
  flex-direction: column;
  height: min(540px, 82vh);
  height: min(540px, 82dvh);
}
#rulesModal .rtabs{ flex: 0 0 auto; margin: 12px 16px 2px; }
#rulesModal .rules-body{
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* ============================================================
   v0.42 — Limits shown next to ONLINE
   ============================================================ */
.limits-note{
  margin-left: auto;
  color: var(--dim);
  font-size: 11px;
  letter-spacing: .08em;
  white-space: nowrap;
}

/* ============================================================
   v0.47 — Provably Fair window
   ============================================================ */
#fairModal .modal-card{
  display: flex; flex-direction: column;
  height: min(560px, 84vh);
  height: min(560px, 84dvh);
}
#fairModal .fair-body{
  flex: 1 1 0; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
}
.fair-body code{
  display: block;
  font-size: 11px;
  color: var(--silver);
  word-break: break-all;
  background: #0A0D13;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
}
.fair-log{ list-style: none; margin: 10px 0 16px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.fair-log li{
  display: flex; align-items: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 9px;
  padding: 6px 9px; font-size: 12px; font-variant-numeric: tabular-nums;
}
.fair-log .fr{ color: var(--dim); min-width: 52px; }
.fair-log .fseed{ flex: 1; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fair-log .fok{ font-weight: 800; }
.fair-log .fok.good{ color: var(--ok); }
.fair-log .fok.test{ color: #E8B03E; }
.fair-solo-head{ margin-top: 6px; }
.fair-row{ display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.fair-row input{
  flex: 1; min-width: 120px;
  background: #0A0D13; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 9px; font: inherit; font-size: 12.5px;
}
.fair-btn{
  background: #1B202B; color: var(--silver);
  border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 12px; font-size: 11px; font-weight: 800; letter-spacing: .1em;
  cursor: pointer;
}
.fair-btn:active{ transform: translateY(1px); }
.fair-nonce{ color: var(--dim); font-size: 11px; }
#fairRevealed{ font-size: 11.5px; color: var(--ok); word-break: break-all; }

/* ============================================================
   v0.48 — Cash-out lock window
   ============================================================ */
.cashout.locked{ opacity: .45; }

/* v0.49 — Journal & safety */
.abtn.danger{ border-color: #7A2F35; color: #FF6B7A; }


/* ============================================================
   v0.51 — Positions panel: the lobby's exact recipe.
   height:0 removes the list's natural height from grid track
   sizing entirely, so the panel can never inflate the page;
   flex then hands the list its real height and it scrolls inside.
   ============================================================ */
@media (min-width: 1001px){
  .plist{
    flex: 1 1 0;
    height: 0;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }
}


/* ============================================================
   v0.53 — Final polish round
   ============================================================ */
/* (1) header contents step in from the edges — a touch, not a march */
.header{ padding-left: 34px; padding-right: 24px; }
@media (max-width: 720px){ .header{ padding-left: 26px; padding-right: 18px; } }

/* (7) ONLINE and limits live on the stage corners, aligned with MY WHEEL's edge */
.stage-online{ top: auto; bottom: 2px; left: 2px; cursor: default; }
.stage-online b{ color: var(--ok); }
.stage-limits{
  top: auto; bottom: 2px; left: auto; right: 2px;
  cursor: default; color: var(--dim);
}
.stage-limits:empty{ display: none; }
body.solo .stage-online{ display: none; }

/* (9) v0.54 — wheel centered in its half; tanks stretch back and grow WIDE:
   much wider in multi, wider still in solo, centered with proportional air */
@media (min-width: 1181px){
  .stage{ justify-items: stretch; }
  .wheel-wrap{ justify-self: center; }
  .vtanks{ margin: 0 auto; max-width: 600px; }
  body.solo .vtanks{ max-width: 720px; }
}

/* (8) messages that don't fit become a running line */
.ib-feed li{ overflow: hidden; }
.ib-feed li span.mq{
  display: inline-block;
  white-space: nowrap;
  padding-left: 100%;
  animation: feedmq 14s linear infinite;
}
@keyframes feedmq{
  from{ transform: translateX(0); }
  to{ transform: translateX(-100%); }
}


/* ============================================================
   v0.60 — Operator message lives IN the feed line; page never scrolls
   ============================================================ */
#feed li.pinnedline, #feed li.pinnedline span{ color: var(--gold); font-weight: 800; }
#feed li.pinnedline.urgent, #feed li.pinnedline.urgent span{ color: #FF5A66; }
body.solo.has-pinned .ib-row.ib-feed{ display: flex; }   /* solo shows the line only during an active message */

/* multi has no SPIN row — its wheel can breathe wider than solo's */
@media (min-width: 1181px){
  body:not(.solo) .wheel-wrap{ max-width: min(100%, max(420px, calc(100vh - 410px))); }
}

/* any scrollbar that ever appears is thin and dark, never the fat default */
::-webkit-scrollbar{ width: 8px; height: 8px; }
::-webkit-scrollbar-thumb{ background: rgba(255,255,255,.10); border-radius: 8px; }
::-webkit-scrollbar-track{ background: transparent; }

.ib-feed li.admin, .ib-feed li.admin span{ color: var(--gold); font-weight: 700; }


/* ===== v0.62 — game-name suffix next to the HYDRA sign ===== */
.brand-pull{
  font-style: italic;
  font-weight: 300;
  font-size: 20px;
  letter-spacing: .30em;
  color: #f2ece7;
  opacity: .92;
  transform: translateY(1px);
  user-select: none;
  white-space: nowrap;
}
@media (max-width: 720px){
  .brand-pull{ font-size: 15px; letter-spacing: .22em; }
}
