/* ---------------------------------------------------------------------------
   BG Chess — brand theme
   Palette, typography and reusable "tz-*" components used by the redesigned
   pages (starting with the tournament hall). This file DOES NOT depend on
   Bootstrap; it can be included alongside it without conflicts.
   --------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Sofia+Sans:wght@400;500;600;700;800&family=Sofia+Sans+Condensed:wght@600;700&display=swap');

:root {
  /* Surfaces */
  --tz-bg:        #16181A;
  --tz-panel:     #1D2023;
  --tz-side:      #1A1D1F;
  --tz-elev:      #23272B;
  --tz-line:      rgba(242,238,230,.10);
  --tz-line-2:    rgba(242,238,230,.07);

  /* Ink */
  --tz-ink:       #F2EEE6;
  --tz-ink-dim:   rgba(242,238,230,.72);
  --tz-ink-mute:  rgba(242,238,230,.55);
  --tz-ink-faint: rgba(242,238,230,.4);
  --tz-ink-ghost: rgba(242,238,230,.28);

  /* Accents */
  --tz-green:     #2E9E6B;
  --tz-red:       #D3543C;
  --tz-gold:      #D9A22B;
  --tz-brown:     #8A6F4E;
  --tz-cream:     #E3D3B4;

  /* Board */
  --tz-brd-light: #E3D3B4;
  --tz-brd-dark:  #8A6F4E;
  --tz-brd-corner:#C9A96A;

  /* Type */
  --tz-font-ui:    'Sofia Sans', system-ui, -apple-system, sans-serif;
  --tz-font-cond:  'Sofia Sans Condensed', 'Sofia Sans', system-ui, sans-serif;
  --tz-font-mono:  'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;
}

/* ---- Base ---------------------------------------------------------------- */
html, body {
  background: var(--tz-bg);
  color: var(--tz-ink);
  font-family: var(--tz-font-ui);
}
body.tz-body { margin: 0; }

.tz-mono { font-family: var(--tz-font-mono); }
.tz-cond { font-family: var(--tz-font-cond); }

a.tz-link { color: var(--tz-green); text-decoration: none; }
a.tz-link:hover { text-decoration: underline; }

/* ---- Navbar ------------------------------------------------------------- */
.tz-nav {
  display: flex; align-items: center; gap: 26px;
  height: 58px; padding: 0 22px;
  background: var(--tz-panel);
  border-bottom: 1px solid var(--tz-line);
  line-height: 1;
}
.tz-nav-brand {
  display: inline-flex; align-items: center; gap: 8px;
  font: 800 19px/1 var(--tz-font-ui); color: var(--tz-ink);
  text-decoration: none;
}
.tz-nav-brand .tz-nav-brand-icon {
  width: 24px; height: 24px;
  object-fit: contain;
  display: inline-block;
  /* Nudge the boat icon up a hair so its visual center aligns with
     the flanking text baseline. */
  transform: translateY(-1px);
}
.tz-nav-brand .tz-nav-brand-sub {
  font: 500 10px/1 var(--tz-font-mono);
  color: var(--tz-brown); letter-spacing: .08em;
}
.tz-nav-links { display: flex; gap: 22px; align-items: center; }
.tz-nav-link {
  display: inline-flex; align-items: center;
  font: 600 13.5px/1 var(--tz-font-ui);
  color: var(--tz-ink-mute); text-decoration: none;
  /* Symmetric padding + box-shadow underline so the active state does NOT
     shift the link vertically — a real border-bottom would consume 2px of
     height and offset the text relative to the brand. */
  padding: 4px 0;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color .15s ease, box-shadow .15s ease;
}
.tz-nav-link.is-active {
  color: var(--tz-ink);
  box-shadow: inset 0 -2px 0 var(--tz-green);
}
.tz-nav-spacer { flex: 1; }

.tz-nav-countdown {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px;
  background: rgba(46,158,107,.12);
  border: 1px solid rgba(46,158,107,.35);
  border-radius: 6px;
}
.tz-nav-countdown .tz-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--tz-green);
}
.tz-nav-countdown-label {
  font: 600 11.5px/1 var(--tz-font-ui); color: rgba(242,238,230,.7);
}
.tz-nav-countdown-value {
  font: 700 15px/1 var(--tz-font-mono); color: var(--tz-ink);
}

.tz-nav-user { display: flex; align-items: center; gap: 10px; }

/* Burger — desktop hides it; mobile media query below shows it. */
.tz-nav-burger {
  display: none;
  background: transparent;
  border: 1px solid var(--tz-line);
  color: var(--tz-ink);
  padding: 6px 10px;
  border-radius: 6px;
  font: 500 18px/1 var(--tz-font-ui);
  cursor: pointer;
}
.tz-nav-burger:hover { border-color: rgba(242,238,230,.35); }
.tz-nav-rating {
  font: 500 12px/1 var(--tz-font-mono); color: var(--tz-ink-mute);
}
.tz-nav-avatar {
  width: 30px; height: 30px; border-radius: 6px;
  background: var(--tz-brown);
  display: flex; align-items: center; justify-content: center;
  font: 700 12px/1 var(--tz-font-ui); color: var(--tz-bg);
  text-decoration: none;
}
.tz-nav-flag {
  display: inline-flex; padding: 4px;
  background: transparent; border-radius: 4px;
}

/* Dark-theme override for Bootstrap dropdown menus used inside the tz-nav
   (Rules submenu, avatar menu, language menu). Bootstrap's default is a
   white surface which clashes with the brand palette. */
.tz-nav .dropdown-menu {
  background: var(--tz-panel);
  border: 1px solid var(--tz-line);
  padding: 6px;
  min-width: 180px;
  box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.tz-nav .dropdown-item {
  color: var(--tz-ink);
  font: 600 13px/1.4 var(--tz-font-ui);
  padding: 8px 12px;
  border-radius: 5px;
}
.tz-nav .dropdown-item:hover,
.tz-nav .dropdown-item:focus {
  background: rgba(46,158,107,.14);
  color: var(--tz-ink);
}
.tz-nav .dropdown-divider {
  border-top-color: var(--tz-line);
}

/* Active dropdown item (Rules variant, language flag) — gold accent.
   Border eats 2px, so trim padding by the same amount to keep layout
   stable when toggling active state. */
.tz-nav .dropdown-item.is-active {
  background: rgba(217,162,43,.10);
  border: 2px solid var(--tz-gold);
  padding: 6px 10px;
}

/* Language flag row: layout is centered, and the active flag gets the
   same gold accent (padding also trimmed for the border). */
.tz-nav .tz-lang-item {
  display: flex; justify-content: center;
  padding: 8px;
  border-radius: 5px;
  border: 2px solid transparent;
}
.tz-nav .tz-lang-item.is-active {
  border-color: var(--tz-gold);
  background: rgba(217,162,43,.10);
  padding: 6px;
}

/* ---- Mid-width navbar: countdown chip drops to a full-width 2nd row --
   Applies to iPad-portrait and small-laptop widths where the top row is
   still comfortable for brand+tabs+user but the countdown label would
   crowd the middle. Burger stays hidden — this is NOT collapsed mode. */
@media (max-width: 899px) {
  .tz-nav { flex-wrap: wrap; row-gap: 6px; }
  .tz-nav-countdown {
    order: 5;
    flex-basis: 100%;
    justify-content: center;
  }
}

/* ---- Mobile navbar: burger + collapsible menu -------------------------
   Activates below Bootstrap's `sm` breakpoint. iPhone Pro Max landscape
   (852 CSS px) intentionally sits ABOVE this — its wide viewport can
   still host the full desktop nav (with countdown wrapped by the 899
   rule above). */
@media (max-width: 767px) {
  .tz-nav {
    height: auto;
    padding: 10px 16px;
    gap: 12px;
  }
  .tz-nav-spacer { display: none; }
  .tz-nav-burger { display: inline-flex; margin-left: auto; }

  /* Everything else lives inside the collapsible menu — hidden until
     the burger toggles .is-open on the nav. */
  .tz-nav-links,
  .tz-nav-user {
    display: none;
    flex-basis: 100%;
    order: 20;
  }
  .tz-nav.is-open .tz-nav-links,
  .tz-nav.is-open .tz-nav-user {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }
  .tz-nav .tz-nav-link {
    padding: 10px 12px;
    border-radius: 6px;
    background: rgba(242,238,230,.03);
  }
  .tz-nav .tz-nav-link.is-active { background: rgba(46,158,107,.10); }

  /* Bootstrap dropdown-menu goes inline under its trigger instead of
     absolutely positioned — otherwise it'd float off the visible area.
     Solid tz-elev background so the nested items are readable (a near-
     transparent tint would blend into the panel above). */
  .tz-nav .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    padding: 4px;
    margin-top: 4px;
    background: var(--tz-elev);
    border: 1px solid var(--tz-line);
  }
  .tz-nav .dropdown-menu-end { right: auto; }

  /* Language flag menu: 5 flags in a row, compact. */
  .tz-nav-flag .dropdown-menu {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
  }
  .tz-nav-flag .dropdown-item { padding: 6px !important; }

  /* Скрий тригер-флага на mobile — редът с 5-те флага се показва директно
     в разгънатото меню, така тригерът е излишен и създава дублиращ флаг. */
  .tz-nav-flag > a[data-bs-toggle="dropdown"] { display: none; }
  .tz-nav-flag .dropdown-menu { display: flex; }

  /* Avatar row inside the collapsed menu: keep rating + avatar side by side. */
  .tz-nav-user { flex-direction: column !important; }
  .tz-nav-user > .dropdown,
  .tz-nav-user > .tz-nav-flag { width: 100%; }
  .tz-nav-user .tz-nav-avatar { width: 100%; border-radius: 6px; }
  .tz-nav-user .tz-nav-rating { text-align: center; }
}

/* ---- Buttons / chips / badges ------------------------------------------- */
.tz-btn {
  display: inline-block;
  font: 700 13px/1 var(--tz-font-ui);
  padding: 11px 20px; border-radius: 6px;
  text-decoration: none; cursor: pointer;
  border: 1px solid transparent;
  background: transparent; color: var(--tz-ink);
  transition: background .15s ease, border-color .15s ease;
}
.tz-btn-primary { background: var(--tz-green); color: #0E1210; }
.tz-btn-primary:hover { background: #35B579; }
.tz-btn-ghost {
  color: var(--tz-ink-dim);
  border-color: rgba(242,238,230,.18);
}
.tz-btn-ghost:hover { border-color: rgba(242,238,230,.35); }
.tz-btn-danger {
  color: var(--tz-red);
  border-color: rgba(211,84,60,.4);
}
.tz-btn-danger:hover { background: rgba(211,84,60,.08); }
.tz-btn form { margin: 0; }

.tz-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font: 600 11.5px/1 var(--tz-font-ui);
  color: var(--tz-ink-dim);
  padding: 6px 10px;
  background: rgba(242,238,230,.06);
  border-radius: 5px;
}
.tz-chip-gold {
  color: var(--tz-gold);
  border: 1px solid rgba(217,162,43,.35);
  background: rgba(217,162,43,.08);
}

.tz-eyebrow {
  font: 700 10.5px/1 var(--tz-font-mono);
  letter-spacing: .1em; color: var(--tz-ink-faint);
  text-transform: uppercase;
}
.tz-eyebrow-gold { color: var(--tz-gold); }

/* ---- Cards / hero ------------------------------------------------------- */
.tz-card {
  background: var(--tz-panel);
  border: 1px solid var(--tz-line);
  border-radius: 10px;
}

.tz-hero {
  display: flex; gap: 22px; align-items: stretch;
  padding: 20px 22px;
  background: linear-gradient(90deg, var(--tz-elev), var(--tz-panel));
  border: 1px solid var(--tz-line);
  border-radius: 10px;
}
.tz-hero-title {
  font: 800 30px/1.05 var(--tz-font-ui); color: var(--tz-ink);
  margin: 0 0 12px 0;
}
.tz-hero-clock {
  font: 700 58px/1 var(--tz-font-cond);
  color: var(--tz-ink); letter-spacing: -.01em;
}
.tz-hero-clock.is-danger { color: var(--tz-red); }

/* ---- Grid layouts (Hall) ------------------------------------------------ */
.tz-hall {
  display: grid; grid-template-columns: 1fr 372px;
  gap: 1px; background: var(--tz-line); min-height: calc(100vh - 58px);
}
.tz-hall-main { background: var(--tz-bg); padding: 22px; }
.tz-hall-side { background: var(--tz-side); padding: 22px 20px; }

@media (max-width: 999px) {
  .tz-hall { grid-template-columns: 1fr; }
}

/* ---- Pairings table ---------------------------------------------------- */
.tz-pairs { border: 1px solid var(--tz-line); border-radius: 8px; overflow: hidden; }
.tz-pairs-head, .tz-pairs-row {
  display: grid;
  grid-template-columns: 44px 1fr 74px 1fr 92px;
  align-items: center;
}
.tz-pairs-head {
  padding: 9px 14px;
  background: var(--tz-panel);
  font: 600 10.5px/1 var(--tz-font-mono);
  letter-spacing: .08em;
  color: var(--tz-ink-faint);
}
.tz-pairs-row {
  padding: 11px 14px;
  border-top: 1px solid var(--tz-line-2);
  background: var(--tz-panel);
}
.tz-pairs-row.is-you { background: rgba(46,158,107,.09); }
.tz-pairs-board { font: 500 12px/1 var(--tz-font-mono); color: var(--tz-ink-faint); }
.tz-pairs-side  { display: flex; align-items: center; gap: 8px;
                  font: 600 13px/1 var(--tz-font-ui); color: var(--tz-ink); }
.tz-pairs-side .tz-side-swatch {
  width: 9px; height: 9px; border-radius: 2px;
}
.tz-pairs-side.is-white .tz-side-swatch { background: var(--tz-cream); }
.tz-pairs-side.is-black .tz-side-swatch { background: #4A4038;
                                          border: 1px solid rgba(242,238,230,.25); }
.tz-pairs-elo { font: 500 11px/1 var(--tz-font-mono); color: var(--tz-ink-faint); }
.tz-pairs-res {
  text-align: center;
  font: 700 13px/1 var(--tz-font-mono);
  color: var(--tz-ink);
}
.tz-pairs-res.is-pending { color: var(--tz-ink-ghost); }
.tz-pairs-time {
  text-align: right;
  font: 600 12px/1 var(--tz-font-mono);
  color: var(--tz-green);
}
.tz-pairs-time.is-danger { color: var(--tz-red); }
.tz-pairs-time.is-ended  { color: var(--tz-ink-ghost); }

.tz-pairs-title-row {
  display: flex; align-items: baseline; gap: 10px; margin: 26px 0 12px;
}
.tz-pairs-title-row h2 {
  font: 700 15px/1 var(--tz-font-ui); color: var(--tz-ink); margin: 0;
}
.tz-pairs-count {
  font: 500 11.5px/1 var(--tz-font-mono); color: var(--tz-ink-faint);
}

/* ---- Standings --------------------------------------------------------- */
.tz-standings-head {
  display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px;
}
.tz-standings-head h2 {
  margin: 0; font: 700 14px/1 var(--tz-font-ui); color: var(--tz-ink);
}
.tz-stand-row {
  display: grid; grid-template-columns: 26px 1fr auto auto;
  align-items: center; gap: 10px;
  padding: 8px 8px; border-radius: 5px;
}
.tz-stand-row.is-you { background: rgba(46,158,107,.12); }
.tz-stand-rank {
  font: 700 12px/1 var(--tz-font-cond); color: var(--tz-ink-mute);
}
.tz-stand-name {
  font: 600 13px/1 var(--tz-font-ui); color: var(--tz-ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tz-stand-rating {
  font: 500 11px/1 var(--tz-font-mono); color: var(--tz-ink-faint);
}
.tz-stand-pts {
  font: 700 13px/1 var(--tz-font-mono);
  color: var(--tz-gold); min-width: 30px; text-align: right;
}

/* ---- Live spectator boards -------------------------------------------- */
.tz-live-header {
  display: flex; align-items: center; gap: 8px; margin-bottom: 12px;
}
.tz-live-header h2 {
  margin: 0; font: 700 14px/1 var(--tz-font-ui); color: var(--tz-ink);
}
.tz-live-header .tz-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--tz-red);
}
.tz-live-count {
  font: 500 11px/1 var(--tz-font-mono); color: var(--tz-ink-faint);
}
.tz-live-list { display: flex; flex-direction: column; gap: 10px; }
.tz-live-item {
  display: flex; gap: 12px; align-items: center;
  padding: 10px; background: var(--tz-bg);
  border: 1px solid rgba(242,238,230,.08); border-radius: 7px;
  text-decoration: none; color: inherit;
}
.tz-live-item:hover { border-color: rgba(46,158,107,.5); }
.tz-live-mini {
  flex: none; display: inline-flex; flex-direction: column;
  padding: 2px; background: var(--tz-panel);
  border-radius: 2px;
}
.tz-live-mini .tz-row { display: flex; }
.tz-live-mini .tz-cell {
  width: 12px; height: 12px;
  display: flex; align-items: center; justify-content: center;
  font: 700 8px/1 var(--tz-font-ui);
}
.tz-live-mini .tz-cell.is-light { background: var(--tz-brd-light); color: #26211A; }
.tz-live-mini .tz-cell.is-dark  { background: var(--tz-brd-dark);  color: #FFFDF8; }
.tz-live-mini .tz-cell .tz-glyph-w { text-shadow: -1px 0 #3A2E20,1px 0 #3A2E20,0 -1px #3A2E20,0 1px #3A2E20; }
.tz-live-mini .tz-cell.is-corner  {
  background: var(--tz-brd-dark);
  box-shadow: inset 0 0 0 1px var(--tz-brd-corner);
}
.tz-live-players {
  min-width: 0;
  font: 600 12.5px/1.3 var(--tz-font-ui); color: var(--tz-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tz-live-meta {
  font: 500 11px/1.4 var(--tz-font-mono); color: var(--tz-ink-faint);
}
.tz-live-cta {
  font: 600 11px/1 var(--tz-font-ui); color: var(--tz-green); flex: none;
}

/* ---- Divider ---------------------------------------------------------- */
.tz-divider {
  height: 1px; background: var(--tz-line); margin: 20px 0;
}

/* ---- Utility ---------------------------------------------------------- */
.tz-back {
  display: inline-block;
  font: 500 12px/1 var(--tz-font-ui);
  color: var(--tz-ink-mute); text-decoration: none;
  margin-bottom: 14px;
}
.tz-back:hover { color: var(--tz-ink); }

.tz-empty {
  padding: 24px;
  font: 500 13px/1.5 var(--tz-font-ui);
  color: var(--tz-ink-mute);
  text-align: center;
}

/* ---- Split-panel layout (welcome / auth) ------------------------------- */
.tz-split {
  /* 75:25 by design — the left column carries the brand hero + metrics +
     figure composition, the right column is only wide enough for the
     compact auth form. Individual pages may still override locally. */
  display: grid; grid-template-columns: 3fr 1fr;
  min-height: calc(100vh - 58px);
}
.tz-split-left {
  background: var(--tz-panel);
  padding: 44px 46px;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.tz-split-right {
  background: var(--tz-bg);
  /* Narrow right column — keep padding compact so the form itself has
     breathing room. Larger horizontal padding would eat the CTA width. */
  padding: 44px 28px;
  display: flex; flex-direction: column; justify-content: center;
}
@media (max-width: 767px) {
  .tz-split { grid-template-columns: 1fr; min-height: auto; }
  .tz-split-left { padding: 32px 24px; }
  .tz-split-right { padding: 32px 24px; }
}
.tz-hero-anon-title {
  font: 800 44px/1.08 var(--tz-font-ui);
  color: var(--tz-ink); max-width: 440px;
  letter-spacing: -.015em;
  margin: 0;
}
.tz-hero-anon-sub {
  font: 400 15px/1.55 var(--tz-font-ui);
  color: var(--tz-ink-mute); max-width: 420px;
  margin-top: 14px;
}
.tz-hero-metrics {
  display: flex; gap: 26px; margin-top: 30px;
  padding-top: 24px; border-top: 1px solid var(--tz-line);
  flex-wrap: wrap;
}
.tz-hero-metric-label {
  font: 700 10.5px/1 var(--tz-font-mono);
  letter-spacing: .1em; color: var(--tz-ink-faint);
  margin-bottom: 7px;
}
.tz-hero-metric-value {
  font: 700 40px/1 var(--tz-font-cond);
  color: var(--tz-ink);
}
.tz-hero-metric-value.is-green { color: var(--tz-green); }

/* ---- Forms ------------------------------------------------------------ */
.tz-form { display: flex; flex-direction: column; }
.tz-form-field { margin-bottom: 18px; }
.tz-form-field:last-child { margin-bottom: 0; }
.tz-label {
  display: block;
  font: 700 11px/1 var(--tz-font-mono);
  letter-spacing: .09em; color: var(--tz-ink-faint);
  margin-bottom: 8px;
  text-transform: uppercase;
}
.tz-input, .tz-select {
  width: 100%; box-sizing: border-box;
  padding: 14px 15px;
  background: var(--tz-panel);
  border: 1px solid rgba(242,238,230,.14);
  color: var(--tz-ink);
  border-radius: 7px;
  font: 500 14px/1 var(--tz-font-ui);
  transition: border-color .15s ease;
}
.tz-input:focus, .tz-select:focus {
  outline: none; border-color: var(--tz-green);
}
.tz-input.is-mono { font-family: var(--tz-font-mono); }
.tz-input[readonly], .tz-input:disabled {
  background: rgba(242,238,230,.03);
  color: var(--tz-ink-mute);
  cursor: not-allowed;
}
.tz-input-ro {
  padding: 14px 15px;
  background: rgba(242,238,230,.03);
  color: var(--tz-ink-mute);
  border: 1px solid rgba(242,238,230,.08);
  border-radius: 7px;
  font: 500 14px/1 var(--tz-font-ui);
}
.tz-hint {
  margin-top: 6px;
  font: 400 11.5px/1.45 var(--tz-font-ui);
  color: var(--tz-ink-faint);
}
.tz-btn-block {
  display: block; width: 100%; text-align: center;
  padding: 16px; font: 700 14.5px/1 var(--tz-font-ui);
}
.tz-check-row {
  display: flex; align-items: center; gap: 9px;
  margin-bottom: 24px;
  font: 500 13px/1 var(--tz-font-ui);
  color: var(--tz-ink-mute);
}
.tz-alert {
  padding: 12px 14px;
  border-radius: 7px;
  font: 500 13px/1.4 var(--tz-font-ui);
  margin-bottom: 16px;
}
.tz-alert-error {
  background: rgba(211,84,60,.10);
  border: 1px solid rgba(211,84,60,.4);
  color: #F5B5A5;
}
.tz-alert-ok {
  background: rgba(46,158,107,.10);
  border: 1px solid rgba(46,158,107,.4);
  color: #A9EFCB;
}
.tz-tabs {
  display: flex; gap: 26px; align-items: baseline;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--tz-line);
}
.tz-tab {
  font: 600 15px/1 var(--tz-font-ui);
  color: var(--tz-ink-mute);
  padding: 0 4px 12px; margin-bottom: -1px;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.tz-tab.is-active {
  color: var(--tz-ink);
  border-bottom-color: var(--tz-green);
  font-weight: 700;
}
.tz-divider-or {
  display: flex; align-items: center; gap: 12px;
  margin: 26px 0;
  font: 600 11px/1 var(--tz-font-mono);
  color: var(--tz-ink-faint);
}
.tz-divider-or::before, .tz-divider-or::after {
  content: ""; flex: 1; height: 1px; background: var(--tz-line);
}
.tz-btn-google {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; width: 100%; padding: 13px;
  background: #F2EEE6; color: #1a1a1a;
  border-radius: 7px; text-decoration: none;
  font: 600 13.5px/1 var(--tz-font-ui);
  border: none; cursor: pointer;
}
.tz-btn-google:hover { background: #E7E1D3; }
.tz-btn-google svg { width: 18px; height: 18px; flex: none; }

/* ---- Centered content shell (for verify pages, small cards) ---------- */
.tz-shell {
  min-height: calc(100vh - 58px);
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.tz-shell-card {
  width: 100%; max-width: 480px;
  background: var(--tz-panel);
  border: 1px solid var(--tz-line);
  border-radius: 10px;
  padding: 36px 40px;
  text-align: center;
}
.tz-shell-card h1 {
  font: 800 24px/1.1 var(--tz-font-ui);
  color: var(--tz-ink); margin: 0 0 12px;
}
.tz-shell-card p {
  font: 400 14px/1.55 var(--tz-font-ui);
  color: var(--tz-ink-dim); margin: 0 0 12px;
}
.tz-shell-icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 18px;
  font: 700 26px/1 var(--tz-font-ui);
}
.tz-shell-icon.is-info  { background: rgba(46,158,107,.14); color: var(--tz-green); }
.tz-shell-icon.is-check { background: rgba(46,158,107,.14); color: var(--tz-green); }

/* ---- Tournaments list — bucket cards --------------------------------- */
.tz-list-wrap {
  max-width: 1080px; margin: 0 auto;
  padding: 26px 22px;
}
.tz-list-hero {
  padding: 20px 22px; margin-bottom: 26px;
  background: linear-gradient(90deg, var(--tz-elev), var(--tz-panel));
  border: 1px solid var(--tz-line); border-radius: 10px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.tz-list-section { margin-top: 26px; }
.tz-list-section h2 {
  font: 700 15px/1 var(--tz-font-ui);
  color: var(--tz-ink); margin: 0 0 12px;
}
.tz-list-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px;
  background: var(--tz-panel);
  border: 1px solid var(--tz-line);
  border-radius: 8px; margin-bottom: 8px;
  text-decoration: none; color: inherit;
}
.tz-list-card:hover { border-color: rgba(46,158,107,.45); }
.tz-list-card-body { flex: 1; min-width: 0; }
.tz-list-card-title {
  font: 700 14px/1.3 var(--tz-font-ui);
  color: var(--tz-ink);
  margin-bottom: 5px;
}
.tz-list-card-meta {
  font: 500 12px/1.4 var(--tz-font-ui);
  color: var(--tz-ink-mute);
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
}
.tz-list-card-meta .tz-sep { color: var(--tz-ink-ghost); }
.tz-badge {
  display: inline-block;
  padding: 3px 8px; border-radius: 4px;
  font: 600 10.5px/1 var(--tz-font-mono);
  letter-spacing: .06em; text-transform: uppercase;
}
.tz-badge-reg  { background: rgba(46,158,107,.14);  color: #A9EFCB; }
.tz-badge-live { background: rgba(217,162,43,.14);  color: var(--tz-gold); }
.tz-badge-past { background: rgba(242,238,230,.06); color: var(--tz-ink-mute); }

/* ---- Rules pages ------------------------------------------------------ */
.tz-rules-wrap {
  display: grid; grid-template-columns: 240px 1fr;
  gap: 40px; max-width: 1180px;
  margin: 0 auto; padding: 32px 24px 64px;
}
.tz-rules-sidebar {
  position: sticky; top: 80px; align-self: start;
  display: flex; flex-direction: column; gap: 18px;
}
.tz-rules-sidebar h3 { margin: 0; }
.tz-rules-tabs {
  display: flex; flex-direction: column; gap: 4px;
}
.tz-rules-tab {
  padding: 10px 12px; border-radius: 6px;
  font: 600 13.5px/1.2 var(--tz-font-ui);
  color: var(--tz-ink-mute); text-decoration: none;
  border-left: 3px solid transparent;
}
.tz-rules-tab:hover { color: var(--tz-ink); }
.tz-rules-tab.is-active {
  background: rgba(46,158,107,.10);
  border-left-color: var(--tz-green);
  color: var(--tz-ink);
}
.tz-rules-anchors {
  display: flex; flex-direction: column;
  padding: 12px 0; border-top: 1px solid var(--tz-line);
}
.tz-rules-anchors a {
  font: 500 12.5px/1.4 var(--tz-font-ui);
  color: var(--tz-ink-faint);
  padding: 6px 12px 6px 15px; text-decoration: none;
  border-left: 2px solid transparent;
}
.tz-rules-anchors a:hover { color: var(--tz-ink-dim); }
.tz-rules-anchors a.is-active {
  color: var(--tz-ink);
  border-left-color: var(--tz-gold);
}
.tz-rules-other {
  padding-top: 12px; border-top: 1px solid var(--tz-line);
  font: 600 12.5px/1 var(--tz-font-ui);
}

.tz-rules-article {
  max-width: 760px;
  font: 400 15px/1.65 var(--tz-font-ui);
  color: var(--tz-ink-dim);
}
.tz-rules-article h1 {
  font: 800 32px/1.15 var(--tz-font-ui);
  color: var(--tz-ink);
  margin: 0 0 18px;
}
.tz-rules-article h2 {
  font: 700 20px/1.2 var(--tz-font-ui);
  color: var(--tz-gold);
  margin: 36px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--tz-line);
}
.tz-rules-article h3 {
  font: 700 15px/1.3 var(--tz-font-ui);
  color: var(--tz-ink);
  margin: 22px 0 6px;
}
.tz-rules-article p  { margin: 0 0 12px; }
.tz-rules-article ul { margin: 0 0 16px; padding-left: 22px; }
.tz-rules-article li { margin: 4px 0; }
.tz-rules-article strong { color: var(--tz-ink); }
.tz-rules-article code {
  font: 500 13px/1 var(--tz-font-mono);
  color: var(--tz-gold);
  background: rgba(217,162,43,.08);
  padding: 1px 5px; border-radius: 3px;
}

.tz-rules-diagram {
  display: flex; justify-content: center;
  margin: 20px 0 28px;
}

.tz-piece-block {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 10px 12px; margin: 8px 0;
  background: var(--tz-panel);
  border: 1px solid var(--tz-line);
  border-radius: 8px;
}
.tz-piece-icon {
  width: 40px; height: 40px; flex: none;
  user-select: none;
}
.tz-piece-block > div { flex: 1; }
.tz-piece-name {
  display: inline; font-weight: 700; color: var(--tz-ink);
  margin-right: 6px;
}

@media (max-width: 767px) {
  .tz-rules-wrap { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px 40px; }
  .tz-rules-sidebar { position: static; }
  .tz-rules-tabs { flex-direction: row; }
  .tz-rules-tab { flex: 1; text-align: center; border-left: none; border-bottom: 3px solid transparent; }
  .tz-rules-tab.is-active { border-bottom-color: var(--tz-green); border-left-color: transparent; }
  .tz-rules-anchors { flex-direction: row; flex-wrap: wrap; }
  .tz-rules-anchors a { border-left: none; }
}
