:root {
  /* solid poker — deep felt, muted gold, soft contrast */
  --bg: #0c1210;
  --felt: #0e1614;
  --panel-solid: #111a17;
  --sidebar: #0e1513;
  --line: #1f2a26;
  --line-soft: #18211e;
  --text: #dde5e0;
  --muted: #7c8a83;
  --gold: #c6a763;
  --gold-dim: #8d7740;
  --green: #6fae84;
  --radius: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 70% -10%, #12201b 0%, transparent 60%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Roboto, system-ui, "Noto Sans Thai", sans-serif;
  font-size: 13px;
  /* fill the iframe at ANY height; scroll happens inside .content (lets Notion embed shrink fully) */
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- top bar ---- */
.topbar { flex: 0 0 auto; display: flex; align-items: center; gap: 18px; padding: 9px 18px;
  background: linear-gradient(180deg, #13201c, var(--panel-solid));
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-logo { font-size: 18px; font-weight: 900; letter-spacing: 1.5px; color: var(--gold); line-height: 1; }
.brand-logo span { color: var(--text); font-weight: 800; margin-left: 3px; }
.filter-toggle { display: none; background: #0c1311; border: 1px solid var(--line); color: var(--text);
  width: 36px; height: 34px; border-radius: 8px; cursor: pointer; font-size: 16px; flex: none; }
.brand h1 { font-size: 14px; margin: 0; letter-spacing: .5px; color: var(--gold); }
.brand p { margin: 1px 0 0; font-size: 10px; color: var(--muted); }
.pagetabs { display: flex; gap: 4px; background: #0a100e; padding: 3px; border-radius: 9px; border: 1px solid var(--line); }
.ptab { border: 0; background: transparent; color: var(--muted); padding: 6px 20px;
  border-radius: 7px; font-weight: 700; letter-spacing: 1px; cursor: pointer; font-size: 12px; }
.ptab.active { background: linear-gradient(180deg, #d4b873, var(--gold)); color: #1a1407; }
.ptab:not(.active):hover { color: var(--text); }
.meta-count { margin-left: auto; color: var(--muted); font-size: 11px; }

/* ---- layout ---- */
.layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 194px 1fr; }
.sidebar { background: var(--sidebar); border-right: 1px solid var(--line); padding: 14px 14px 28px;
  overflow-y: auto; overflow-x: hidden; min-height: 0; scrollbar-width: none; -ms-overflow-style: none; }
.sidebar::-webkit-scrollbar { width: 0; height: 0; display: none; }
.content { overflow: auto; position: relative; min-height: 0; }

/* ---- filters ---- */
.fgroup { margin-bottom: 14px; }
.flabel { font-size: 9.5px; text-transform: uppercase; letter-spacing: 1.1px; color: var(--muted); margin-bottom: 7px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { border: 1px solid var(--line); background: #0c1311; color: var(--muted);
  padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 11.5px; transition: .12s; }
.chip:hover { color: var(--text); border-color: var(--gold-dim); }
.chip.on { background: rgba(198,167,99,.14); border-color: var(--gold); color: var(--gold); }
.chip.rank { padding: 4px 0; width: auto; min-width: 0; text-align: center; font-weight: 700; }
.rankgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.rankgrid .chip.any { grid-column: span 7; width: auto; }
#searchFlop { width: 100%; background: #0c1311; border: 1px solid var(--line); color: var(--text);
  padding: 8px 10px; border-radius: 7px; font-size: 12px; }
#searchFlop:focus { outline: none; border-color: var(--gold); }
.checkrow { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); cursor: pointer; margin: 4px 0 12px; }
.checkrow input { accent-color: var(--gold); }
.clearbtn { width: 100%; background: transparent; border: 1px solid var(--line); color: var(--muted);
  padding: 9px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.clearbtn:hover { color: var(--text); border-color: var(--gold); }

/* ---- legend bar ---- */
.legendbar { position: sticky; top: 0; z-index: 12; display: flex; flex-wrap: wrap; gap: 14px;
  padding: 8px 16px; background: var(--panel-solid); border-bottom: 1px solid var(--line); }
.legendbar span { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.legendbar i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }

/* ---- heatmap table ---- */
table.heat { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.heat thead th { position: sticky; top: 37px; z-index: 10; background: var(--panel-solid);
  color: var(--muted); font-size: 11px; font-weight: 600; text-align: right; padding: 9px 14px;
  border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.heat thead th[data-col]:hover { color: var(--text); }
.heat thead th.col-flop { text-align: left; left: 0; z-index: 11; min-width: 100px; cursor: default; }
.heat thead th.col-strat { text-align: left; cursor: default; width: 120px; min-width: 84px; }
.heat thead th .arrow { color: var(--gold); font-size: 9px; margin-left: 3px; }
.heat td { padding: 5px 9px; text-align: right; font-size: 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.heat td.col-flop { text-align: left; position: sticky; left: 0; background: var(--bg); font-weight: 600; letter-spacing: .4px; z-index: 5; }
.heat td.col-strat { padding: 5px 9px 5px 0; width: 120px; min-width: 84px; }
.heat tbody tr.data:hover td { background: rgba(255,255,255,.025); }
.heat tbody tr.data:hover td.col-strat { background: transparent; }
.heat tbody tr.data.click { cursor: pointer; }
.heat tbody tr.data.click:hover td.col-flop { color: var(--gold); }

/* strategy bar */
.sbar { display: flex; width: 100%; max-width: 150px; height: 15px; border-radius: 4px; overflow: hidden;
  background: #0a0f0d; box-shadow: inset 0 0 0 1px var(--line-soft); }
.sseg { height: 100%; }

/* aggregate rows */
tr.agg td { font-weight: 700; border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; }
tr.agg.base td { color: var(--gold); background: rgba(198,167,99,.05); }
tr.agg.filt td { color: #84cf9f; background: rgba(111,174,132,.07); }
tr.agg td.col-flop { background: #11160f; }
tr.agg.base td.col-flop { background: #15130b; }
tr.agg.filt td.col-flop { background: #0d160f; }
tr.agg .sbar { height: 17px; }
.trihint { color: var(--muted); font-size: 10px; font-weight: 400; }

.bd { font-weight: 700; font-size: 12.5px; letter-spacing: .3px; }
.su-s { color: #c9d2cb; } .su-c { color: #5cbf7e; } .su-h { color: #db6d63; } .su-d { color: #5e9be0; }
.empty { color: var(--muted); padding: 50px; text-align: center; }

/* ---- drawer ---- */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; opacity: 0; pointer-events: none; transition: .15s; }
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(620px, 96vw); background: var(--panel-solid);
  border-left: 1px solid var(--line); z-index: 50; transform: translateX(100%); transition: .2s; overflow-y: auto; }
.drawer.show { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--panel-solid); }
.drawer-head h2 { font-size: 14px; margin: 0; }
.drawer-head .sub { color: var(--muted); font-size: 11px; font-weight: 400; margin-top: 2px; }
.closebtn { background: #0c1311; border: 1px solid var(--line); color: var(--text); width: 30px; height: 30px; border-radius: 7px; cursor: pointer; }
.drawer .dwrap { padding: 4px 0 30px; }
.drawer .heat thead th { top: 0; }

/* ---- sidebar backdrop (mobile) ---- */
.sidebar-backdrop { display: none; position: fixed; inset: 51px 0 0 0; background: rgba(0,0,0,.5); z-index: 25; }
.sidebar-backdrop.show { display: block; }

/* ---- responsive / Notion embed (all devices) ---- */
@media (max-width: 860px) {
  .filter-toggle { display: inline-grid; place-items: center; }
  .topbar { gap: 12px; padding: 8px 12px; }
  .brand-txt h1 { font-size: 12px; }
  .brand-txt p { display: none; }
  .meta-count { display: none; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 51px; left: 0; bottom: 0; width: 270px; z-index: 30;
    transform: translateX(-100%); transition: transform .2s; box-shadow: 6px 0 24px rgba(0,0,0,.5); }
  .sidebar.open { transform: translateX(0); }
}
@media (max-width: 540px) {
  .brand-txt { display: none; }
  .pagetabs .ptab { padding: 6px 16px; }
  .heat td, .heat thead th { padding: 5px 9px; font-size: 12px; }
  .heat thead th.col-strat, .heat td.col-strat { display: none; }   /* save width on phones */
  .legendbar { gap: 9px; padding: 7px 10px; }
}
/* touch: larger tap targets */
@media (hover: none) {
  .chip { padding: 7px 12px; }
  .chip.rank { padding: 6px 0; }
}
