@charset "UTF-8";

/* ==========================================================================
   LIGA — design system

   The visual language borrows from the tarpaulin: the printed poster taped
   to the wall of a computer shop announcing a barangay tournament. Heavy
   condensed type, champion gold, deep ink. But a tarp is loud because it is
   fighting for attention on a wall. A screen is not a wall, so the volume is
   turned down and the discipline turned up.

   Boldness is spent in exactly one place: the Trust Card. Everything else
   stays quiet so that object can carry the page.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* Ink — a blue-black, never pure #000, so gold reads warm against it */
  --ink:        #12131C;
  --ink-2:      #191B26;
  --ink-3:      #222533;
  --ink-4:      #2B2F40;
  --line:       #2E3242;
  --line-soft:  #262A38;

  /* Accents */
  --gold:       #F5B841;   /* champion, primary action, money */
  --gold-dim:   #C99730;
  --gold-glow:  rgba(245, 184, 65, .16);
  --jade:       #2ED3A5;   /* verified, confirmed, paid */
  --jade-dim:   #1E9C79;
  --coral:      #FF5D5D;   /* dispute, danger, unpaid */
  --coral-dim:  #C93F3F;
  --violet:     #8B7BF0;   /* neutral highlight, links */

  /* Text */
  --paper:      #EDEEF5;
  --paper-2:    #C3C7D6;
  --haze:       #878CA3;
  --haze-2:     #656A80;

  /* Type */
  --display: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --body:    "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Scale — 1.25 minor third, capped so mobile never blows out */
  --t-xs:   .6875rem;
  --t-sm:   .8125rem;
  --t-base: .9375rem;
  --t-md:   1.0625rem;
  --t-lg:   1.375rem;
  --t-xl:   1.75rem;
  --t-2xl:  2.25rem;
  --t-3xl:  clamp(2.5rem, 8vw, 4.25rem);

  /* Space */
  --s-1: .25rem;  --s-2: .5rem;   --s-3: .75rem;  --s-4: 1rem;
  --s-5: 1.5rem;  --s-6: 2rem;    --s-7: 3rem;    --s-8: 4rem;

  --r-sm: 6px;  --r-md: 10px;  --r-lg: 16px;  --r-xl: 22px;

  --shadow-1: 0 1px 2px rgba(0,0,0,.4);
  --shadow-2: 0 8px 24px -8px rgba(0,0,0,.6);
  --shadow-3: 0 24px 48px -16px rgba(0,0,0,.7);

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out-back: cubic-bezier(.34, 1.4, .64, 1);

  --wrap: 1160px;
  --nav-h: 60px;
}

/* --------------------------------------------------------------------------
   2. Reset
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  tab-size: 4;
}

body {
  min-height: 100dvh;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--body);
  font-size: var(--t-base);
  line-height: 1.6;
  font-weight: 450;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
input, button, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--gold); color: var(--ink); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink); }
::-webkit-scrollbar-thumb { background: var(--ink-4); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--line); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -100px; left: var(--s-4); z-index: 999;
  background: var(--gold); color: var(--ink); padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm); font-weight: 700;
}
.skip-link:focus { top: var(--s-4); }

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */
h1, h2, h3, h4 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -.02em;
}

h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }
h4 { font-size: var(--t-md); letter-spacing: -.01em; }

p + p { margin-top: .85em; }

/* The eyebrow encodes section, not decoration — it always names the
   category of what follows. */
.eyebrow {
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--haze);
  display: flex;
  align-items: center;
  gap: var(--s-2);
}
.eyebrow::before {
  content: "";
  width: 18px; height: 2px;
  background: var(--gold);
  flex-shrink: 0;
}

.lede { font-size: var(--t-md); color: var(--paper-2); line-height: 1.65; }
.muted { color: var(--haze); }
.tiny { font-size: var(--t-sm); color: var(--haze); }
.micro { font-size: var(--t-xs); color: var(--haze-2); }

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}

.gold { color: var(--gold); }
.jade { color: var(--jade); }
.coral { color: var(--coral); }

a.inline-link {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(245,184,65,.4);
  transition: text-decoration-color .2s;
}
a.inline-link:hover { text-decoration-color: var(--gold); }

/* --------------------------------------------------------------------------
   4. Layout
   -------------------------------------------------------------------------- */
.wrap { width: min(100% - 2rem, var(--wrap)); margin-inline: auto; }
.wrap-narrow { width: min(100% - 2rem, 720px); margin-inline: auto; }
.wrap-tight { width: min(100% - 2rem, 480px); margin-inline: auto; }

.stack > * + * { margin-top: var(--s-4); }
.stack-lg > * + * { margin-top: var(--s-6); }
.stack-sm > * + * { margin-top: var(--s-2); }

.row { display: flex; align-items: center; gap: var(--s-3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.row-wrap { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.push { margin-left: auto; }

.grid { display: grid; gap: var(--s-4); }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 700px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1000px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.split { display: grid; gap: var(--s-6); grid-template-columns: 1fr; }
@media (min-width: 960px) {
  .split { grid-template-columns: minmax(0,1fr) 340px; align-items: start; }
  .split-side { position: sticky; top: calc(var(--nav-h) + var(--s-4)); }
}

.section { padding-block: var(--s-7); }
.section-tight { padding-block: var(--s-6); }

.divider { height: 1px; background: var(--line-soft); border: 0; }

/* --------------------------------------------------------------------------
   5. Navigation
   -------------------------------------------------------------------------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: rgba(18,19,28,.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
}
.nav-inner { height: 100%; display: flex; align-items: center; gap: var(--s-4); }

.brand {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -.03em;
  display: flex; align-items: center; gap: .55rem;
  flex-shrink: 0;
}
.brand-mark {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  background: var(--gold);
  color: var(--ink);
  border-radius: 5px;
  font-size: .8rem; font-weight: 900;
  transform: rotate(-6deg);
  transition: transform .3s var(--ease-out-back);
}
.brand:hover .brand-mark { transform: rotate(6deg) scale(1.08); }

.nav-links { display: none; gap: var(--s-1); margin-left: var(--s-3); }
@media (min-width: 900px) { .nav-links { display: flex; } }

.nav-link {
  padding: .45rem .7rem;
  border-radius: var(--r-sm);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--paper-2);
  transition: color .18s, background .18s;
}
.nav-link:hover { color: var(--paper); background: var(--ink-3); }
.nav-link[aria-current="page"] { color: var(--gold); }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s-2); }

.icon-btn {
  position: relative;
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--paper-2);
  transition: background .18s, color .18s;
}
.icon-btn:hover { background: var(--ink-3); color: var(--paper); }

.dot {
  position: absolute; top: 6px; right: 6px;
  min-width: 15px; height: 15px; padding: 0 3px;
  background: var(--coral); color: #fff;
  border-radius: 8px;
  font-size: 9px; font-weight: 800; line-height: 15px;
  text-align: center;
  border: 2px solid var(--ink);
}

/* Mobile tab bar — thumbs, not menus */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  display: flex;
  background: rgba(18,19,28,.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line-soft);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 900px) { .tabbar { display: none; } }
body:has(.tabbar) { padding-bottom: 68px; }

.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: .55rem 0 .5rem;
  font-size: 10px; font-weight: 700;
  letter-spacing: .01em;
  color: var(--haze);
  transition: color .18s;
}
.tab[aria-current="page"] { color: var(--gold); }
.tab .ic { width: 21px; height: 21px; }

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1.05rem;
  border-radius: var(--r-sm);
  font-family: var(--display);
  font-size: var(--t-sm);
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s var(--ease), background .18s, border-color .18s, color .18s, box-shadow .18s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: #FFC85A; box-shadow: 0 4px 18px -4px var(--gold-glow); }

.btn-ghost { background: var(--ink-3); color: var(--paper); border-color: var(--line); }
.btn-ghost:hover { background: var(--ink-4); border-color: var(--line); }

.btn-outline { border-color: var(--line); color: var(--paper-2); }
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-danger { background: transparent; border-color: rgba(255,93,93,.4); color: var(--coral); }
.btn-danger:hover { background: rgba(255,93,93,.1); border-color: var(--coral); }

.btn-jade { background: var(--jade); color: #04211A; }
.btn-jade:hover { background: #46E8B9; }

.btn-sm { padding: .4rem .7rem; font-size: var(--t-xs); }
.btn-lg { padding: .8rem 1.5rem; font-size: var(--t-base); }
.btn-block { width: 100%; }

.btn .ic { width: 17px; height: 17px; }

/* --------------------------------------------------------------------------
   7. Cards & surfaces
   -------------------------------------------------------------------------- */
.card {
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card-tight { padding: var(--s-4); }
.card-flush { padding: 0; overflow: hidden; }

.card-link {
  display: block;
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.card-link:hover {
  transform: translateY(-3px);
  border-color: var(--line);
  box-shadow: var(--shadow-2);
}

.panel {
  background: var(--ink-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  padding: var(--s-4);
}

.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.card-head h3, .card-head h2 { font-size: var(--t-md); }

/* --------------------------------------------------------------------------
   8. THE TRUST CARD — the signature object
   --------------------------------------------------------------------------
   Shaped like a receipt because that is exactly what it is: the printed
   record of what this organiser has actually done with other people's money.
   The notches and the dashed rule are the tell; the seal is earned, never
   decorative.
   -------------------------------------------------------------------------- */
.trust {
  position: relative;
  background:
    radial-gradient(circle at 0 var(--notch-y, 118px), transparent 11px, var(--ink-2) 11.5px) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% var(--notch-y, 118px), transparent 11px, var(--ink-2) 11.5px) right / 51% 100% no-repeat;
  border-radius: var(--r-lg);
  padding: var(--s-5);
  overflow: hidden;
  isolation: isolate;
}
.trust::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: var(--r-lg);
  padding: 1px;
  background: linear-gradient(150deg, var(--line) 0%, transparent 40%, transparent 60%, var(--line) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
/* Faint ledger ruling, like the back of a receipt book */
.trust::after {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0 27px, rgba(255,255,255,.014) 27px 28px
  );
  pointer-events: none;
}

.trust-top { display: flex; align-items: flex-start; gap: var(--s-4); }

.trust-id { flex: 1; min-width: 0; }
.trust-name {
  font-family: var(--display);
  font-size: var(--t-lg);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.15;
  display: flex; align-items: center; gap: .4rem;
  flex-wrap: wrap;
}
.trust-where { font-size: var(--t-sm); color: var(--haze); margin-top: 2px; }

/* The seal. Stamped, not printed — it arrives with a rotation. */
.seal {
  flex-shrink: 0;
  width: 62px; height: 62px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 2px dashed var(--jade);
  color: var(--jade);
  background: radial-gradient(circle, rgba(46,211,165,.14), transparent 70%);
  transform: rotate(-9deg);
  animation: stamp .5s var(--ease-out-back) both .3s;
}
.seal .ic { width: 26px; height: 26px; }
.seal-text {
  font-family: var(--display);
  font-size: 7px; font-weight: 800;
  letter-spacing: .1em; text-transform: uppercase;
  margin-top: -2px;
}
@keyframes stamp {
  from { transform: rotate(14deg) scale(1.9); opacity: 0; }
  to   { transform: rotate(-9deg) scale(1); opacity: 1; }
}

.seal-none {
  flex-shrink: 0;
  width: 62px; height: 62px;
  display: grid; place-items: center; text-align: center;
  border-radius: 50%;
  border: 2px dashed var(--line);
  color: var(--haze-2);
  font-family: var(--display);
  font-size: 8px; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
  line-height: 1.2; padding: 4px;
}

/* Perforation between identity and the numbers */
.perf {
  margin: var(--s-4) calc(var(--s-5) * -1);
  border: 0; border-top: 2px dashed var(--line);
  height: 0;
}

.trust-figures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-4) var(--s-3);
}
@media (min-width: 560px) { .trust-figures { grid-template-columns: repeat(4, 1fr); } }

.figure { min-width: 0; }
.figure-n {
  font-family: var(--mono);
  font-size: var(--t-xl);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.045em;
  font-variant-numeric: tabular-nums;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.figure-l {
  display: block;
  margin-top: 5px;
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--haze);
  line-height: 1.3;
}
.figure-n.is-gold { color: var(--gold); }
.figure-n.is-jade { color: var(--jade); }
.figure-n.is-coral { color: var(--coral); }

/* Standing bar */
.standing { margin-top: var(--s-4); }
.standing-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: var(--t-xs); font-weight: 700;
  text-transform: uppercase; letter-spacing: .09em;
  color: var(--haze);
  margin-bottom: 7px;
}
.meter {
  height: 7px;
  background: var(--ink-4);
  border-radius: 4px;
  overflow: hidden;
}
.meter-fill {
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  width: 0;
  transition: width 1.1s var(--ease) .25s;
}
.meter-fill.is-good { background: linear-gradient(90deg, var(--jade-dim), var(--jade)); }
.meter-fill.is-bad  { background: linear-gradient(90deg, var(--coral-dim), var(--coral)); }
.meter-fill.is-mute { background: var(--ink-4); }

.trust-note {
  margin-top: var(--s-3);
  font-size: var(--t-xs);
  color: var(--haze-2);
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   9. Badges, chips, pills
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .22rem .55rem;
  border-radius: 20px;
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .03em;
  border: 1px solid;
  white-space: nowrap;
}
.badge .ic { width: 13px; height: 13px; }

.badge-good { color: var(--jade);  border-color: rgba(46,211,165,.35);  background: rgba(46,211,165,.1); }
.badge-warn { color: var(--gold);  border-color: rgba(245,184,65,.35);  background: rgba(245,184,65,.1); }
.badge-bad  { color: var(--coral); border-color: rgba(255,93,93,.35);   background: rgba(255,93,93,.1); }
.badge-mute { color: var(--haze);  border-color: var(--line);           background: var(--ink-3); }
.badge-gold { color: var(--ink);   border-color: var(--gold);           background: var(--gold); }

.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .65rem;
  border-radius: 20px;
  background: var(--ink-3);
  border: 1px solid var(--line-soft);
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--paper-2);
  transition: border-color .18s, color .18s, background .18s;
}
a.chip:hover { border-color: var(--gold); color: var(--gold); }
.chip.is-on { background: var(--gold); border-color: var(--gold); color: var(--ink); font-weight: 700; }
.chip .ic { width: 13px; height: 13px; }

/* --------------------------------------------------------------------------
   10. Avatars
   -------------------------------------------------------------------------- */
.av {
  flex-shrink: 0;
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  font-family: var(--display);
  font-size: var(--t-sm);
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  background: hsl(var(--h, 42) 72% 62%);
  overflow: hidden;
  object-fit: cover;
}
.av-sm { width: 30px; height: 30px; font-size: var(--t-xs); border-radius: 5px; }
.av-lg { width: 60px; height: 60px; font-size: var(--t-md); border-radius: var(--r-md); }
.av-xl { width: 84px; height: 84px; font-size: var(--t-lg); border-radius: var(--r-md); }
img.av { object-fit: cover; }

/* --------------------------------------------------------------------------
   11. Forms
   -------------------------------------------------------------------------- */
.field { display: block; }
.field + .field { margin-top: var(--s-4); }

.label {
  display: block;
  font-size: var(--t-sm);
  font-weight: 700;
  margin-bottom: .35rem;
  color: var(--paper);
}
.label .req { color: var(--gold); margin-left: 2px; }

.hint {
  display: block;
  font-size: var(--t-xs);
  color: var(--haze);
  margin-bottom: .4rem;
  line-height: 1.45;
}

.input, .select, .textarea {
  width: 100%;
  padding: .6rem .75rem;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  color: var(--paper);
  font-size: var(--t-base);
  transition: border-color .18s, box-shadow .18s, background .18s;
  -webkit-appearance: none;
  appearance: none;
}
.input::placeholder, .textarea::placeholder { color: var(--haze-2); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-4); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px var(--gold-glow);
  background: var(--ink-2);
}
.textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.input.is-mono { font-family: var(--mono); letter-spacing: .02em; }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' stroke='%23878CA3' stroke-width='1.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .7rem center;
  padding-right: 2rem;
  cursor: pointer;
}

.input.has-error, .select.has-error, .textarea.has-error {
  border-color: var(--coral);
  background: rgba(255,93,93,.05);
}

.error-text {
  display: flex; align-items: flex-start; gap: .3rem;
  margin-top: .35rem;
  font-size: var(--t-xs);
  font-weight: 600;
  color: var(--coral);
  line-height: 1.45;
}
.error-text .ic { width: 13px; height: 13px; flex-shrink: 0; margin-top: 2px; }

.check {
  display: flex; align-items: flex-start; gap: .6rem;
  cursor: pointer;
  font-size: var(--t-sm);
  line-height: 1.5;
}
.check input[type="checkbox"], .check input[type="radio"] {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 2px;
  accent-color: var(--gold);
  cursor: pointer;
}

.field-row { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
@media (min-width: 620px) {
  .field-row-2 { grid-template-columns: repeat(2, 1fr); }
  .field-row-3 { grid-template-columns: repeat(3, 1fr); }
}

.input-prefix { position: relative; }
.input-prefix .pfx {
  position: absolute; left: .75rem; top: 50%; transform: translateY(-50%);
  color: var(--haze); font-family: var(--mono); font-size: var(--t-sm);
  pointer-events: none;
}
.input-prefix .input { padding-left: 1.9rem; }

/* File picker */
.filepick {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3);
  background: var(--ink);
  border: 1px dashed var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .18s, background .18s;
}
.filepick:hover { border-color: var(--gold); background: var(--ink-2); }
.filepick input[type="file"] { position: absolute; opacity: 0; width: 0; height: 0; }
.filepick .ic { color: var(--haze); flex-shrink: 0; }
.filepick-text { font-size: var(--t-sm); color: var(--haze); min-width: 0; }
.filepick-text strong { display: block; color: var(--paper); font-weight: 600; word-break: break-all; }

.thumb {
  width: 100%; max-width: 220px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
}

fieldset { border: 0; padding: 0; }
legend {
  font-family: var(--display);
  font-size: var(--t-md);
  font-weight: 800;
  margin-bottom: var(--s-1);
}

/* --------------------------------------------------------------------------
   12. Flash messages
   -------------------------------------------------------------------------- */
.flashes {
  position: fixed;
  top: calc(var(--nav-h) + var(--s-3));
  right: var(--s-4); left: var(--s-4);
  z-index: 200;
  display: flex; flex-direction: column; gap: var(--s-2);
  pointer-events: none;
}
@media (min-width: 640px) { .flashes { left: auto; width: 380px; } }

.flash {
  display: flex; align-items: flex-start; gap: .6rem;
  padding: .75rem .9rem;
  background: var(--ink-3);
  border: 1px solid var(--line);
  border-left: 3px solid var(--haze);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-3);
  font-size: var(--t-sm);
  line-height: 1.5;
  pointer-events: auto;
  animation: slide-in .35s var(--ease-out-back) both;
}
.flash .ic { flex-shrink: 0; margin-top: 2px; }
.flash-success { border-left-color: var(--jade); }
.flash-success .ic { color: var(--jade); }
.flash-error { border-left-color: var(--coral); }
.flash-error .ic { color: var(--coral); }
.flash-info, .flash-warning { border-left-color: var(--gold); }
.flash-info .ic, .flash-warning .ic { color: var(--gold); }
.flash-x { margin-left: auto; color: var(--haze); flex-shrink: 0; }
.flash-x:hover { color: var(--paper); }

@keyframes slide-in {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: none; }
}
.flash.is-out { animation: slide-out .25s var(--ease) forwards; }
@keyframes slide-out {
  to { opacity: 0; transform: translateX(24px); height: 0; margin: 0; padding-block: 0; }
}

/* --------------------------------------------------------------------------
   13. Notices (inline, not transient)
   -------------------------------------------------------------------------- */
.notice {
  display: flex; gap: var(--s-3);
  padding: var(--s-4);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--ink-3);
  font-size: var(--t-sm);
  line-height: 1.6;
}
.notice .ic { flex-shrink: 0; margin-top: 1px; }
.notice strong { display: block; font-family: var(--display); font-size: var(--t-base); margin-bottom: 2px; }
.notice-gold  { border-color: rgba(245,184,65,.3); background: rgba(245,184,65,.06); }
.notice-gold .ic { color: var(--gold); }
.notice-jade  { border-color: rgba(46,211,165,.3); background: rgba(46,211,165,.06); }
.notice-jade .ic { color: var(--jade); }
.notice-coral { border-color: rgba(255,93,93,.3); background: rgba(255,93,93,.06); }
.notice-coral .ic { color: var(--coral); }

/* --------------------------------------------------------------------------
   14. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding-block: var(--s-7) var(--s-6);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: -30% -10% auto;
  height: 460px;
  background: radial-gradient(ellipse at 50% 0%, rgba(245,184,65,.09), transparent 62%);
  pointer-events: none;
}
.hero-inner { position: relative; }

.hero h1 {
  font-size: var(--t-3xl);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: .96;
  margin-block: var(--s-4) var(--s-4);
  max-width: 15ch;
}
.hero h1 em {
  font-style: normal;
  color: var(--gold);
  position: relative;
  white-space: nowrap;
}
/* Hand-drawn underscore: the mark a TO makes on a printed bracket */
.hero h1 em::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -.06em;
  height: .1em;
  background: var(--gold);
  transform-origin: left;
  animation: strike .8s var(--ease) both .55s;
  opacity: .35;
}
@keyframes strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.hero-sub { max-width: 46ch; font-size: var(--t-md); color: var(--paper-2); }
.hero-cta { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: var(--s-5);
  margin-top: var(--s-6);
  padding-top: var(--s-5);
  border-top: 1px solid var(--line-soft);
}
.hero-stat-n {
  font-family: var(--mono);
  font-size: var(--t-lg);
  font-weight: 700;
  letter-spacing: -.04em;
  color: var(--gold);
  display: block;
}
.hero-stat-l { font-size: var(--t-xs); color: var(--haze); font-weight: 600; }

/* --------------------------------------------------------------------------
   15. Tournament cards
   -------------------------------------------------------------------------- */
.tcard {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .22s var(--ease), border-color .22s, box-shadow .22s;
}
.tcard:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: var(--shadow-2); }

.tcard-banner {
  height: 96px;
  background: linear-gradient(120deg, var(--ink-3), var(--ink-4));
  position: relative;
  overflow: hidden;
}
.tcard-banner img { width: 100%; height: 100%; object-fit: cover; }
/* Diagonal ribbon, borrowed from the tarp, kept to a whisper */
.tcard-banner::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    -52deg, transparent 0 14px, rgba(245,184,65,.045) 14px 15px
  );
}
.tcard-badges {
  position: absolute; top: var(--s-3); left: var(--s-3); right: var(--s-3);
  display: flex; gap: var(--s-2); flex-wrap: wrap; z-index: 2;
}

.tcard-body { padding: var(--s-4); display: flex; flex-direction: column; flex: 1; gap: var(--s-3); }
.tcard-title {
  font-family: var(--display);
  font-size: var(--t-md);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -.015em;
}
.tcard-org { display: flex; align-items: center; gap: .4rem; font-size: var(--t-sm); color: var(--haze); }
.tcard-org .ic { color: var(--jade); }

.tcard-meta {
  display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4);
  font-size: var(--t-xs);
  color: var(--haze);
  margin-top: auto;
  padding-top: var(--s-3);
  border-top: 1px solid var(--line-soft);
}
.tcard-meta span { display: flex; align-items: center; gap: .3rem; }
.tcard-meta .ic { width: 14px; height: 14px; }

.tcard-prize {
  font-family: var(--mono);
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -.04em;
  line-height: 1;
}
.tcard-prize small { font-size: var(--t-xs); color: var(--haze); font-family: var(--body); letter-spacing: 0; }

/* --------------------------------------------------------------------------
   16. Bracket
   -------------------------------------------------------------------------- */
.bracket-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  padding: var(--s-4) var(--s-4) var(--s-5);
  margin-inline: calc(var(--s-4) * -1);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.bracket {
  display: flex;
  gap: 52px;
  min-width: min-content;
  align-items: stretch;
}

.br-round { display: flex; flex-direction: column; justify-content: space-around; gap: var(--s-3); min-width: 218px; }

.br-round-label {
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--haze);
  text-align: center;
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: var(--s-2);
}

.br-match {
  position: relative;
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  overflow: hidden;
  transition: border-color .2s, box-shadow .2s, transform .2s var(--ease);
  animation: fade-up .45s var(--ease) both;
}
.br-match:hover { border-color: var(--line); transform: translateX(2px); }
.br-match.is-live { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-glow); }
.br-match.is-done { opacity: .96; }
.br-match.is-disputed { border-color: var(--coral); }

/* Connector: the elbow that joins a match to the next round */
.br-match::after {
  content: "";
  position: absolute;
  right: -52px; top: 50%;
  width: 52px; height: 1px;
  background: var(--line);
  transform-origin: left;
  animation: draw .5s var(--ease) both .2s;
}
.br-round:last-child .br-match::after { display: none; }
@keyframes draw { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.br-team {
  display: flex; align-items: center; gap: .5rem;
  padding: .5rem .65rem;
  font-size: var(--t-sm);
  transition: background .18s;
}
.br-team + .br-team { border-top: 1px solid var(--line-soft); }
.br-team-name {
  flex: 1; min-width: 0;
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.br-team-seed {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--haze-2);
  width: 15px;
  flex-shrink: 0;
}
.br-team-score {
  font-family: var(--mono);
  font-weight: 700;
  font-size: var(--t-sm);
  color: var(--haze);
  min-width: 16px; text-align: right;
}
.br-team.is-winner { background: rgba(245,184,65,.07); }
.br-team.is-winner .br-team-name { color: var(--gold); font-weight: 700; }
.br-team.is-winner .br-team-score { color: var(--gold); }
.br-team.is-loser { opacity: .5; }
.br-team.is-tbd .br-team-name { color: var(--haze-2); font-style: italic; font-weight: 500; }

.br-foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-2);
  padding: .3rem .65rem;
  background: var(--ink-3);
  border-top: 1px solid var(--line-soft);
  font-size: 10px;
  color: var(--haze);
}

.br-legend { display: flex; flex-wrap: wrap; gap: var(--s-4); font-size: var(--t-xs); color: var(--haze); }
.br-legend span { display: flex; align-items: center; gap: .35rem; }
.br-key { width: 10px; height: 10px; border-radius: 2px; }

@keyframes fade-up {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   17. Tables & lists
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table { font-size: var(--t-sm); }
.table th {
  text-align: left;
  padding: .55rem .7rem;
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--haze);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td {
  padding: .7rem;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .15s; }
.table tbody tr:hover { background: var(--ink-3); }
.table .num { font-family: var(--mono); text-align: right; }

.list { border: 1px solid var(--line-soft); border-radius: var(--r-md); overflow: hidden; }
.list-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  background: var(--ink-2);
  transition: background .18s;
}
.list-item + .list-item { border-top: 1px solid var(--line-soft); }
a.list-item:hover { background: var(--ink-3); }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-weight: 700; font-size: var(--t-sm); }
.list-item-sub { font-size: var(--t-xs); color: var(--haze); margin-top: 1px; }

/* Rank column on standings */
.rank {
  font-family: var(--display);
  font-size: var(--t-md);
  font-weight: 900;
  color: var(--haze-2);
  width: 34px;
  text-align: center;
  letter-spacing: -.03em;
}
.rank-1 { color: var(--gold); }
.rank-2 { color: #C9CDDD; }
.rank-3 { color: #C08552; }

/* --------------------------------------------------------------------------
   18. Empty & loading states
   -------------------------------------------------------------------------- */
.empty {
  text-align: center;
  padding: var(--s-7) var(--s-4);
  border: 1px dashed var(--line);
  border-radius: var(--r-lg);
  background: rgba(255,255,255,.012);
}
.empty .ic { color: var(--haze-2); margin: 0 auto var(--s-3); width: 34px; height: 34px; }
.empty h3 { font-size: var(--t-md); margin-bottom: .3rem; }
.empty p { color: var(--haze); font-size: var(--t-sm); max-width: 40ch; margin-inline: auto; }
.empty .btn { margin-top: var(--s-4); }

/* --------------------------------------------------------------------------
   19. Tabs
   -------------------------------------------------------------------------- */
.tabs {
  display: flex; gap: var(--s-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  padding: .6rem .85rem;
  font-family: var(--display);
  font-size: var(--t-sm);
  font-weight: 700;
  color: var(--haze);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .18s, border-color .18s;
}
.tabs a:hover { color: var(--paper); }
.tabs a[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }

/* --------------------------------------------------------------------------
   20. Page header
   -------------------------------------------------------------------------- */
.phead { padding-block: var(--s-5) var(--s-4); }
.phead h1 { font-size: var(--t-xl); }
.phead .lede { margin-top: var(--s-2); max-width: 60ch; }
.phead-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-4); }

.crumb {
  display: flex; align-items: center; gap: .3rem;
  font-size: var(--t-xs);
  color: var(--haze);
  margin-bottom: var(--s-2);
}
.crumb a:hover { color: var(--gold); }
.crumb .ic { width: 12px; height: 12px; }

/* --------------------------------------------------------------------------
   21. Match detail
   -------------------------------------------------------------------------- */
.versus {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--s-3);
  align-items: center;
  padding: var(--s-5) var(--s-4);
  background: var(--ink-2);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
}
.versus-side { text-align: center; min-width: 0; }
.versus-side .av { margin: 0 auto var(--s-2); }
.versus-name {
  font-family: var(--display);
  font-weight: 800;
  font-size: var(--t-base);
  line-height: 1.2;
  word-break: break-word;
}
.versus-score {
  font-family: var(--mono);
  font-size: var(--t-2xl);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1;
  margin-top: var(--s-2);
}
.versus-mid {
  font-family: var(--display);
  font-size: var(--t-sm);
  font-weight: 800;
  color: var(--haze-2);
  letter-spacing: .1em;
}
.versus-side.is-winner .versus-name,
.versus-side.is-winner .versus-score { color: var(--gold); }

/* --------------------------------------------------------------------------
   22. Roster editor
   -------------------------------------------------------------------------- */
.roster-row {
  display: grid;
  gap: var(--s-2);
  grid-template-columns: 1fr;
  padding: var(--s-3);
  background: var(--ink-3);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.roster-row + .roster-row { margin-top: var(--s-2); }
@media (min-width: 760px) {
  .roster-row { grid-template-columns: 1.3fr 1.1fr .9fr .7fr .8fr; align-items: center; }
}
.roster-n {
  font-family: var(--display);
  font-size: var(--t-xs);
  font-weight: 800;
  color: var(--haze-2);
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* --------------------------------------------------------------------------
   23. Utilities
   -------------------------------------------------------------------------- */
.mt-1 { margin-top: var(--s-1); } .mt-2 { margin-top: var(--s-2); }
.mt-3 { margin-top: var(--s-3); } .mt-4 { margin-top: var(--s-4); }
.mt-5 { margin-top: var(--s-5); } .mt-6 { margin-top: var(--s-6); }
.mb-1 { margin-bottom: var(--s-1); } .mb-2 { margin-bottom: var(--s-2); } .mb-3 { margin-bottom: var(--s-3); }
.mb-4 { margin-bottom: var(--s-4); } .mb-5 { margin-bottom: var(--s-5); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }
.full { width: 100%; }
@media (max-width: 639px) { .hide-sm { display: none !important; } }
@media (min-width: 900px) { .hide-lg { display: none !important; } }

/* Reveal-on-scroll, applied by app.js */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}

/* --------------------------------------------------------------------------
   24. Footer
   -------------------------------------------------------------------------- */
.foot {
  margin-top: var(--s-8);
  padding-block: var(--s-6);
  border-top: 1px solid var(--line-soft);
  font-size: var(--t-sm);
  color: var(--haze);
}
.foot-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 720px) { .foot-grid { grid-template-columns: 2fr 1fr 1fr; } }
.foot h4 {
  font-size: var(--t-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--paper);
  margin-bottom: var(--s-3);
}
.foot a { display: block; padding: .2rem 0; transition: color .18s; }
.foot a:hover { color: var(--gold); }
.foot-legal {
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--line-soft);
  font-size: var(--t-xs);
  color: var(--haze-2);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   25. Print — organisers print brackets and rules for the venue wall
   -------------------------------------------------------------------------- */
@media print {
  :root { --ink: #fff; --ink-2: #fff; --ink-3: #f4f4f6; --paper: #111; --haze: #555; --line: #ccc; --line-soft: #e2e2e6; }
  body { background: #fff; color: #111; }
  .nav, .tabbar, .flashes, .btn, .foot, .no-print { display: none !important; }
  .card, .trust, .br-match { border-color: #ccc; box-shadow: none; }
  .bracket-scroll { overflow: visible; }
  a { text-decoration: none; color: #111; }
}

/* --------------------------------------------------------------------------
   26. Reduced motion
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}
