/* CasinoWare live pages */
:root {
  --bg: #f4f5f2;
  --surface: #ffffff;
  --surface-2: #f0f2ee;
  --text: #17201b;
  --muted: #5f6b64;
  --line: #e1e5df;
  --accent: #0f6b4a;
  --accent-ink: #ffffff;
  --accent-soft: #e2f1ea;
  --gold: #b58a1b;
  --row-color: transparent;

  --ok: #11803f;      --ok-bg: #ddf3e5;
  --warn: #9a6400;    --warn-bg: #fbefd3;
  --bad: #b3261e;     --bad-bg: #fbe2df;
  --info: #1d5fa8;    --info-bg: #e1ecf9;
  --idle: #5f6b64;    --idle-bg: #eceeea;

  --clock-colorup: #f6e27a;
  --clock-break: #f7b267;
  --clock-paused: #f4a39a;

  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 2px 8px rgba(16, 24, 20, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1412;
    --surface: #171e1b;
    --surface-2: #1d2622;
    --text: #e8eeea;
    --muted: #9aa8a0;
    --line: #2a3430;
    --accent: #3fbf8a;
    --accent-ink: #06140e;
    --accent-soft: #183427;
    --gold: #e2b84a;
    --ok: #5fd08f;      --ok-bg: #17331f;
    --warn: #f0bb55;    --warn-bg: #3a2d10;
    --bad: #ff8a80;     --bad-bg: #3d1b18;
    --info: #8ab8f0;    --info-bg: #172a40;
    --idle: #a3afa8;    --idle-bg: #232c28;
    --clock-colorup: #5e5212;
    --clock-break: #6a3f12;
    --clock-paused: #6b2722;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  font-variant-numeric: tabular-nums;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.4vw, 2.1rem); letter-spacing: -.01em; }
h2 { font-size: 1.2rem; margin-bottom: .75rem; }
h3 { font-size: 1rem; margin: 1.25rem 0 .5rem; color: var(--muted); }
small { font-size: .8em; }
.muted { color: var(--muted); }
.center { text-align: center; }

.wrap { width: 100%; max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar__inner { display: flex; align-items: center; gap: 1rem; min-height: 56px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 700; color: var(--text); font-size: 1.05rem; }
.brand:hover { text-decoration: none; }
.brand__chip {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 3px var(--accent), inset 0 0 0 5px var(--surface);
  outline: 2px dashed var(--accent); outline-offset: -8px;
}
.nav { display: flex; gap: .25rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav a {
  color: var(--muted); padding: .45rem .75rem; border-radius: 999px; white-space: nowrap; font-weight: 500; font-size: .95rem;
}
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.main { padding-top: 1.75rem; padding-bottom: 2rem; min-height: 60vh; }
.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-top: 1rem; padding-bottom: 2rem; color: var(--muted); font-size: .85rem; border-top: 1px solid var(--line); }
.footer a { color: var(--muted); }

.page-head { margin-bottom: 1.5rem; }
.page-head p { margin: .35rem 0 0; }
.back { margin: 0 0 .75rem; font-size: .9rem; }
.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 2.5rem 1rem; text-align: center; color: var(--muted); }

/* Badges & chips */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .15rem .6rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap;
  background: var(--idle-bg); color: var(--idle);
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge--open, .badge--running { background: var(--ok-bg); color: var(--ok); }
.badge--running::before { animation: pulse 1.6s ease-in-out infinite; }
.badge--seating { background: var(--info-bg); color: var(--info); }
.badge--paused { background: var(--warn-bg); color: var(--warn); }
.badge--closed { background: var(--bad-bg); color: var(--bad); }
.badge--call { background: var(--warn-bg); color: var(--warn); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .badge--running::before { animation: none; } }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .75rem; }
.chip {
  display: inline-block; padding: .05rem .5rem; border-radius: 6px; font-size: .75rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); margin-left: .25rem;
}
.chips .chip { margin-left: 0; }

/* List rows (schedule, results, cash games) */
.day + .day { margin-top: 1.75rem; }
.day__title { font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .6rem; }
.rows { display: grid; gap: .5rem; }
.row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) repeat(3, minmax(84px, auto)) 120px;
  align-items: center; gap: 1rem;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--row-color);
  border-radius: var(--radius); padding: .85rem 1rem; color: var(--text); box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s;
}
.row:hover { text-decoration: none; border-color: var(--accent); border-left-color: var(--row-color); }
.row--result { grid-template-columns: 96px minmax(0, 1fr) repeat(3, minmax(84px, auto)); }
.row--cash { grid-template-columns: minmax(0, 1fr) repeat(3, minmax(84px, auto)) 120px; }
.row__time { font-weight: 700; font-size: 1.1rem; }
.row__time small { font-weight: 500; color: var(--muted); font-size: .8rem; }
.row__title { font-weight: 600; overflow-wrap: anywhere; }
.row__meta { color: var(--muted); font-size: .85rem; margin-top: .15rem; }
.row__stat { text-align: right; font-weight: 600; white-space: nowrap; }
.row__stat .lbl { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 500; }
.row__state { text-align: right; }

/* Phones: time + title on the first line, the numbers on the second, status below */
@media (max-width: 760px) {
  .row, .row--result, .row--cash { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .6rem .75rem; }
  .row__time { flex: 0 0 auto; min-width: 3.2rem; }
  .row__main { flex: 1 1 60%; min-width: 0; }
  .row--cash .row__main { flex-basis: 100%; }
  /* 28% basis: never fits next to the title, three fit on the next line */
  .row__stat { flex: 1 1 28%; min-width: 0; text-align: left; white-space: normal; font-size: .92rem; }
  .row__state { flex: 1 1 100%; text-align: left; }
  .row__state:empty { display: none; }
}
@media (max-width: 560px) {
  .topbar__inner { gap: .25rem; padding-top: .5rem; }
  .nav { margin-left: 0; width: 100%; justify-content: space-between; padding-bottom: .4rem; }
  .nav a { padding: .4rem .55rem; font-size: .9rem; }
}

/* Tournament header */
.t-head { margin-bottom: 1.25rem; }
.t-head__when { margin: .4rem 0 0; color: var(--muted); font-weight: 500; }
.t-head__desc { margin: .5rem 0 0; }
.t-head__note { margin: .5rem 0 0; padding: .6rem .8rem; background: var(--accent-soft); border-radius: 8px; }
.t-head__state { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: 1rem; font-size: .9rem; }
.t-head__state .updated { margin-left: auto; font-size: .82rem; }

/* Clock */
.clock {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  margin-bottom: 1rem; box-shadow: var(--shadow);
}
.clock__main {
  background: var(--surface); padding: 1.25rem 1.5rem; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: .25rem 1.25rem;
  transition: background .3s;
}
.clock__level { display: flex; flex-direction: column; align-items: center; grid-row: span 2; padding-right: 1.25rem; border-right: 1px solid var(--line); }
.clock__level span:last-child { font-size: 2.4rem; font-weight: 700; line-height: 1; }
.clock__time { font-family: var(--mono); font-size: clamp(2.6rem, 2rem + 3vw, 4rem); font-weight: 700; line-height: 1; letter-spacing: -.02em; }
.clock__state { font-weight: 600; color: var(--muted); min-height: 1.5em; }
.clock__blinds { display: grid; gap: 1px; background: var(--line); }
.clock__cell { background: var(--surface); padding: .75rem 1.25rem; display: flex; flex-direction: column; justify-content: center; font-weight: 600; font-size: 1.1rem; transition: background .3s; }
#clock-current { font-size: 1.35rem; }
.stat__lbl { font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.is-colorup { background: var(--clock-colorup) !important; }
.is-break { background: var(--clock-break) !important; }
.is-paused { background: var(--clock-paused) !important; }
@media (max-width: 760px) {
  .clock { grid-template-columns: 1fr; }
  .clock__main { padding: 1rem; }
}

/* Stats grid */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .5rem; margin-bottom: 1.5rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; }
.stat__val { font-weight: 700; font-size: 1.15rem; margin-top: .1rem; overflow-wrap: anywhere; }
.stat__val small { color: var(--muted); font-weight: 600; }

/* Jump links */
.jump { display: flex; gap: .4rem; overflow-x: auto; margin: 0 0 1rem; padding-bottom: .25rem; scrollbar-width: none; }
.jump a, .tabs a {
  padding: .4rem .85rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: .9rem; font-weight: 500; white-space: nowrap; color: var(--text);
}
.jump a:hover, .tabs a:hover { border-color: var(--accent); text-decoration: none; }
.tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.tabs a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* Content blocks & tables */
.block { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; box-shadow: var(--shadow); scroll-margin-top: 72px; }
.block > h2 small { font-weight: 500; font-size: .85rem; margin-left: .25rem; }
.block > p { margin: -.4rem 0 .75rem; font-size: .85rem; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
.tbl td { padding: .55rem .6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl .flagcell { width: 26px; padding-right: 0; }
.tbl--narrow { max-width: 560px; }
.tbl--compact { font-size: .9rem; }
.tbl--compact td { padding: .35rem .5rem; }
.tbl caption { text-align: left; font-weight: 700; padding: .5rem .5rem; background: var(--surface-2); border-radius: 8px 8px 0 0; }
.tbl tr.is-empty td { color: var(--muted); }
.tbl tr.is-current td { background: var(--accent-soft); }
.tbl tr.is-winner td, .tbl tr.is-top1 td { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.tbl tr.is-top2 td, .tbl tr.is-top3 td { background: color-mix(in srgb, var(--gold) 6%, transparent); }
.lvl-note td { text-align: center; font-size: .82rem; font-weight: 600; padding: .3rem; }
.lvl-note--colorup td { background: color-mix(in srgb, var(--clock-colorup) 45%, transparent); }
.lvl-note--break td { background: color-mix(in srgb, var(--clock-break) 40%, transparent); }
.lvl-note--regend td { color: var(--bad); }
.lvl-note--dayend td { color: var(--info); }
.tables-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.tables-grid .tbl { border: 1px solid var(--line); border-radius: 8px; border-collapse: separate; border-spacing: 0; }
.flag { display: block; border-radius: 2px; }
.flag-code { font-size: .7rem; color: var(--muted); font-weight: 600; }

.search { margin-bottom: .75rem; }
.search input {
  width: 100%; max-width: 360px; font: inherit; padding: .6rem .85rem; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 1.25rem; font-size: .95rem; }
.prose { overflow-wrap: anywhere; }
.prose img { max-width: 100%; height: auto; }

@media (max-width: 560px) {
  .block { padding: 1rem .75rem; }
  .tbl { font-size: .88rem; }
  .tbl td, .tbl th { padding-left: .35rem; padding-right: .35rem; }
}

/* Embedded in an iframe: no chrome */
.is-embed { background: transparent; }
.is-embed .main { padding-top: 1rem; }
.is-embed .footer { border-top: 0; }
