/* ============================================================
   Balance Martial Arts & Gaming — shared brand stylesheet
   One place to edit brand colors. Every page uses these tokens.
   ============================================================ */
:root {
  --bg:        #0e0f13;   /* page background (deep charcoal)   */
  --surface:   #191b22;   /* card background                   */
  --surface-2: #22252e;   /* card hover / borders              */
  --text:      #f4f5f7;   /* primary text                      */
  --muted:     #9aa0ad;   /* secondary text                    */
  --accent:    #c81e27;   /* brand red   (from logo)           */
  --accent-2:  #f5c518;   /* brand gold  (from logo flames)    */
  --ring:      rgba(200, 30, 39, .35);

  --radius: 18px;
  --maxw: 560px;
  --shadow: 0 10px 30px rgba(0,0,0,.35);

  /* default game accent (overridden per event page via [data-game]) */
  --game: var(--accent);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(200,30,39,.18), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(245,197,24,.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100dvh;
  line-height: 1.5;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 32px 20px 48px; }

/* ── Header ─────────────────────────────────────────── */
.header { text-align: center; margin-bottom: 22px; }
.logo {
  display: block; width: 100%; max-width: 340px; height: auto;
  margin: 0 auto 8px;
  filter: drop-shadow(0 8px 24px rgba(200,30,39,.28));
}
.logo.sm { max-width: 190px; }
.brand { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.tagline { color: var(--muted); font-size: 15px; margin: 4px 0 0; }
.welcome {
  display: inline-block; margin-top: 14px; padding: 6px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--surface-2);
  color: var(--muted); font-size: 13px; font-weight: 600;
}
.welcome b { color: var(--text); }

/* ── Link tiles ─────────────────────────────────────── */
.tiles { display: grid; gap: 14px; margin-top: 26px; }
.tile {
  display: flex; align-items: center; gap: 16px; padding: 18px;
  background: var(--surface); border: 1px solid var(--surface-2);
  border-radius: var(--radius); color: var(--text); text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .12s ease, border-color .12s ease, background .12s ease;
}
.tile:active { transform: scale(.985); }
@media (hover: hover) { .tile:hover { border-color: var(--accent); background: var(--surface-2); } }
.tile .icon {
  flex: 0 0 auto; width: 48px; height: 48px; border-radius: 12px;
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: #fff;
}
.tile .icon svg { width: 24px; height: 24px; }
.tile .text { flex: 1 1 auto; min-width: 0; }
.tile .title { display: block; font-weight: 700; font-size: 17px; }
.tile .sub { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.tile .chev { flex: 0 0 auto; color: var(--muted); width: 20px; height: 20px; }

/* Quick chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 2px 6px; }
.chip {
  text-decoration: none; font-size: 13px; font-weight: 600; color: var(--text);
  background: var(--surface); border: 1px solid var(--surface-2);
  padding: 8px 12px; border-radius: 999px; transition: border-color .12s ease;
}
.chip:active { transform: scale(.97); }
@media (hover: hover) { .chip:hover { border-color: var(--accent-2); } }

/* ── Social row ─────────────────────────────────────── */
.social-label {
  text-align: center; color: var(--muted); font-size: 13px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; margin: 30px 0 14px;
}
.social { display: flex; justify-content: center; gap: 14px; }
.social a {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--surface-2); color: var(--text);
  transition: transform .12s ease, border-color .12s ease;
}
.social a:active { transform: scale(.94); }
@media (hover: hover) { .social a:hover { border-color: var(--accent); } }
.social svg { width: 26px; height: 26px; }

/* ── Store info ─────────────────────────────────────── */
.info {
  margin-top: 34px; padding: 20px; background: var(--surface);
  border: 1px solid var(--surface-2); border-radius: var(--radius); text-align: center;
}
.info .row { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0; }
.info a { color: var(--text); text-decoration: none; }
.info a:active { color: var(--accent); }
.info svg { width: 16px; height: 16px; color: var(--accent); flex: 0 0 auto; }
.info .hours { color: var(--muted); font-size: 13px; margin-top: 10px; line-height: 1.6; }

.footer-note { text-align: center; color: var(--muted); font-size: 12px; margin-top: 22px; }
.footer-note b { color: var(--text); }

/* ============================================================
   EVENT PAGES
   Each event page sets [data-game] on <body> to theme --game.
   ============================================================ */
body[data-game="pokemon"]  { --game: #ffcb05; }
body[data-game="onepiece"] { --game: #ff5a5f; }
body[data-game="riftbound"]{ --game: #17c0d6; }
body[data-game="mtg"]      { --game: #a07bff; }

.event-hero {
  position: relative; margin-top: 6px; padding: 26px 22px 24px;
  background:
    radial-gradient(600px 220px at 50% -30%, color-mix(in srgb, var(--game) 26%, transparent), transparent 70%),
    var(--surface);
  border: 1px solid var(--surface-2);
  border-top: 3px solid var(--game);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.event-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--game); font-size: 12px; font-weight: 800;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 10px;
}
.event-kicker .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--game);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--game) 60%, transparent);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--game) 55%, transparent); }
  70%  { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.event-title { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.01em; }
.event-sub { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* Table badge — the thing a scanning customer looks for */
.table-badge {
  display: inline-flex; flex-direction: column; align-items: center;
  margin-top: 20px; padding: 14px 30px; min-width: 150px;
  background: var(--bg); border: 2px solid var(--game); border-radius: 16px;
}
.table-badge .lbl {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); font-weight: 700;
}
.table-badge .num { font-size: 44px; font-weight: 800; line-height: 1; color: var(--game); margin-top: 4px; }
.table-badge.unknown { border-style: dashed; border-color: var(--surface-2); }
.table-badge.unknown .num { font-size: 22px; color: var(--muted); font-weight: 700; margin-top: 6px; }

/* Content area for future features (registration, results, pairings) */
.event-body { margin-top: 18px; display: grid; gap: 14px; }
.panel {
  background: var(--surface); border: 1px solid var(--surface-2);
  border-radius: var(--radius); padding: 18px 18px; box-shadow: var(--shadow);
}
.panel h2 { margin: 0 0 6px; font-size: 16px; }
.panel p { margin: 0; color: var(--muted); font-size: 14px; }
.panel.placeholder { border-style: dashed; background: transparent; box-shadow: none; text-align: center; }
.panel.placeholder .tag {
  display: inline-block; margin-bottom: 8px; padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--game); border: 1px solid color-mix(in srgb, var(--game) 45%, var(--surface-2));
}

/* Buttons / actions */
.event-actions { margin-top: 18px; display: grid; gap: 12px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 15px 18px; border-radius: 14px; font-weight: 700; font-size: 15px;
  text-decoration: none; text-align: center; cursor: pointer; border: 1px solid transparent;
  transition: transform .12s ease, border-color .12s ease, background .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.985); }
.btn.primary { background: linear-gradient(150deg, var(--accent), var(--accent-2)); color: #fff; }
.btn.game { background: color-mix(in srgb, var(--game) 90%, black 10%); color: #0e0f13; }
.btn.ghost { background: var(--surface); border-color: var(--surface-2); color: var(--text); }
@media (hover: hover) { .btn.ghost:hover { border-color: var(--game); } }

/* Notice banner (event turned off, etc.) */
.notice {
  margin-top: 18px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--surface-2);
  color: var(--muted); font-size: 14px; text-align: center;
}
.notice a { color: var(--text); font-weight: 700; text-decoration: none; }
.notice.warn { border-color: color-mix(in srgb, var(--accent) 50%, var(--surface-2)); }

/* ============================================================
   CONFIG / CONTROL PANEL
   ============================================================ */
.status {
  margin-top: 6px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--surface-2);
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px;
}
.status .live-dot {
  width: 12px; height: 12px; border-radius: 50%; background: var(--dot, var(--muted));
  flex: 0 0 auto; box-shadow: 0 0 0 4px color-mix(in srgb, var(--dot, var(--muted)) 22%, transparent);
}
.status .txt { flex: 1 1 auto; min-width: 0; }
.status .k { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.status .v { font-size: 20px; font-weight: 800; }

.section-label {
  margin: 26px 2px 12px; font-size: 12px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); font-weight: 700;
}

.switch-row {
  display: flex; align-items: center; gap: 14px; padding: 15px 16px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--surface-2); border-radius: 14px;
  transition: border-color .12s ease;
}
.switch-row[data-on="true"] { border-color: var(--rowc, var(--accent-2)); }
.switch-row .swatch { width: 14px; height: 14px; border-radius: 4px; background: var(--rowc, var(--muted)); flex: 0 0 auto; }
.switch-row .name { flex: 1 1 auto; font-weight: 700; font-size: 16px; }
.switch-row .name small { display: block; font-weight: 500; color: var(--muted); font-size: 12px; margin-top: 1px; }
.switch-row a.prev { color: var(--muted); text-decoration: none; font-size: 12px; font-weight: 700; padding: 6px 8px; }
.switch-row a.prev:active { color: var(--text); }

/* iOS-style toggle */
.toggle { position: relative; width: 52px; height: 31px; flex: 0 0 auto; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.toggle .track {
  position: absolute; inset: 0; background: var(--surface-2); border-radius: 999px;
  transition: background .16s ease;
}
.toggle .knob {
  position: absolute; top: 3px; left: 3px; width: 25px; height: 25px; border-radius: 50%;
  background: #fff; transition: transform .16s ease; box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.toggle input:checked + .track { background: var(--rowc, var(--accent)); }
.toggle input:checked ~ .knob { transform: translateX(21px); }

/* Publish box */
.publish { margin-top: 8px; padding: 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--surface-2); box-shadow: var(--shadow); }
.publish.hidden { display: none; }
.publish .lead { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.publish .lead b { color: var(--text); }
.codebox {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 15px;
  background: var(--bg); border: 1px solid var(--surface-2); border-radius: 12px;
  padding: 14px 16px; color: var(--accent-2); word-break: break-all; margin-bottom: 12px;
}
.btn-row { display: grid; gap: 10px; }
@media (min-width: 420px) { .btn-row { grid-template-columns: 1fr 1fr; } }
.steps { margin: 14px 0 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.steps b { color: var(--text); }
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); font-weight: 700; font-size: 14px;
  padding: 12px 20px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Fade-in */
@media (prefers-reduced-motion: no-preference) {
  .header, .tiles > *, .social-label, .social, .info, .footer-note,
  .event-hero, .event-body > *, .event-actions, .status, .switch-row, .publish {
    animation: rise .5s cubic-bezier(.2,.7,.3,1) both;
  }
  .tiles > *:nth-child(1), .event-body > *:nth-child(1) { animation-delay: .05s; }
  .tiles > *:nth-child(2), .event-body > *:nth-child(2) { animation-delay: .10s; }
  .tiles > *:nth-child(3) { animation-delay: .15s; }
  .tiles > *:nth-child(4) { animation-delay: .20s; }
  .tiles > *:nth-child(5) { animation-delay: .25s; }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
}
