/* ==========================================================================
   MeraCricket design system — "Pitch Day"
   Warm, grounded cricket identity. Keeps the terracotta brand (#e2704d)
   but tones it down with cream, sand, warm neutrals and crisp whites.
   Mobile-first, progressive disclosure, accessible tap targets.
   ========================================================================== */

:root {
  /* warm neutral ramp */
  --cream: #f7f3ef;
  --sand: #efe8e1;
  --stone: #d8cfc6;
  --pebble: #a89b91;
  --taupe: #756a62;
  --ink: #2a211c;
  --charcoal: #3d322b;

  /* dark mode surfaces (default) */
  --bg-0: #0f0c0a;
  --bg-1: #181410;
  --panel: #211b16;
  --panel-2: #2b231d;
  --panel-3: #362c25;
  --line: #453a32;
  --line-soft: #2e2520;

  /* text */
  --text: #f7f3ef;
  --muted: #b8aca3;
  --faint: #8a7d74;

  /* brand & accents */
  --brand: #e2704d;
  --brand-soft: rgba(226, 112, 77, 0.12);
  --brand-ink: #2a0f08;
  --brand-dim: #c45d3d;
  --accent: #7fb069;          /* pitch green */
  --accent-strong: #6a9c55;
  --accent-ink: #0f1e0b;
  --accent-soft: rgba(127, 176, 105, 0.14);
  --gold: #e6b84d;
  --blue: #5ea1ff;
  --red: #e85d6c;
  --red-soft: rgba(232, 93, 108, 0.12);
  --amber: #f0a030;

  /* gradients */
  --grad-hero: radial-gradient(130% 140% at 15% 0%, rgba(226, 112, 77, 0.16) 0%, rgba(127, 176, 105, 0.08) 46%, var(--bg-1) 100%);
  --grad-card: linear-gradient(160deg, var(--panel-2) 0%, var(--panel) 100%);
  --grad-live: linear-gradient(135deg, rgba(127, 176, 105, 0.12) 0%, rgba(232, 93, 108, 0.08) 100%);
  --grad-auction: radial-gradient(130% 120% at 50% -10%, rgba(94, 161, 255, 0.10) 0%, var(--bg-1) 55%, var(--bg-0) 100%);
  --grad-brand: linear-gradient(160deg, var(--brand) 0%, var(--brand-dim) 100%);

  /* spacing scale (8px grid) */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s7: 28px; --s8: 32px; --s10: 40px;

  /* radii */
  --r-s: 8px; --r-m: 12px; --r-l: 16px; --r-xl: 20px; --r-pill: 999px;

  /* elevation */
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.35);
  --sh-2: 0 6px 18px rgba(0, 0, 0, 0.38);
  --sh-3: 0 18px 48px rgba(0, 0, 0, 0.55);
  --sh-glow: 0 0 0 1px rgba(226, 112, 77, 0.40), 0 8px 30px rgba(226, 112, 77, 0.14);

  /* type scale */
  --fs-xs: 11px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 17px;
  --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 34px; --fs-4xl: 46px;

  /* motion */
  --t-fast: 0.12s; --t: 0.22s; --t-slow: 0.4s;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);

  --tabbar-h: 68px;
  --topbar-h: 56px;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg-0: #f7f3ef;
    --bg-1: #ffffff;
    --panel: #ffffff;
    --panel-2: #f5f0eb;
    --panel-3: #ebe4dd;
    --line: #d8cfc6;
    --line-soft: #efe8e1;
    --text: #2a211c;
    --muted: #756a62;
    --faint: #a89b91;
    --grad-card: linear-gradient(160deg, #ffffff 0%, #f9f6f3 100%);
    --grad-hero: radial-gradient(130% 140% at 15% 0%, rgba(226, 112, 77, 0.10) 0%, rgba(127, 176, 105, 0.06) 46%, var(--bg-1) 100%);
    --grad-live: linear-gradient(135deg, rgba(127, 176, 105, 0.10) 0%, rgba(232, 93, 108, 0.06) 100%);
    --sh-1: 0 1px 2px rgba(42, 33, 28, 0.06);
    --sh-2: 0 6px 18px rgba(42, 33, 28, 0.10);
    --sh-3: 0 18px 48px rgba(42, 33, 28, 0.14);
  }
  body { background-image: none; }
  .scorebug { background: linear-gradient(180deg, var(--panel-2) 0%, rgba(245, 240, 235, 0.96) 100%); }
  .room-wrap { background: var(--grad-card); }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-0);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", sans-serif;
  font-size: var(--fs-md);
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  background-image:
    radial-gradient(90% 50% at 50% -10%, rgba(226, 112, 77, 0.10) 0%, transparent 60%),
    radial-gradient(70% 40% at 85% 0%, rgba(127, 176, 105, 0.08) 0%, transparent 55%);
  background-attachment: fixed;
}

.num, .score, .fig, td.num, th.num, .stat-value, .timer-ring, .bid-amount {
  font-variant-numeric: tabular-nums;
}

/* focus ring */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* ---------- shell ---------- */

#topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4);
  padding-top: calc(var(--s3) + env(safe-area-inset-top, 0px));
  min-height: var(--topbar-h);
  background: color-mix(in srgb, var(--bg-1) 86%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: var(--s2); }
#brand {
  font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.02em;
  color: var(--text); text-decoration: none; display: flex; align-items: center; gap: var(--s2);
}
#brand .brandmark { flex: none; }
#brand .brand-word { display: flex; align-items: baseline; gap: 1px; }
#brand em { font-style: normal; color: var(--brand); }
#nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
#nav::-webkit-scrollbar { display: none; }
#nav a {
  color: var(--muted); text-decoration: none; font-size: var(--fs-sm); font-weight: 600;
  padding: 8px 12px; border-radius: var(--r-pill); white-space: nowrap;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  min-height: 36px; display: inline-flex; align-items: center;
}
#nav a:hover { color: var(--text); background: rgba(255,255,255,0.04); }
#nav a:active { transform: scale(0.96); }
#nav a.active { color: var(--brand); background: var(--brand-soft); }

.more-menu { position: relative; }
.more-menu > summary, .more-btn {
  list-style: none; cursor: pointer; color: var(--muted); font-size: var(--fs-sm); font-weight: 600;
  padding: 8px 12px; border-radius: var(--r-pill); white-space: nowrap; min-height: 36px;
  display: inline-flex; align-items: center; user-select: none;
}
.more-btn { background: transparent; border: 0; font-family: inherit; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-menu > summary:hover, .more-btn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.more-menu[open] > summary, .more-btn:hover { color: var(--text); }
.more-list {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  background: var(--card, #1b1512); border: 1px solid var(--line-soft, rgba(255,255,255,0.08));
  border-radius: var(--r-md, 14px); padding: 6px; min-width: 180px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
}
.more-list a { justify-content: flex-start; width: 100%; box-sizing: border-box; }

.mobback {
  display: none;
  align-items: center; gap: 4px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--muted); font-size: var(--fs-sm); font-weight: 700;
  padding: 6px 10px; min-height: 34px; cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.mobback .ic { width: 18px; height: 18px; }
.mobback:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.mobback:active { transform: scale(0.95); }

.mobmenu {
  display: none;
  align-items: center; justify-content: center;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--muted); min-height: 36px; min-width: 36px; cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
.mobmenu .ic { width: 20px; height: 20px; }
.mobmenu:hover { color: var(--text); background: rgba(255,255,255,0.04); }
.mobmenu:active { transform: scale(0.95); }

.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 50;
  width: min(280px, 80vw);
  background: var(--bg-1);
  border-left: 1px solid var(--line-soft);
  transform: translateX(100%);
  transition: transform var(--t) var(--ease-out);
  display: flex; flex-direction: column;
  padding: var(--s4);
  padding-top: calc(var(--s4) + env(safe-area-inset-top, 0px));
}
.drawer.open { transform: translateX(0); }
.drawer[aria-hidden="true"] { pointer-events: none; }
.drawer-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--s4);
}
.drawer-title { font-size: var(--fs-lg); font-weight: 800; }
.drawer-nav { display: flex; flex-direction: column; gap: 4px; }
.drawer-nav a {
  color: var(--muted); text-decoration: none; font-weight: 700;
  padding: 12px var(--s3); border-radius: var(--r-lg);
  transition: color var(--t-fast), background var(--t-fast);
}
.drawer-nav a:hover, .drawer-nav a.active { color: var(--brand); background: var(--brand-soft); }

#upgrade {
  background: var(--grad-brand); color: #fff; border-color: transparent;
  font-weight: 700; font-size: var(--fs-sm); min-height: 36px; padding: 8px 14px;
  box-shadow: 0 4px 14px rgba(226, 112, 77, 0.22);
}
#upgrade:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(226, 112, 77, 0.28); }

main#app {
  max-width: 960px; margin: 0 auto; padding: var(--s4);
  padding-bottom: calc(var(--tabbar-h) + var(--s6) + env(safe-area-inset-bottom, 0px));
  min-height: calc(100vh - var(--topbar-h));
}
main#app.room { max-width: 1120px; }

/* view transitions */
.view-enter { animation: viewIn var(--t) var(--ease-out); }
.view-exit { animation: viewOut var(--t) var(--ease) forwards; }
@keyframes viewIn {
  from { opacity: 0; transform: translateX(22px); }
  to { opacity: 1; transform: none; }
}
@keyframes viewOut {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateX(-18px); }
}

/* loading state */
#app.is-loading { opacity: 0.65; transition: opacity var(--t) var(--ease); }

/* ---------- breadcrumb / back bar ---------- */

#crumbbar {
  position: sticky; top: var(--topbar-h); z-index: 35;
  display: flex; align-items: center; gap: var(--s2);
  padding: var(--s2) var(--s4);
  background: color-mix(in srgb, var(--bg-1) 90%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
#backbtn {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--muted); font-size: var(--fs-sm); font-weight: 700;
  padding: 6px 12px; min-height: 34px; cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), transform var(--t-fast);
}
#backbtn:hover { color: var(--text); background: rgba(255,255,255,0.04); }
#backbtn:active { transform: scale(0.95); }
#crumbs { display: flex; align-items: center; gap: var(--s2); overflow-x: auto; scrollbar-width: none; }
#crumbs::-webkit-scrollbar { display: none; }
.crumb, .crumb-sep { color: var(--faint); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap; }
.crumb { text-decoration: none; transition: color var(--t-fast); }
.crumb[href]:hover { color: var(--brand); }
.crumb.cur { color: var(--text); }
.crumb-sep { opacity: 0.5; }

/* ---------- bottom tab bar ---------- */

#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: none;
  background: color-mix(in srgb, var(--bg-1) 94%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
}
#tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 3px; color: var(--faint); text-decoration: none; font-size: 9px; font-weight: 700;
  letter-spacing: 0.02em; text-transform: uppercase; white-space: nowrap; overflow: hidden;
  padding-top: 10px; min-width: 0;
  transition: color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
  position: relative;
}
#tabbar a .ic { width: 22px; height: 22px; }
#tabbar a.active { color: var(--brand); }
#tabbar a.active::after {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand);
}
#tabbar a.tab-new { padding-top: 0; }
#tabbar a.tab-new .tab-fab {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  margin-top: -16px; border: 4px solid var(--bg-0);
  box-shadow: var(--sh-2);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
#tabbar a.tab-new:active .tab-fab { transform: scale(0.92); }
#tabbar a.tab-new .ic { width: 26px; height: 26px; }

@media (max-width: 720px) {
  #nav { display: none; }
  #tabbar { display: flex; }
  #topbar { padding: var(--s2) var(--s3); gap: var(--s2); }
  .mobback { display: inline-flex; }
  .mobmenu { display: inline-flex; }
  #upgrade { padding: 7px 10px; font-size: var(--fs-xs); min-height: 32px; }
  #brand .brand-word em { display: none; }
}
@media (min-width: 721px) {
  main#app { padding-bottom: var(--s8); }
}

/* ---------- typography ---------- */

h1 { font-size: var(--fs-2xl); margin: var(--s2) 0 var(--s4); letter-spacing: -0.02em; line-height: 1.15; }
h2 {
  font-size: var(--fs-xs); margin: var(--s6) 0 var(--s3); color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700;
}
h3 { font-size: var(--fs-lg); margin: 0 0 var(--s3); line-height: 1.25; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.center { text-align: center; }
.small { font-size: var(--fs-sm); }

/* ---------- cards & layout ---------- */

.card {
  background: var(--grad-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-l);
  padding: var(--s5);
  margin-bottom: var(--s5);
  box-shadow: var(--sh-1), 0 1px 0 rgba(255,255,255,0.02) inset;
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.card.flush { padding: 0; overflow: hidden; }
.card.glow { border-color: rgba(226, 112, 77, 0.45); box-shadow: var(--sh-glow); }
.card-stack { display: grid; gap: var(--s4); }
.row { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s4); }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } }

/* ---------- buttons ---------- */

button, .btn {
  font: inherit; font-weight: 600; color: var(--text);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--r-m);
  padding: 12px 18px; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
  user-select: none;
  touch-action: manipulation;
}
button:hover, .btn:hover { background: var(--panel-3); border-color: var(--stone); }
button:active, .btn:active { transform: scale(0.965); }
button.primary, .btn.primary {
  background: var(--grad-brand);
  border-color: transparent; color: #fff; font-weight: 700;
  box-shadow: 0 4px 18px rgba(226, 112, 77, 0.28);
}
button.primary:hover, .btn.primary:hover { filter: brightness(1.06); box-shadow: 0 6px 22px rgba(226, 112, 77, 0.34); }
button.danger, .btn.danger { background: #3d1420; border-color: #6b2233; color: #ffb3bb; }
button.warn, .btn.warn { background: #3a2c0c; border-color: #6b5317; color: #ffd98a; }
button.ghost, .btn.ghost { background: transparent; border-color: var(--line); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
button.big, .btn.big { font-size: var(--fs-xl); font-weight: 800; padding: 18px; min-height: 64px; }
button.block, .btn.block { width: 100%; }

/* ---------- pills, chips, badges ---------- */

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 11px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.pill.live { background: rgba(232, 93, 108, 0.13); color: #ff949f; }
.pill.live::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red);
  animation: livePulse 1.6s var(--ease) infinite;
}
@keyframes livePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232, 93, 108, 0.55); opacity: 1; }
  50% { box-shadow: 0 0 0 6px rgba(232, 93, 108, 0); opacity: 0.7; }
}
.pill.done { background: var(--panel-3); color: var(--muted); }
.pill.soon { background: rgba(240, 160, 48, 0.12); color: #f8c46a; }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 6px 12px;
  font-size: var(--fs-sm); font-weight: 600;
}

/* ---------- forms ---------- */

label { display: block; font-size: var(--fs-sm); color: var(--muted); margin: var(--s3) 0 var(--s1); font-weight: 600; }
input, select, textarea {
  font: inherit; width: 100%; padding: 13px 14px; border-radius: var(--r-m);
  border: 1px solid var(--line); background: var(--bg-1); color: var(--text);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(226, 112, 77, 0.15);
}
input[type="checkbox"] { width: auto; min-width: 20px; min-height: 20px; margin-right: 10px; accent-color: var(--brand); }
label.check { color: var(--text); font-weight: 500; display: flex; align-items: center; min-height: 44px; }

.help-text { font-size: var(--fs-sm); color: var(--faint); margin-top: var(--s1); }
.field-error { font-size: var(--fs-sm); color: var(--red); margin-top: var(--s1); display: flex; align-items: center; gap: 4px; }
.field-error::before { content: "•"; }

/* switch toggle */
.switch { position: relative; display: inline-flex; align-items: center; gap: var(--s3); cursor: pointer; color: var(--text); font-weight: 500; margin: var(--s2) 0; min-height: 44px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  width: 46px; height: 26px; border-radius: var(--r-pill); background: var(--panel-3);
  border: 1px solid var(--line); position: relative; flex: none;
  transition: background var(--t) var(--ease), border-color var(--t) var(--ease);
}
.switch .track::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--muted);
  transition: transform var(--t) var(--ease-spring), background var(--t) var(--ease);
}
.switch input:checked + .track { background: var(--brand); border-color: var(--brand-dim); }
.switch input:checked + .track::after { transform: translateX(20px); background: #fff; }

/* ---------- tables ---------- */

.tblwrap { overflow-x: auto; border-radius: var(--r-m); border: 1px solid var(--line-soft); -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th {
  color: var(--faint); font-weight: 700; font-size: var(--fs-xs);
  text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(255, 255, 255, 0.02);
}
tbody tr:last-child td { border-bottom: none; }
tbody tr { transition: background var(--t-fast) var(--ease); }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
td.num, th.num { text-align: right; }
tr.hl td { background: rgba(226, 112, 77, 0.07); }

/* ---------- skeleton loaders (branded) ---------- */

.skeleton {
  border-radius: var(--r-m);
  background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.sk-line { height: 14px; margin: 10px 0; }
.sk-card { height: 110px; margin-bottom: var(--s4); border-radius: var(--r-l); }
.sk-hero { height: 180px; margin-bottom: var(--s4); border-radius: var(--r-xl); }
.sk-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin-bottom: var(--s4); }
.sk-stripcard { height: 96px; border-radius: var(--r-l); }
.sk-scorebug { height: 140px; border-radius: 0 0 var(--r-l) var(--r-l); margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4); }
.sk-pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-bottom: var(--s4); }
.sk-key { height: 72px; border-radius: var(--r-m); }
.sk-table { height: 200px; border-radius: var(--r-m); }
.sk-ring { width: 220px; height: 220px; border-radius: 50%; margin: 0 auto var(--s4); }
.sk-profilehead { height: 90px; border-radius: var(--r-l); margin-bottom: var(--s4); }
.sk-statgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: var(--s3); }
.sk-stat { height: 80px; border-radius: var(--r-m); }

/* ---------- empty states ---------- */

.empty {
  text-align: center; padding: var(--s10) var(--s5);
  border: 1.5px dashed var(--line); border-radius: var(--r-xl);
  color: var(--muted); margin-bottom: var(--s5);
  background: rgba(255, 255, 255, 0.02);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03);
}
.empty .empty-icon { font-size: 48px; display: block; margin-bottom: var(--s3); opacity: 0.95; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.empty strong { color: var(--text); display: block; margin-bottom: var(--s2); font-size: var(--fs-xl); letter-spacing: -0.01em; }
.empty .btn { margin-top: var(--s4); }

/* ---------- dashboard hero ---------- */

.hero {
  border-radius: var(--r-xl); padding: var(--s6) var(--s5);
  background: var(--grad-hero);
  border: 1px solid var(--line-soft);
  margin-bottom: var(--s5);
  box-shadow: var(--sh-2);
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -80px; top: -80px;
  width: 240px; height: 240px; border-radius: 50%;
  border: 34px solid rgba(226, 112, 77, 0.06);
  pointer-events: none;
}
.hero .kicker { color: var(--brand); font-size: var(--fs-xs); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; }
.hero h1 { margin: var(--s2) 0 var(--s1); font-size: var(--fs-3xl); }
.hero p { color: var(--muted); margin: 0 0 var(--s4); max-width: 46ch; }

/* quick-action cards on home */
.qa-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); margin-bottom: var(--s5); }
@media (max-width: 480px) { .qa-grid { grid-template-columns: 1fr; } }
.qa-card {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--grad-card); border: 1px solid var(--line-soft); border-radius: var(--r-l);
  padding: var(--s4); text-decoration: none; color: var(--text);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.qa-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--sh-2); }
.qa-card:active { transform: scale(0.985); }
.qa-card .qa-ic {
  width: 48px; height: 48px; border-radius: var(--r-m); flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
}
.qa-card .qa-title { font-weight: 800; font-size: var(--fs-md); }
.qa-card .qa-sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.qa-card.qa-primary { border-color: rgba(226, 112, 77, 0.35); background: linear-gradient(160deg, rgba(226, 112, 77, 0.08), var(--panel) 60%); }
.qa-card.qa-primary .qa-ic { background: var(--brand-soft); color: var(--brand); }

.match-card {
  display: block; text-decoration: none; color: var(--text);
  background: var(--grad-card); border: 1px solid var(--line-soft);
  border-radius: var(--r-l); padding: var(--s4); margin-bottom: var(--s3);
  box-shadow: var(--sh-1);
  transition: transform var(--t) var(--ease), border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.match-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--sh-2); }
.match-card.is-live { background: var(--grad-live); border-color: rgba(232, 93, 108, 0.30); }
.match-card .mc-top { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); }
.match-card .mc-name { font-weight: 800; font-size: var(--fs-lg); letter-spacing: -0.01em; }
.match-card .mc-score { font-size: var(--fs-xl); font-weight: 800; margin-top: var(--s2); font-variant-numeric: tabular-nums; }
.match-card .mc-meta { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s1); }
.match-card .mc-actions { display: flex; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; }
.match-card .mc-actions .btn { min-height: 40px; padding: 8px 14px; font-size: var(--fs-sm); }

/* live strip */
.live-strip { display: flex; gap: var(--s3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--s2); scrollbar-width: none; }
.live-strip::-webkit-scrollbar { display: none; }
.ls-card {
  flex: 0 0 min(280px, 82vw); scroll-snap-align: start;
  display: block; text-decoration: none; color: var(--text);
  background: var(--grad-card); border: 1px solid var(--line-soft); border-radius: var(--r-l);
  padding: var(--s4); box-shadow: var(--sh-1);
  transition: transform var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.ls-card:hover { transform: translateY(-2px); border-color: var(--line); }
.ls-card .ls-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--s2); }
.ls-card .ls-rule { font-size: var(--fs-xs); color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.ls-card .ls-name { font-weight: 800; font-size: var(--fs-lg); margin-bottom: var(--s2); }
.ls-card .ls-inn { display: flex; align-items: baseline; gap: var(--s2); margin-bottom: var(--s1); }
.ls-card .ls-side { color: var(--muted); font-size: var(--fs-sm); }
.ls-card .ls-fig { font-weight: 900; font-size: var(--fs-xl); color: var(--text); }
.ls-card .ls-ov { color: var(--faint); font-size: var(--fs-xs); }
.ls-card .ls-cta { display: inline-flex; align-items: center; gap: 4px; margin-top: var(--s2); color: var(--brand); font-size: var(--fs-sm); font-weight: 700; }

/* ---------- scoring screen ---------- */

.scorebug {
  position: sticky; top: 0; z-index: 30;
  margin: calc(-1 * var(--s4)) calc(-1 * var(--s4)) var(--s4);
  padding: var(--s3) var(--s4);
  padding-top: calc(var(--s3) + env(safe-area-inset-top, 0px));
  background: linear-gradient(180deg, var(--panel-2) 0%, rgba(33, 27, 22, 0.96) 100%);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--sh-2);
}
.scorebug .sb-top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.scorebug .sb-team { font-weight: 700; font-size: var(--fs-sm); color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.scorebug .sb-score { font-size: var(--fs-3xl); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.scorebug .sb-score.tick { animation: scoreTick 0.45s var(--ease-spring); }
@keyframes scoreTick {
  0% { transform: scale(1); }
  35% { transform: scale(1.14); color: var(--brand); }
  100% { transform: scale(1); }
}
.scorebug .sb-overs { color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.scorebug .sb-crr { color: var(--accent); font-weight: 800; font-size: var(--fs-sm); }
.scorebug .sb-target { color: var(--gold); font-weight: 700; font-size: var(--fs-sm); }
.scorebug .sb-freehit {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--gold); color: #3a2a00; font-size: var(--fs-xs); font-weight: 800;
  animation: fhBlink 1s var(--ease) infinite;
}
@keyframes fhBlink { 50% { opacity: 0.55; } }
.sb-people { display: flex; gap: var(--s2); margin-top: var(--s2); flex-wrap: wrap; }
.sb-person {
  flex: 1; min-width: 140px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft);
  border-radius: var(--r-m); padding: 8px 12px;
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
}
.sb-person .pname { font-weight: 700; font-size: var(--fs-sm); display: flex; align-items: center; gap: 6px; }
.sb-person .fig { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; font-variant-numeric: tabular-nums; }
.sb-person.onstrike { border-color: rgba(127, 176, 105, 0.55); }
.strike-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent); flex: none; }

.this-over { display: flex; align-items: center; gap: var(--s2); margin: var(--s2) 0 var(--s4); flex-wrap: wrap; }
.this-over .to-label { font-size: var(--fs-xs); color: var(--faint); font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; }

.balldots { display: flex; gap: 6px; flex-wrap: wrap; }
.balldots .bd {
  min-width: 40px; height: 40px; padding: 0 6px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel-2); border: 1px solid var(--line);
  font-size: var(--fs-sm); font-weight: 800; font-variant-numeric: tabular-nums;
  animation: dotIn 0.3s var(--ease-spring);
}
@keyframes dotIn { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.balldots .bd.w { background: var(--red-soft); border-color: var(--red); color: #ffb3bb; }
.balldots .bd.b4 { border-color: var(--blue); color: var(--blue); box-shadow: 0 0 10px rgba(94, 161, 255, 0.22); }
.balldots .bd.b6 { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 10px rgba(230, 184, 77, 0.25); }

/* run pad */
.runpad { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-bottom: var(--s3); }
.runpad button {
  font-size: 32px; font-weight: 800; min-height: 84px; border-radius: var(--r-l);
  font-variant-numeric: tabular-nums;
  background: var(--grad-card);
  box-shadow: var(--sh-1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  touch-action: manipulation;
}
@media (max-width: 720px) {
  /* one-thumb scoring: the pad sticks to the bottom on phones */
  .runpad { position: sticky; bottom: calc(var(--tabbar-h) + 4px); z-index: 30; background: var(--bg-0); padding: var(--s2) 0; }
  .runpad button { min-height: 92px; font-size: 34px; }
}
.runpad button:hover { transform: translateY(-1px); }
.runpad button.r0 { color: var(--muted); }
.runpad button.r4 { border-color: var(--blue); color: var(--blue); background: linear-gradient(160deg, rgba(94,161,255,0.14), var(--panel)); }
.runpad button.r6 { border-color: var(--gold); color: var(--gold); background: linear-gradient(160deg, rgba(230,184,77,0.14), var(--panel)); }
.runpad button.wk { grid-column: span 2; background: linear-gradient(160deg, #521b28, #33101a); border-color: var(--red); color: #ffb3bb; font-size: var(--fs-xl); letter-spacing: 0.04em; }

.extrasrow { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin-bottom: var(--s3); }
.extrasrow button { min-height: 60px; font-weight: 700; font-size: var(--fs-md); border-radius: var(--r-l); }
.extrasrow.cols2 { grid-template-columns: repeat(2, 1fr); }
.extrasrow.cols3 { grid-template-columns: repeat(3, 1fr); }

.more-extras { display: none; }
.more-extras.open { display: grid; }
.more-toggle {
  width: 100%; margin-bottom: var(--s3); color: var(--muted); font-weight: 700;
  background: transparent; border-style: dashed;
}
.more-toggle .chevron { transition: transform var(--t) var(--ease); }
.more-toggle.open .chevron { transform: rotate(180deg); }

.actrow { display: grid; grid-template-columns: 1.4fr 1fr; gap: var(--s3); }
.actrow button { min-height: 64px; font-size: var(--fs-lg); font-weight: 800; border-radius: var(--r-l); }

/* ball-by-ball feed */
.feed { display: flex; flex-direction: column; gap: 2px; }
.feed .fi {
  display: flex; align-items: center; gap: var(--s3); padding: 9px 12px;
  border-radius: var(--r-m); font-size: var(--fs-sm);
  animation: feedIn 0.35s var(--ease);
}
@keyframes feedIn { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.feed .fi:nth-child(odd) { background: rgba(255, 255, 255, 0.02); }
.feed .fi .fb { font-weight: 800; min-width: 44px; font-variant-numeric: tabular-nums; }
.feed .fi .fb.w { color: var(--red); }
.feed .fi .fb.b4 { color: var(--blue); }
.feed .fi .fb.b6 { color: var(--gold); }
.feed .fi .fd { color: var(--muted); }

/* boundary celebration overlay */
.celebrate {
  position: fixed; inset: 0; z-index: 90; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.celebrate .cb {
  font-size: clamp(48px, 14vw, 110px); font-weight: 900; letter-spacing: -0.02em;
  padding: var(--s4) var(--s8); border-radius: var(--r-xl);
  animation: cbPop 1.5s var(--ease) forwards;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.6);
}
.celebrate .cb.four { color: var(--blue); }
.celebrate .cb.six { color: var(--gold); }
@keyframes cbPop {
  0% { opacity: 0; transform: scale(0.4) rotate(-4deg); }
  14% { opacity: 1; transform: scale(1.08) rotate(1deg); }
  26% { transform: scale(1); }
  72% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05) translateY(-16px); }
}

/* ---------- scoring rule banners & helpers ---------- */
.winprob { margin: var(--s3) 0; }
.winprob .wp-bar { height: 10px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.winprob .wp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--brand)); border-radius: 999px; transition: width 0.4s var(--ease); }
.winprob .wp-labels { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); margin-top: 4px; font-weight: 700; }
.chart { width: 100%; height: auto; color: var(--muted); }
.banner {
  padding: var(--s3) var(--s4);
  border-radius: var(--r-l);
  font-weight: 800;
  font-size: var(--fs-sm);
  text-align: center;
  margin-bottom: var(--s3);
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
}
.banner.jackpot {
  background: linear-gradient(135deg, rgba(230, 184, 77, 0.18), rgba(226, 112, 77, 0.10));
  border: 1px solid rgba(230, 184, 77, 0.45);
  color: var(--gold);
}
.banner.challenge {
  background: linear-gradient(135deg, rgba(94, 161, 255, 0.16), rgba(127, 176, 105, 0.10));
  border: 1px solid rgba(94, 161, 255, 0.40);
  color: var(--blue);
}
.quota-strip {
  display: flex; align-items: center; gap: var(--s2);
  flex-wrap: wrap;
  margin-bottom: var(--s3);
  color: var(--muted);
  font-size: var(--fs-xs);
}
.quota-strip .pill { background: var(--panel-3); }
.actrow { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
.actrow button { min-height: 56px; font-size: var(--fs-lg); font-weight: 800; border-radius: var(--r-l); }
.row.wrap { flex-wrap: wrap; }

/* ---------- notifications ---------- */
.notif-bell { position: relative; display: inline-flex; align-items: center; padding: 6px; }
.notif-badge {
  position: absolute; top: 0; right: 0;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 999px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.notif.unread { border-left: 3px solid var(--brand); }

/* ---------- showcase extras ---------- */
.showcase-label.big { font-size: var(--fs-2xl); font-weight: 800; text-align: center; margin: var(--s6) 0; text-transform: uppercase; letter-spacing: 0.08em; }
.showcase-match { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r-l); padding: var(--s4) var(--s5); margin-bottom: var(--s3); }
.showcase-match .sm-name { font-weight: 700; font-size: var(--fs-lg); }
.showcase-match .sm-score { font-size: var(--fs-xl); margin-top: 4px; }
.showcase-match .sm-result { color: var(--gold); font-weight: 700; margin-top: 4px; }
.showcase-empty { text-align: center; color: var(--muted); padding: var(--s8) 0; }
.showcase-dots { display: inline-flex; gap: 6px; }
.showcase-dots .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.showcase-dots .dot.on { background: var(--brand); }

/* ---------- modal (bottom sheet) ---------- */

#modalwrap, #passwrap {
  position: fixed; inset: 0; background: rgba(2, 5, 10, 0.7);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center; z-index: 60;
  animation: fadeIn var(--t-fast) var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
#modal {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--r-xl) var(--r-xl) 0 0; width: 100%; max-width: 600px;
  padding: var(--s5); padding-bottom: calc(var(--s5) + env(safe-area-inset-bottom, 0px));
  max-height: 86vh; overflow-y: auto;
  box-shadow: var(--sh-3);
  animation: sheetUp 0.3s var(--ease-spring);
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: none; opacity: 1; } }
#modal h3 { margin: 0 0 var(--s4); font-size: var(--fs-xl); letter-spacing: -0.01em; }
#modal .opts { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
#modal .opts button { min-height: 58px; font-weight: 700; }
#modal .opts button.span { grid-column: 1 / -1; }
@media (max-width: 480px) { #modal .opts { grid-template-columns: 1fr; } }

/* ---------- toasts ---------- */

#toasts {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--s4) + env(safe-area-inset-bottom, 0px));
  z-index: 100; display: flex; flex-direction: column; gap: var(--s2); align-items: center;
  width: min(92vw, 460px); pointer-events: none;
}
@media (min-width: 721px) { #toasts { bottom: var(--s6); } }
.toast {
  background: var(--panel-3); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 12px 18px; font-weight: 600; font-size: var(--fs-sm);
  box-shadow: var(--sh-3); width: 100%; text-align: center;
  animation: toastIn 0.28s var(--ease-spring);
}
.toast.out { animation: toastOut 0.25s var(--ease) forwards; }
.toast.err { border-color: #6b2233; background: #33101a; color: #ffb3bb; }
.toast.ok { border-color: rgba(127, 176, 105, 0.5); }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(0.95); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ---------- setup: preset cards ---------- */

.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--s3); margin: var(--s2) 0 var(--s4); }
.preset-card {
  text-align: left; background: var(--grad-card); border: 1px solid var(--line-soft);
  border-radius: var(--r-l); padding: var(--s4); cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; gap: 4px; min-height: 0;
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.preset-card:hover { transform: translateY(-2px); }
.preset-card.sel { border-color: var(--brand); box-shadow: var(--sh-glow); }
.preset-card .pc-name { font-weight: 800; font-size: var(--fs-md); }
.preset-card .pc-desc { color: var(--muted); font-size: var(--fs-sm); line-height: 1.35; }
.preset-card .pc-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.preset-card .pc-tags span {
  font-size: var(--fs-xs); font-weight: 700; color: var(--faint);
  background: var(--bg-1); border-radius: var(--r-pill); padding: 2px 8px;
}

/* ---------- scorecard ---------- */

.inns-tabs { display: flex; gap: var(--s2); margin: var(--s3) 0 var(--s4); flex-wrap: wrap; }
.inns-tabs button {
  min-height: 44px; padding: 9px 16px; border-radius: var(--r-pill); font-weight: 700; font-size: var(--fs-sm);
}
.inns-tabs button.sel { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.sc-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.sc-total { font-size: var(--fs-2xl); font-weight: 800; font-variant-numeric: tabular-nums; }

/* wagon wheel */
.wagon { display: block; margin: 0 auto; max-width: 340px; width: 100%; }
.wagon .field { fill: rgba(127, 176, 105, 0.06); stroke: rgba(127, 176, 105, 0.4); }
.wagon .ring { fill: none; stroke: rgba(127, 176, 105, 0.22); stroke-dasharray: 4 5; }
.wagon .pitch { fill: rgba(255, 255, 255, 0.07); stroke: rgba(255, 255, 255, 0.2); }
.wagon .shot { stroke-width: 2.4; stroke-linecap: round; opacity: 0.9; }
.wagon .shot.s4 { stroke: var(--blue); }
.wagon .shot.s6 { stroke: var(--gold); }
.wagon .shot.sr { stroke: var(--muted); }
.wagon .shot-dot { stroke: var(--bg-0); stroke-width: 1; }

/* ---------- auction room ---------- */

.room-wrap {
  border-radius: var(--r-xl);
  background: var(--grad-auction);
  border: 1px solid var(--line-soft);
  box-shadow: var(--sh-3);
  padding: var(--s5);
  margin-bottom: var(--s4);
  position: relative; overflow: hidden;
}
.room-wrap::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  opacity: 0.7;
}
.room-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.room-head h1 { margin: 0; font-size: var(--fs-xl); }
.poolbar { height: 8px; border-radius: var(--r-pill); background: var(--panel-3); overflow: hidden; margin: var(--s2) 0 var(--s4); }
.poolbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); border-radius: var(--r-pill); transition: width 0.5s var(--ease); }

.lot-stage { display: grid; grid-template-columns: 1fr auto; gap: var(--s5); align-items: center; margin-bottom: var(--s4); }
@media (max-width: 720px) { .lot-stage { grid-template-columns: 1fr; } }

.lot-card { text-align: center; }
.lot-card .mono {
  width: 96px; height: 96px; margin: 0 auto var(--s3);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-3xl); font-weight: 900; letter-spacing: 0.02em;
  background: conic-gradient(from 210deg, var(--panel-3), #3a4a3a, var(--panel-3));
  border: 2px solid var(--line);
  box-shadow: var(--sh-2), inset 0 2px 10px rgba(255, 255, 255, 0.06);
  color: var(--text);
}
.lot-card .lot-name { font-size: var(--fs-3xl); font-weight: 900; letter-spacing: -0.02em; line-height: 1.1; }
.lot-card .lot-meta { color: var(--muted); margin-top: var(--s2); font-weight: 600; }

.timer-ring { position: relative; width: 220px; height: 220px; margin: 0 auto; }
.timer-ring svg { transform: rotate(-90deg); display: block; }
.timer-ring .tr-track { fill: none; stroke: var(--panel-3); stroke-width: 10; }
.timer-ring .tr-arc {
  fill: none; stroke: var(--brand); stroke-width: 10; stroke-linecap: round;
  transition: stroke-dashoffset 0.25s linear, stroke var(--t) var(--ease);
}
.timer-ring.low .tr-arc { stroke: var(--red); }
.timer-ring .tr-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 2px;
}
.timer-ring .bid-amount { font-size: var(--fs-3xl); font-weight: 900; line-height: 1; }
.timer-ring .bid-team { color: var(--brand); font-weight: 800; font-size: var(--fs-sm); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timer-ring .tr-secs { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.timer-ring.low .tr-secs { color: var(--red); animation: fhBlink 1s var(--ease) infinite; }

.bidfeed { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; margin: var(--s3) 0; }
.bidfeed .bf {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--line-soft);
  border-radius: var(--r-m); padding: 9px 14px; font-size: var(--fs-sm);
  animation: bidIn 0.4s var(--ease-spring);
}
@keyframes bidIn {
  0% { opacity: 0; transform: translateY(-12px) scale(0.96); }
  100% { opacity: 1; transform: none; }
}
.bidfeed .bf .bfa { font-weight: 900; font-variant-numeric: tabular-nums; }
.bidfeed .bf .bft { font-weight: 700; }
.bidfeed .bf.top { border-color: rgba(226, 112, 77, 0.5); background: var(--brand-soft); }

.inc-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s3); margin: var(--s3) 0; }
.inc-row button { min-height: 64px; font-size: var(--fs-xl); font-weight: 900; border-radius: var(--r-l); font-variant-numeric: tabular-nums; }
.gavel-row { display: grid; grid-template-columns: 1.5fr 1fr; gap: var(--s3); }
.gavel-row button { min-height: 68px; font-size: var(--fs-xl); font-weight: 900; border-radius: var(--r-l); }

.purse-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--s3); }
.purse-card {
  background: var(--grad-card); border: 1px solid var(--line-soft); border-radius: var(--r-l);
  padding: var(--s3) var(--s4); transition: border-color var(--t) var(--ease), box-shadow var(--t) var(--ease);
}
.purse-card.leading { border-color: rgba(226, 112, 77, 0.55); box-shadow: var(--sh-glow); }
.purse-card.sel { border-color: var(--brand); }
.purse-card .pc-tname { font-weight: 800; display: flex; justify-content: space-between; align-items: center; gap: var(--s2); }
.purse-card .pc-purse { font-size: var(--fs-xl); font-weight: 900; margin-top: 2px; font-variant-numeric: tabular-nums; }
.purse-card .pc-bar { height: 6px; border-radius: var(--r-pill); background: var(--panel-3); overflow: hidden; margin-top: 8px; }
.purse-card .pc-bar i { display: block; height: 100%; background: var(--gold); border-radius: var(--r-pill); transition: width 0.5s var(--ease); }
.purse-card .pc-squad { color: var(--muted); font-size: var(--fs-xs); margin-top: 6px; line-height: 1.5; white-space: normal; }

/* SOLD stamp overlay */
.sold-overlay {
  position: fixed; inset: 0; z-index: 95; pointer-events: none;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: var(--s3);
  background: radial-gradient(60% 60% at 50% 45%, rgba(5, 10, 18, 0.55), transparent 75%);
}
.sold-stamp {
  font-size: clamp(54px, 16vw, 130px); font-weight: 900; letter-spacing: 0.02em;
  color: var(--brand); -webkit-text-stroke: 2px rgba(42, 15, 8, 0.6);
  transform: rotate(-7deg);
  animation: stampIn 1.9s var(--ease) forwards;
  text-shadow: 0 10px 50px rgba(226, 112, 77, 0.35);
}
.sold-stamp.unsold { color: var(--red); text-shadow: 0 10px 50px rgba(232, 93, 108, 0.35); }
.sold-sub {
  font-size: var(--fs-xl); font-weight: 800; color: var(--text);
  animation: stampSub 1.9s var(--ease) forwards;
}
.sold-gavel { font-size: 64px; animation: gavelSwing 1.9s var(--ease) forwards; transform-origin: 80% 20%; }
@keyframes stampIn {
  0% { opacity: 0; transform: scale(2.4) rotate(-14deg); }
  16% { opacity: 1; transform: scale(0.94) rotate(-7deg); }
  24% { transform: scale(1.04) rotate(-7deg); }
  32%, 78% { transform: scale(1) rotate(-7deg); opacity: 1; }
  100% { opacity: 0; transform: scale(1) rotate(-7deg) translateY(-12px); }
}
@keyframes stampSub {
  0%, 18% { opacity: 0; transform: translateY(10px); }
  30%, 78% { opacity: 1; transform: none; }
  100% { opacity: 0; }
}
@keyframes gavelSwing {
  0% { opacity: 0; transform: rotate(-50deg) translateY(-30px); }
  10% { opacity: 1; transform: rotate(24deg); }
  18% { transform: rotate(-8deg); }
  24% { transform: rotate(3deg); }
  30%, 80% { transform: rotate(0deg); opacity: 1; }
  100% { opacity: 0; }
}

/* podium */
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: var(--s3); align-items: end; margin: var(--s4) 0; }
.podium .pod {
  text-align: center; border-radius: var(--r-l) var(--r-l) 0 0;
  padding: var(--s4) var(--s2); border: 1px solid var(--line-soft); border-bottom: none;
  background: var(--grad-card);
}
.podium .pod.p1 { padding-top: var(--s6); background: linear-gradient(180deg, rgba(230, 184, 77, 0.14), var(--panel)); border-color: rgba(230, 184, 77, 0.4); }
.podium .pod .medal {
  width: 40px; height: 40px; margin: 0 auto var(--s2); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: var(--fs-lg);
  background: var(--panel-3); color: var(--muted); border: 1px solid var(--line);
}
.podium .pod.p1 .medal { background: linear-gradient(160deg, #ffe9a3, var(--gold)); color: #4a3200; border: none; box-shadow: 0 4px 16px rgba(230, 184, 77, 0.35); }
.podium .pod.p2 .medal { background: linear-gradient(160deg, #e8edf3, #9fb0c8); color: #2c3a4f; border: none; }
.podium .pod.p3 .medal { background: linear-gradient(160deg, #e8b48a, #b06a3b); color: #3d2110; border: none; }
.podium .pod .pod-name { font-weight: 800; font-size: var(--fs-sm); }
.podium .pod .pod-price { color: var(--gold); font-weight: 900; font-size: var(--fs-lg); font-variant-numeric: tabular-nums; }
.podium .pod .pod-team { color: var(--muted); font-size: var(--fs-xs); }

/* rank medals on leaderboards */
.rank { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; font-weight: 900; font-size: var(--fs-sm); background: var(--panel-3); color: var(--muted); }
.rank.r1 { background: linear-gradient(160deg, #ffe9a3, var(--gold)); color: #4a3200; }
.rank.r2 { background: linear-gradient(160deg, #e8edf3, #9fb0c8); color: #2c3a4f; }
.rank.r3 { background: linear-gradient(160deg, #e8b48a, #b06a3b); color: #3d2110; }

/* ---------- tournaments ---------- */

.structure-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); margin: var(--s2) 0 var(--s3); }
@media (max-width: 640px) { .structure-grid { grid-template-columns: 1fr; } }
.nrr-pos { color: var(--accent); }
.nrr-neg { color: var(--red); }

.td-tabs { display: flex; gap: var(--s2); margin: var(--s4) 0; border-bottom: 1px solid var(--line-soft); }
.td-tab {
  flex: 1; background: transparent; border: none; border-bottom: 2px solid transparent; border-radius: 0;
  color: var(--muted); font-weight: 700; padding: 12px; min-height: 44px; cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.td-tab.sel { color: var(--brand); border-bottom-color: var(--brand); }

.reg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.reg-grid .span2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .reg-grid { grid-template-columns: 1fr; } }

.cf-row { display: grid; grid-template-columns: 1fr 110px 1fr auto auto; gap: 8px; align-items: center; margin-bottom: 10px; }
.cf-row input, .cf-row select { min-height: 42px; }
.cf-row label.check { margin: 0; min-height: auto; }
@media (max-width: 720px) { .cf-row { grid-template-columns: 1fr 1fr; } .cf-row .remove-cf { grid-column: 1 / -1; } }

.reg-entries { display: grid; gap: var(--s4); }
.reg-card h3 { margin: 0; }
.reg-meta { margin-top: 12px; display: grid; gap: 4px; color: var(--muted); font-size: var(--fs-sm); }
.reg-answers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* ---------- stat cards (profiles) ---------- */

.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: var(--s3); }
.stat-card {
  background: var(--grad-card); border: 1px solid var(--line-soft); border-radius: var(--r-l);
  padding: var(--s3) var(--s4); text-align: center;
}
.stat-card .stat-value { font-size: var(--fs-2xl); font-weight: 900; line-height: 1.15; }
.stat-card .stat-label { color: var(--faint); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 2px; }

/* ---------- floating action button ---------- */

.fab {
  position: fixed; right: var(--s4); bottom: calc(var(--tabbar-h) + var(--s4) + env(safe-area-inset-bottom, 0px));
  z-index: 42;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--grad-brand); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--sh-3);
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.fab:hover { box-shadow: 0 8px 30px rgba(226, 112, 77, 0.35); }
.fab:active { transform: scale(0.92); }
@media (min-width: 721px) { .fab { bottom: var(--s4); } }

/* ---------- misc ---------- */

.divider { height: 1px; background: var(--line-soft); margin: var(--s4) 0; border: none; }
.linklist { display: flex; flex-direction: column; gap: var(--s2); }
.error-card { border-color: #6b2233; }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s4); margin-top: var(--s5); }
@media (max-width: 720px) { .plan-grid { grid-template-columns: 1fr; } }
.plan-card { display: flex; flex-direction: column; }
.plan-card.current { border-color: rgba(226, 112, 77, 0.45); box-shadow: var(--sh-glow); }
.plan-price { font-size: var(--fs-3xl); font-weight: 900; margin: var(--s2) 0 var(--s4); }
.plan-period { font-size: var(--fs-sm); color: var(--muted); font-weight: 600; }
.plan-perks { list-style: none; padding: 0; margin: 0 0 var(--s4); flex: 1; }
.plan-perks li { padding: 6px 0; border-bottom: 1px solid var(--line-soft); color: var(--muted); font-size: var(--fs-sm); }
.plan-perks li:last-child { border-bottom: none; }
.usage-bar { margin-bottom: var(--s4); }

.avatar-mono {
  width: 42px; height: 42px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: var(--fs-sm);
  background: conic-gradient(from 210deg, var(--panel-3), #4a4a3a, var(--panel-3));
  border: 1px solid var(--line);
}
.avatar-mono.big { width: 64px; height: 64px; font-size: var(--fs-xl); }

.player-pick-box { max-height: 220px; overflow-y: auto; border: 1px solid var(--line-soft); border-radius: var(--r-m); padding: var(--s2); }
.player-pick-box label.check { gap: var(--s2); }
.squad-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.squad-chips .chip { padding-left: 6px; }
.squad-chips .avatar-mono { width: 26px; height: 26px; font-size: 10px; }

.big-ic { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto var(--s3); display: flex; align-items: center; justify-content: center; background: var(--panel-3); color: var(--text); font-size: 36px; }
.gold-ic { background: rgba(230, 184, 77, 0.12); color: var(--gold); }

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001s !important;
  }
  .skeleton { animation: none; background: var(--panel-2); }
}

.sealed-grid { display: grid; gap: var(--s3); }
.sealed-row { display: grid; grid-template-columns: 1.5fr 1fr 1fr auto; gap: var(--s3); align-items: center; background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft); border-radius: var(--r-m); padding: var(--s3); }
.sealed-row.disabled { opacity: 0.5; }
.sealed-row .sr-name { font-weight: 800; }
.sealed-row .sr-purse { color: var(--muted); font-size: var(--fs-sm); }
.sealed-row input { min-height: 44px; }
@media (max-width: 720px) { .sealed-row { grid-template-columns: 1fr 1fr; } .sealed-row input { grid-column: 1; } .sealed-row button { grid-column: 2; } .sealed-row .sr-purse { display: none; } }

.dutch-stage { text-align: center; margin: var(--s4) 0; }
.dutch-price { font-size: clamp(48px, 12vw, 96px); font-weight: 900; font-variant-numeric: tabular-nums; color: var(--brand); line-height: 1; }
.dutch-label { color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.12em; font-size: var(--fs-xs); margin-bottom: var(--s4); }

.nom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.nom-block { background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft); border-radius: var(--r-m); padding: var(--s3); }
.nom-block .nb-head { font-weight: 800; margin-bottom: var(--s2); }
.nom-block .nb-pool { margin-top: var(--s2); }
.nom-select { min-height: 48px; }

/* ---------- tracker ---------- */
.tracker-card { display: grid; gap: var(--s4); }
.tracker-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); text-align: center; }
.tracker-stats .stat-label { display: block; font-size: var(--fs-xs); color: var(--faint); text-transform: uppercase; letter-spacing: 0.04em; }
.tracker-stats .stat-value { display: block; font-size: var(--fs-2xl); font-weight: 800; margin-top: var(--s1); }
.tracker-actions { display: flex; gap: var(--s3); flex-wrap: wrap; }
.tracker-actions .btn { flex: 1 1 120px; }
.tracker-msg { padding: var(--s3); border-radius: var(--r-m); background: var(--panel-2); font-size: var(--fs-sm); }
.tracker-msg.error { background: var(--red-soft); color: var(--red); }
.health-list { list-style: none; padding: 0; margin: var(--s3) 0 0; display: grid; gap: var(--s2); }
.health-list li { display: flex; justify-content: space-between; padding: var(--s3); background: var(--panel-2); border-radius: var(--r-m); font-size: var(--fs-sm); }
.health-list li.empty { justify-content: center; color: var(--faint); }

/* ---------- teams & registration additions ---------- */
.avatar-stack { display: flex; align-items: center; }
.avatar-stack .avatar-mono.xs,
.avatar-stack .avatar-mono.more { margin-left: -8px; border: 2px solid var(--panel); }
.avatar-stack .avatar-mono.xs:first-child { margin-left: 0; }
.avatar-mono.xs { width: 28px; height: 28px; font-size: 10px; }
.avatar-mono.more { background: var(--panel-2); color: var(--muted); }

.player-picker { max-height: 220px; overflow-y: auto; display: grid; gap: var(--s2); }
.player-picker .check { display: flex; align-items: center; gap: var(--s2); }

.team-stack { display: grid; gap: var(--s3); }
.team-card { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); background: var(--panel); border: 1px solid var(--line-soft); border-radius: var(--r-l); padding: var(--s3) var(--s4); }
.team-card-main { display: flex; align-items: center; gap: var(--s4); flex: 1; min-width: 0; }
.team-card-name { font-weight: 800; font-size: var(--fs-lg); }

.tournament-stack { display: grid; gap: var(--s3); }
.tournament-card .tc-top { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s1); }
.structure-badge { background: rgba(255,255,255,0.05); border: 1px solid var(--line-soft); color: var(--muted); font-size: var(--fs-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; padding: 3px 8px; border-radius: 999px; }

/* ---------- registration ---------- */
.reg-summary { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.reg-status { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.registration-stack { display: grid; gap: var(--s3); }
.registration-card { display: grid; gap: var(--s3); }
.reg-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s3); }
.reg-card-players { display: flex; flex-wrap: wrap; gap: var(--s2); }
.reg-card-actions { display: flex; gap: var(--s2); flex-wrap: wrap; }
.reg-card-actions .btn { min-height: 36px; padding: 6px 12px; font-size: var(--fs-sm); }

.custom-field-row { display: grid; grid-template-columns: 1fr auto auto; gap: var(--s2); align-items: center; margin-bottom: var(--s2); }
.custom-field-row .cf-label { min-width: 0; }
.custom-field-row .cf-type { min-width: 100px; }
.custom-field-row .check { margin: 0; white-space: nowrap; }

@media (max-width: 640px) {
  .team-card { flex-direction: column; align-items: flex-start; }
  .team-card-main { flex-direction: column; align-items: flex-start; }
  .reg-summary { flex-direction: column; align-items: flex-start; }
  .custom-field-row { grid-template-columns: 1fr; }
}

/* ---------- player pool / franchise / config / showcase ---------- */
.pool-toolbar { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin-bottom: var(--s3); }
.bulkbar { display: flex; gap: var(--s3); align-items: center; padding: var(--s3) var(--s4); background: var(--brand-soft); border: 1px solid var(--line-soft); border-radius: var(--r-m); margin-bottom: var(--s3); }
.bulkbar span { font-weight: 700; }
.tblwrap.flush table { width: 100%; border-collapse: collapse; }
.tblwrap.flush th, .tblwrap.flush td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line-soft); }
.tblwrap.flush th { font-size: var(--fs-sm); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.tblwrap.flush tr:last-child td { border-bottom: none; }
.tblwrap.flush td .row { gap: 10px; }
.player-picker { max-height: 220px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--r-m); padding: var(--s3); display: grid; gap: var(--s2); }
.player-picker .check { display: flex; align-items: center; gap: var(--s2); padding: 4px; border-radius: var(--r-s); }
.player-picker .check:hover { background: var(--panel-3); }
.team-logo { width: 44px; height: 44px; border-radius: 999px; object-fit: cover; background: var(--panel-3); }
.roster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.roster-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: var(--fs-sm); }
.roster-list li { margin-bottom: 4px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s3); }
@media (max-width: 640px) { .grid3 { grid-template-columns: 1fr; } .pool-toolbar { flex-direction: column; align-items: stretch; } }

.showcase { min-height: calc(100vh - var(--topbar-h) - var(--tabbar-h)); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--s6); gap: var(--s7); }
.showcase-main { display: flex; flex-direction: column; align-items: center; gap: var(--s4); }
.showcase-logo { width: 160px; height: 160px; object-fit: contain; }
.showcase-title { font-size: var(--fs-4xl); margin: 0; }
.showcase-sport { font-size: var(--fs-lg); letter-spacing: 0.25em; color: var(--brand); font-weight: 800; }
.showcase-label { font-size: var(--fs-sm); color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; margin-bottom: var(--s3); }
.showcase-sponsors { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--s4); }
.showcase-sponsor { display: flex; flex-direction: column; align-items: center; gap: var(--s2); background: var(--panel); padding: var(--s4); border-radius: var(--r-l); min-width: 140px; }
.showcase-sponsor img { max-height: 48px; max-width: 140px; object-fit: contain; }
.showcase-sponsor span { font-weight: 700; }
.showcase-footer { margin-top: auto; color: var(--faint); font-size: var(--fs-sm); }

/* disabled team card in auction room */
.purse-card.disabled { opacity: 0.45; pointer-events: none; filter: grayscale(0.6); }
.purse-card .disabled-reason { font-size: var(--fs-xs); color: var(--red); text-transform: uppercase; letter-spacing: 0.04em; }
.spotlight-meta { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: var(--s2); }
.spotlight-detail { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s2); margin-top: var(--s3); font-size: var(--fs-sm); }
.spotlight-detail div { background: var(--panel-2); padding: var(--s2) var(--s3); border-radius: var(--r-s); }
.spotlight-detail strong { color: var(--muted); display: block; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---------- rule builder ---------- */
.rb-summary { margin-bottom: var(--s5); }
.rb-summary-label { font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--brand); margin-bottom: var(--s2); }
#rb-summary-text { font-size: var(--fs-lg); font-weight: 600; line-height: 1.4; }
.rb-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s3); align-items: end; background: rgba(255,255,255,0.03); border: 1px solid var(--line-soft); border-radius: var(--r-m); padding: var(--s3); margin-bottom: var(--s3); }
.rb-row button { min-height: 44px; }
.rb-special-row { grid-template-columns: 1fr 1fr 1fr auto; }
.rb-nested-body { margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line-soft); }
@media (max-width: 720px) { .rb-row, .rb-special-row { grid-template-columns: 1fr; } }

/* ---------- rule library ---------- */
.rl-toolbar { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s4); }
.rl-search {
  background: var(--bg-1); border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 12px 18px; font: inherit; color: var(--text); width: 100%;
}
.rl-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(226, 112, 77, 0.15); }
.rl-cats { display: flex; gap: var(--s2); flex-wrap: wrap; }
.rl-cat {
  background: var(--panel-2); border: 1px solid var(--line-soft); border-radius: var(--r-pill);
  color: var(--muted); font-weight: 700; font-size: var(--fs-sm); padding: 8px 14px; cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast), border-color var(--t-fast);
}
.rl-cat:hover { color: var(--text); background: var(--panel-3); }
.rl-cat.sel { color: var(--brand); background: var(--brand-soft); border-color: rgba(226, 112, 77, 0.45); }
.rl-active-tag { margin-bottom: var(--s4); }
.rl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
.rl-card {
  text-align: left; background: var(--grad-card); border: 1px solid var(--line-soft); border-radius: var(--r-l);
  padding: var(--s4); display: flex; flex-direction: column; gap: var(--s2);
  transition: border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.rl-card:hover { transform: translateY(-2px); border-color: var(--line); box-shadow: var(--sh-2); }
.rl-card.sel { border-color: var(--brand); box-shadow: var(--sh-glow); }
.rl-card-title { font-weight: 800; font-size: var(--fs-lg); display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.rl-card-cat { color: var(--brand); font-size: var(--fs-xs); font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.rl-card-desc { color: var(--muted); font-size: var(--fs-sm); margin: 0; }
.rl-card-summary { list-style: none; padding: 0; margin: var(--s1) 0; display: grid; gap: 4px; }
.rl-card-summary li {
  font-size: var(--fs-sm); color: var(--text); background: rgba(255,255,255,0.03);
  padding: 5px 10px; border-radius: var(--r-s); border: 1px solid var(--line-soft);
}
.rl-card-tags { display: flex; flex-wrap: wrap; gap: var(--s2); margin-top: auto; padding-top: var(--s2); }
.rl-card-tags .chip { cursor: pointer; transition: background var(--t-fast), border-color var(--t-fast); }
.rl-card-tags .chip:hover { background: var(--panel-3); border-color: var(--stone); }
.rl-card-actions { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.rl-card-actions button { flex: 1; min-height: 44px; font-size: var(--fs-sm); }
@media (max-width: 640px) {
  .rl-grid { grid-template-columns: 1fr; }
  .rl-card-actions button { width: 100%; }
}
