/* Shared look for the High Rollers games: felt, gold, cards, chips, buttons and
   the help dialog. Lifted from Hold'em Night, which keeps its own copy inline. */
:root {
  color-scheme: dark;
  --bg: #07090a;
  --text: #f1f4f2;
  --muted: #93a39b;
  --gold: #f5c451;
  --gold-deep: #c9952a;
  --panel: rgba(18, 22, 21, .92);
  --panel-solid: #141918;
  --line: rgba(255, 255, 255, .08);
  --felt-a: #1f7a50;
  --felt-b: #0f4a2f;
  --felt-c: #082a1b;
  --good: #7ee2a8;
  --bad: #ff8a80;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background:
    radial-gradient(ellipse 70% 55% at 50% 42%, rgba(70, 120, 95, .22), transparent 70%),
    radial-gradient(ellipse at 50% 120%, #1a0f0a, transparent 60%),
    var(--bg);
  color: var(--text);
  font: 14px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh; overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }

/* ---------- Header ---------- */
header.bar {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 22px; position: relative; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: .4px; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--gold), var(--gold-deep)); color: #1a1205; font-size: 17px;
  box-shadow: 0 2px 10px rgba(245, 196, 81, .35);
}
.hud { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.pill {
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; font-size: 12.5px; color: var(--muted); white-space: nowrap;
}
.pill b { color: var(--text); font-weight: 600; margin-left: 4px; }
.pill.bank b { color: var(--gold); }
.iconbtn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); cursor: pointer; font-size: 16px; display: grid; place-items: center; padding: 0; flex: none;
}
.iconbtn:hover { color: var(--text); }
.iconbtn.help { font-weight: 800; font-size: 15px; color: var(--gold); border-color: rgba(245,196,81,.35); }
.settings {
  position: absolute; right: 22px; top: 54px; background: var(--panel-solid); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; display: none; flex-direction: column; gap: 9px;
  box-shadow: 0 12px 40px rgba(0,0,0,.6); font-size: 13px; min-width: 210px;
}
.settings.open { display: flex; }
.settings label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.settings input { accent-color: var(--gold); }
.settings hr { border: 0; border-top: 1px solid var(--line); margin: 2px 0; width: 100%; }
.settings .link { background: none; border: 0; color: var(--bad); padding: 0; text-align: left; cursor: pointer; font: inherit; }

/* ---------- Felt table (rounded rectangle) ---------- */
.stage { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.feltbox {
  position: relative; border-radius: 40px; padding: 14px;
  background: linear-gradient(160deg, #a06a38, #5c3518 45%, #8a5629 70%, #4a2a12);
  box-shadow: 0 30px 70px rgba(0,0,0,.75), 0 0 0 10px #1b120d, 0 0 0 12px #0a0605,
    inset 0 1px 1px rgba(255,255,255,.3);
  margin: 22px 12px 26px;
}
.felt {
  position: relative; border-radius: 28px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, var(--felt-a) 0%, var(--felt-b) 58%, var(--felt-c) 100%);
  box-shadow: inset 0 0 60px rgba(0,0,0,.65), inset 0 6px 12px rgba(0,0,0,.5);
}
.felt::before { /* cloth grain */
  content: ""; position: absolute; inset: 0; opacity: .22; mix-blend-mode: overlay; pointer-events: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
.watermark {
  font: 700 13px/1 Georgia, serif; letter-spacing: 6px; color: rgba(255,255,255,.1); white-space: nowrap; text-align: center;
}
.status {
  color: rgba(255,255,255,.88); font-size: 13.5px; min-height: 20px; text-align: center;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}

/* ---------- Cards ---------- */
.card {
  width: 64px; height: 90px; border-radius: 7px; position: relative; flex: none;
  background: linear-gradient(160deg, #ffffff, #eef0ee);
  box-shadow: 0 1px 0 #c9cbc9, 0 4px 10px rgba(0,0,0,.45);
  color: #15181a; font-family: Georgia, "Times New Roman", serif;
  transition: transform .3s, filter .3s, box-shadow .3s;
}
.card.red { color: #c8202c; }
.card .idx { position: absolute; left: 5px; top: 4px; display: flex; flex-direction: column; align-items: center; line-height: 1; }
.card .idx.br { left: auto; top: auto; right: 5px; bottom: 4px; transform: rotate(180deg); }
.card .idx .r { font-size: 18px; font-weight: 700; letter-spacing: -1px; }
.card .idx .s { font-size: 14px; margin-top: 1px; }
.card .pip { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 32px; line-height: 1; }
.card .pip.face { font-size: 27px; font-weight: 700; }
.card.back {
  background:
    repeating-linear-gradient(45deg, transparent 0 5px, rgba(255,255,255,.09) 5px 6px),
    repeating-linear-gradient(-45deg, transparent 0 5px, rgba(255,255,255,.09) 5px 6px),
    linear-gradient(145deg, #b3243a, #7a1022);
  border: 4px solid #fff;
}
.card.back::after {
  content: "♠"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,.18); color: rgba(255,255,255,.75);
  display: grid; place-items: center; font-size: 13px;
}
.card.deal { animation: deal .42s cubic-bezier(.2,.8,.3,1) both; }
.card.flip { animation: flip .45s ease-out both; }
@keyframes deal {
  from { transform: translate(var(--fx, 0), var(--fy, -80px)) rotate(-20deg) scale(.6); opacity: 0; }
  to { opacity: 1; }
}
@keyframes flip { from { transform: rotateY(90deg); } to { transform: none; } }

/* ---------- Chips ---------- */
.stack { display: flex; align-items: flex-end; gap: 1px; }
.col { position: relative; width: 22px; }
.chip {
  position: absolute; left: 0; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0 36%, rgba(255,255,255,.85) 37% 41%, var(--c) 42% 100%);
  border: 3px dashed var(--e, rgba(255,255,255,.92));
  box-shadow: 0 1.5px 0 var(--d), 0 2.5px 3px rgba(0,0,0,.55);
}
/* A single big clickable chip, used for choosing a bet size. */
.bigchip {
  width: 50px; height: 50px; border-radius: 50%; cursor: pointer; padding: 0; flex: none;
  background: radial-gradient(circle, var(--c) 0 50%, rgba(255,255,255,.85) 51% 55%, var(--c) 56% 100%);
  border: 4px dashed var(--e, rgba(255,255,255,.92));
  box-shadow: 0 3px 0 var(--d), 0 5px 10px rgba(0,0,0,.5);
  color: var(--t, #fff); font: 800 12px/1 "Segoe UI", system-ui, sans-serif; text-shadow: 0 1px 1px rgba(0,0,0,.35);
  transition: transform .12s, box-shadow .12s;
}
.bigchip:hover { transform: translateY(-2px); }
.bigchip.sel { transform: translateY(-5px); box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(245,196,81,.6), 0 5px 10px rgba(0,0,0,.5); }
.bigchip:disabled { opacity: .35; cursor: default; transform: none; }

/* ---------- Dock & buttons ---------- */
.dock {
  display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: stretch;
  max-width: 1060px; margin: 0 auto; padding: 0 24px 24px;
}
.card-panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}
.panel-head { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); font-weight: 600; }
.logcard { padding: 10px 12px; display: flex; flex-direction: column; max-height: 220px; }
.log { overflow-y: auto; flex: 1; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; color: #c8d2cd; min-height: 80px; }
.log::-webkit-scrollbar { width: 6px; } .log::-webkit-scrollbar-thumb { background: #2c3532; border-radius: 3px; }
.log .head { color: var(--gold); margin-top: 6px; font-weight: 600; font-size: 11.5px; letter-spacing: .3px; }
.log .head:first-child { margin-top: 0; }
.log .win { color: var(--good); font-weight: 600; }
.log .lose { color: var(--bad); }
.actions { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; justify-content: center; min-height: 108px; }
.actions .wait { color: var(--muted); text-align: center; font-size: 13px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row.main > .btn { flex: 1; }
.row.center { justify-content: center; }
.btn {
  font: inherit; font-weight: 700; font-size: 14px; color: #fff; border-radius: 10px; padding: 11px 14px;
  border: 0; cursor: pointer; min-width: 96px; letter-spacing: .2px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 3px 0 rgba(0,0,0,.35), 0 6px 14px rgba(0,0,0,.3);
  transition: transform .08s, filter .15s;
}
.btn:hover:not(:disabled) { filter: brightness(1.12); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 0 rgba(0,0,0,.35); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.red { background: linear-gradient(180deg, #b23b3b, #7f2424); }
.btn.blue { background: linear-gradient(180deg, #3b86c9, #235c94); }
.btn.gold { background: linear-gradient(180deg, #f2b33d, #c9831c); color: #241503; }
.btn.green { background: linear-gradient(180deg, #34a466, #217247); }
.btn.grey { background: linear-gradient(180deg, #4d5653, #333a38); }
kbd {
  font: 600 10px/1 system-ui; padding: 2px 5px; border-radius: 4px; margin-left: 7px; vertical-align: 1px;
  background: rgba(0,0,0,.22); opacity: .8;
}
.chipbtn {
  font: inherit; font-size: 12px; font-weight: 600; color: var(--text); background: rgba(255,255,255,.06);
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; cursor: pointer;
}
.chipbtn:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.chipbtn:disabled { opacity: .4; cursor: default; }
.hint { font-size: 12.5px; color: var(--muted); text-align: center; min-height: 18px; }
.hint b { color: var(--gold); }

/* ---------- Overlays & help ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.72); display: none; place-items: center; z-index: 50; backdrop-filter: blur(3px); }
.overlay.show { display: grid; }
.dialog {
  background: var(--panel-solid); border: 1px solid var(--line); border-radius: 18px; padding: 30px 36px;
  text-align: center; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.dialog h2 { margin: 0 0 8px; font-size: 24px; }
.dialog p { color: var(--muted); margin: 0 0 20px; }
.dialog.helpbox {
  text-align: left; width: min(640px, calc(100vw - 32px)); max-width: none; padding: 0;
  max-height: min(86vh, 760px); display: flex; flex-direction: column; overflow: hidden;
}
.helphead {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 14px 16px 0 18px; border-bottom: 1px solid var(--line);
}
.tabs { display: flex; gap: 4px; }
.tab {
  font: inherit; font-weight: 600; font-size: 14px; color: var(--muted); background: none; cursor: pointer;
  border: 0; border-bottom: 2px solid transparent; padding: 8px 12px 11px; margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.helphead .iconbtn { width: 30px; height: 30px; font-size: 13px; margin-bottom: 8px; }
.tabpane { overflow-y: auto; padding: 16px 22px 22px; }
.tabpane::-webkit-scrollbar { width: 6px; } .tabpane::-webkit-scrollbar-thumb { background: #2c3532; border-radius: 3px; }
.tabpane h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.3px; color: var(--gold); margin: 18px 0 6px; }
.tabpane h3:first-child { margin-top: 0; }
.tabpane p, .tabpane li { color: #c8d2cd; margin: 0 0 6px; }
.tabpane ul, .tabpane ol { margin: 0 0 6px; padding-left: 20px; }
.tabpane b { color: var(--text); }
.tabpane .note { font-size: 12.5px; color: var(--muted); }
.tabpane table { border-collapse: collapse; width: 100%; font-size: 12.5px; margin: 4px 0 8px; }
.tabpane th, .tabpane td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; color: #c8d2cd; }
.tabpane th { color: var(--muted); font-weight: 600; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.keys kbd { margin: 0 4px 0 0; font-size: 11px; padding: 3px 6px; background: rgba(255,255,255,.1); opacity: 1; color: var(--text); }

@media (max-width: 820px) {
  header.bar { padding: 10px 12px; }
  .brand span { display: none; }
  .stage, .dock { padding-left: 16px; padding-right: 16px; }
  .dock { grid-template-columns: 1fr; }
  .dock .logcard { order: 2; }
  .feltbox { margin: 14px 4px 20px; padding: 9px; border-radius: 28px; }
  .felt { border-radius: 20px; }
  .card { width: 46px; height: 65px; } .card .idx .r { font-size: 14px; } .card .idx .s { font-size: 11px; }
  .card .pip { font-size: 22px; } .card .pip.face { font-size: 19px; } .card .idx.br { display: none; }
  .bigchip { width: 42px; height: 42px; font-size: 11px; }
}
