/* Texas Hold'em — modern cartoon table.
   External stylesheet (no inline styles) per the site CSP. */

:root {
  --bg: #0e1726;
  --bg2: #16233b;
  --panel: #1b2942;
  --panel2: #223354;
  --ink: #eaf1ff;
  --muted: #93a4c4;
  --felt: radial-gradient(ellipse at 50% 38%, #1ba06d 0%, #0f7a51 55%, #0a5e3e 100%);
  --gold: #f5d76e;
  --accent: #4ea8ff;
  --danger: #ff5d73;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Baloo 2", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  background: linear-gradient(160deg, #dde6ee, #c4d2de);
  color: var(--ink);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  background: rgba(10,16,28,.7);
  border-bottom: 1px solid rgba(0,0,0,.3);
  position: sticky; top: 0; z-index: 5;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 12px -4px rgba(0,0,0,.6);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { margin: 0; font-size: 1.35rem; letter-spacing: .3px; }
.brand .sub { color: var(--muted); font-size: .82rem; }
.topbar-actions { display: flex; gap: 10px; }

.btn {
  border: none; cursor: pointer; border-radius: 999px;
  padding: 10px 18px; font-weight: 700; font-size: .95rem;
  font-family: inherit; color: #0c1322; transition: transform .08s ease, filter .15s ease;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(180deg, #67e8a6, #2fb87a); color: #06321f; }
.btn.call    { background: linear-gradient(180deg, #7cc4ff, #3b8fe0); color: #032038; }
.btn.raise   { background: linear-gradient(180deg, #ffd97a, #f0b429); color: #3a2600; }
.btn.fold    { background: linear-gradient(180deg, #ff8a9b, #ec4f68); color: #3a0010; }
.btn.ghost   { background: rgba(255,255,255,.12); color: var(--ink); border: 1px solid rgba(255,255,255,.16); }
.btn.metal {
  color: #2a1500;
  background:
    linear-gradient(180deg,
      #ffd9a0 0%, #ff9e3d 18%, #f47b1b 46%,
      #c85a10 54%, #ff8a2b 80%, #ffbf6e 100%);
  border: 1px solid #8a3d08;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.65),
    inset 0 -2px 3px rgba(120,50,0,.55),
    0 2px 6px rgba(0,0,0,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.35);
}
.btn.metal:hover { filter: brightness(1.08) saturate(1.1); }
.btn.metal-green {
  color: #052a12;
  background:
    linear-gradient(180deg,
      #c8f7c5 0%, #5fd07a 18%, #2fae57 46%,
      #1c8a40 54%, #43c468 80%, #9aeab0 100%);
  border: 1px solid #0c5a26;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.6),
    inset 0 -2px 3px rgba(0,60,20,.55),
    0 2px 6px rgba(0,0,0,.4);
  text-shadow: 0 1px 0 rgba(255,255,255,.3);
}
.btn.metal-green:hover { filter: brightness(1.08) saturate(1.1); }

.layout {
  display: grid;
  grid-template-columns: minmax(0,1fr) 360px;
  gap: 20px;
  padding: 20px;
  max-width: 1320px;
  margin: 0 auto;
}
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr; }
  .table-wrap { flex-direction: column; }
  .actionbar { flex: none; align-self: stretch; }
  .action-buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .action-buttons .btn { width: auto; }
  .raise-controls { flex-direction: row; flex-wrap: wrap; align-items: center; }
  .raise-controls .btn { width: auto; }
}

/* ---- Table ---- */
.table-wrap { display: flex; flex-direction: row; align-items: stretch; gap: 16px; }
.felt {
  flex: 1; min-width: 0;
  position: relative;
  background: var(--felt);
  border: 10px solid #4b2e16;
  border-radius: 28px;
  box-shadow: var(--shadow), inset 0 0 60px rgba(0,0,0,.35);
  padding: 18px;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.bots {
  display: flex;
  justify-content: space-around;
  gap: 10px;
  flex-wrap: wrap;
}

.seat {
  background: rgba(8,16,28,.55);
  border: 2px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 10px 12px;
  width: 150px;
  text-align: center;
  position: relative;
  transition: box-shadow .2s, border-color .2s, transform .2s;
}
.seat.turn {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(245,215,110,.35), 0 0 22px rgba(245,215,110,.45);
  transform: translateY(-3px);
}
.seat.folded { opacity: .42; filter: grayscale(.6); }
.seat.out { opacity: .25; }
.seat.winner { border-color: #67e8a6; box-shadow: 0 0 22px rgba(103,232,166,.6); }

.avatar {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; font-size: 30px;
  margin: 0 auto 4px; border: 3px solid #0c1322;
  box-shadow: 0 4px 10px rgba(0,0,0,.4);
}
.seat .pname { font-weight: 800; font-size: .92rem; }
.seat .chips { color: var(--gold); font-weight: 800; font-size: .9rem; }
.seat .bet {
  margin-top: 4px; font-size: .78rem; color: #d9e6ff;
  min-height: 1.1em;
}
.seat .lastact {
  margin-top: 4px; font-size: .75rem; min-height: 1.1em;
  color: #bfe8ff; font-weight: 700;
}
.btn-dealer {
  position: absolute; top: -8px; right: -8px;
  background: #fff; color: #b8860b; font-weight: 900;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center; font-size: .72rem;
  border: 2px solid #b8860b; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.seat .mini-cards { display: flex; gap: 4px; justify-content: center; margin-top: 6px; min-height: 36px; }

/* ---- Center ---- */
.center { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.street-pill {
  background: rgba(0,0,0,.35); color: #d8ffe9; font-weight: 800;
  padding: 4px 16px; border-radius: 999px; font-size: .82rem;
  letter-spacing: .5px; text-transform: uppercase;
}
.board { display: flex; gap: 8px; min-height: 68px; align-items: center; }
.pot {
  background: rgba(0,0,0,.4); padding: 6px 18px; border-radius: 999px;
  font-weight: 800; color: var(--gold); font-size: 1.05rem;
}
.dealer-msg { color: #eafff3; font-weight: 700; min-height: 1.2em; font-size: .9rem; }

/* ---- Hero (you) ---- */
.hero { display: flex; justify-content: center; }
.hero .seat { width: 230px; }
.hero .avatar { width: 60px; height: 60px; font-size: 34px; }
.hero .mini-cards { min-height: 72px; }

/* ---- Cards ---- */
.pcard {
  background: #fff; border-radius: 8px; color: #111;
  font-weight: 800; box-shadow: 0 3px 8px rgba(0,0,0,.35);
  display: grid; place-items: center; position: relative;
  border: 1px solid #d8d8d8;
}
.pcard.red { color: #d11a3a; }
.board .pcard { width: 44px; height: 64px; font-size: 1.15rem; flex-direction: column; }
.hero .pcard { width: 46px; height: 68px; font-size: 1.2rem; }
.mini-cards .pcard { width: 24px; height: 34px; font-size: .72rem; }
.pcard .rk { line-height: 1; }
.pcard .st { line-height: 1; font-size: .8em; }
.cardback {
  border-radius: 8px;
  background:
    repeating-linear-gradient(45deg, #2b5cff 0 6px, #1f44c8 6px 12px);
  border: 2px solid #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.35);
}
.mini-cards .cardback { width: 24px; height: 34px; }
.hero .cardback, .board .cardback { width: 44px; height: 64px; }

/* ---- Action bar ---- */
.actionbar {
  flex: 0 0 180px;
  align-self: center;
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: var(--shadow);
}
.action-buttons { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.action-buttons .btn { width: 100%; justify-content: center; }
.action-buttons .hint { color: var(--muted); font-size: .9rem; text-align: center; }
.raise-controls { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
.raise-controls input[type=range] { width: 100%; accent-color: var(--gold); }
.raise-controls .btn { width: 100%; justify-content: center; }
.raise-amt { font-size: .95rem; }
.raise-amt strong { color: var(--gold); font-size: 1.15rem; }

/* ---- Sidebar ---- */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.card-panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-panel h2 { margin: 0 0 10px; font-size: 1.05rem; }
.muted { color: var(--muted); }

.odds-panel { background: linear-gradient(180deg, #1d2c49, #182440); }
.odds-body .big {
  font-size: 2.6rem; font-weight: 900; line-height: 1; color: var(--gold);
  text-align: center;
}
.odds-body .big small { font-size: 1rem; color: var(--muted); font-weight: 700; }
.meter {
  height: 14px; border-radius: 999px; background: rgba(255,255,255,.1);
  overflow: hidden; margin: 12px 0;
}
.meter > span { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ff5d73, #ffd97a, #67e8a6); transition: width .4s ease; }
.odds-rows { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: .92rem; }
.odds-rows .k { color: var(--muted); }
.odds-rows .v { font-weight: 800; text-align: right; }
.odds-note {
  margin-top: 10px; font-size: .88rem; line-height: 1.4;
  background: rgba(78,168,255,.12); border-left: 3px solid var(--accent);
  padding: 8px 10px; border-radius: 8px;
}

.log { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow-y: auto;
  font-size: .86rem; display: flex; flex-direction: column; gap: 4px; }
.log li { color: #cdd9f0; padding: 2px 0; border-bottom: 1px dashed rgba(255,255,255,.06); }

.howto ul { margin: 10px 0 0; padding-left: 18px; font-size: .86rem; line-height: 1.5; color: #cdd9f0; }
.howto li { margin-bottom: 6px; }
.howto summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
}
.howto summary::-webkit-details-marker { display: none; }
.howto summary h2 { margin: 0; }
.howto summary::after {
  content: "\25BC"; color: var(--muted); font-size: .8rem; transition: transform .2s ease;
}
.howto[open] summary::after { transform: rotate(180deg); }

/* ---- Overlay ---- */
.overlay {
  position: fixed; inset: 0; background: rgba(4,8,16,.78);
  display: grid; place-items: center; z-index: 20; backdrop-filter: blur(4px);
}
.overlay-card {
  background: var(--panel); border: 1px solid rgba(255,255,255,.12);
  border-radius: 22px; padding: 32px 40px; text-align: center; max-width: 420px;
  box-shadow: var(--shadow);
}
.overlay-card h2 { margin: 0 0 10px; font-size: 1.8rem; }
.overlay-card p { color: #cdd9f0; margin: 0 0 20px; font-size: 1.05rem; }

.speech {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: #fff; color: #1a2336; font-size: .76rem; font-weight: 700;
  padding: 6px 10px; border-radius: 10px; width: max-content; max-width: 180px;
  box-shadow: 0 4px 12px rgba(0,0,0,.4); opacity: 0; pointer-events: none;
  transition: opacity .25s ease; z-index: 4;
}
.speech::after {
  content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: #fff;
}
.seat:hover .speech { opacity: 1; }

[hidden] { display: none !important; }
