/* Unruly Court app: HQ + club portals. Built on brand/tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--uc-bg); color: var(--uc-ink); font: 400 15px/1.55 var(--uc-font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
a { color: var(--uc-forest); }
:focus-visible { outline: 3px solid var(--uc-focus); outline-offset: 2px; border-radius: 4px; }
code { font-family: var(--uc-font-mono); font-size: .85em; }
small, .muted { color: var(--uc-ink-muted); }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

/* ---- Wordmark: house style, "Unruly" upright + "Court" italic (Instrument Serif) ---- */
.wm { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 4px; color: var(--uc-forest-900); }
.wm__name { font-family: var(--uc-font-serif); font-weight: 400; font-size: 1.5em; line-height: 1; letter-spacing: -.01em; white-space: nowrap; }
.wm__c { font-style: italic; color: var(--uc-gold-deep); }
.wm__tag { font: 600 .6rem/1 var(--uc-font-caps); letter-spacing: .3em; text-transform: uppercase; color: var(--uc-gold-deep); }

/* ---- Shell ----------------------------------------------------------------- */
.shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--uc-forest); color: var(--uc-pistachio-50); display: flex; flex-direction: column; padding: 20px 14px; position: sticky; top: 0; height: 100vh; }
.side .wm { color: var(--uc-pistachio-50); }
.side .wm__c, .side .wm__tag { color: var(--uc-gold-300); }
.side__brand { padding: 4px 10px 22px; }
.side__home { text-decoration: none; display: grid; gap: 4px; color: inherit; }
.side__club { font-family: var(--uc-font-caps); font-weight: 700; letter-spacing: .06em; font-size: 1.05rem; color: var(--uc-gold-300); line-height: 1.2; }
.side__poweredby { font-size: .75rem; opacity: .85; display: flex; gap: 6px; align-items: baseline; }
.side__poweredby .wm { font-size: .8rem; }
.side nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side__link { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; border-radius: 10px; color: var(--uc-pistachio-50); text-decoration: none; font-weight: 500; }
.side__link:hover { background: rgba(228,207,138,.12); }
.side__link.is-active { background: var(--uc-gold-300); color: var(--uc-forest-900); }
.side__link--soon { opacity: .55; cursor: default; }
.side__link--soon em { font: 500 .65rem var(--uc-font-mono); letter-spacing: .1em; text-transform: uppercase; font-style: normal; color: var(--uc-gold-300); }
.side__foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid rgba(228,207,138,.25); font-size: .85rem; }
.side__user { display: block; opacity: .85; word-break: break-all; margin-bottom: 6px; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--uc-gold-300); font: inherit; cursor: pointer; text-decoration: underline; }

.main { padding: 28px clamp(16px, 3vw, 40px) 60px; min-width: 0; }
.main__head { margin-bottom: 18px; }
.main__head h1 { font-family: var(--uc-font-display); font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.4rem); color: var(--uc-heading); }

/* ---- Banners (ghost / demo) ------------------------------------------------- */
.banner { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px clamp(16px, 3vw, 40px); position: sticky; top: 0; z-index: 30; font-size: .92rem; }
.banner--ghost { background: var(--uc-plum); color: var(--uc-pistachio-50); }
.banner--ghost.banner--edit { background: var(--uc-coral-700); }
.banner--demo { background: var(--uc-teal); color: var(--uc-pistachio-50); }
.banner form { margin: 0; }
body.club .side { top: 0; }

/* ---- Buttons ----------------------------------------------------------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: .62rem 1.1rem; border-radius: 999px; border: 2px solid var(--uc-forest); font: 600 .92rem/1 var(--uc-font-body); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn--primary { background: var(--uc-forest); color: var(--uc-gold-300); box-shadow: 3px 3px 0 var(--uc-gold); }
.btn--primary:hover { background: var(--uc-forest-900); }
.btn--ghost { background: var(--uc-surface); color: var(--uc-forest); }
.btn--ghost:hover { background: var(--uc-pistachio); }
.btn--gold { background: var(--uc-gold-300); color: var(--uc-forest-900); border-color: var(--uc-forest-900); }
.btn--tiny { padding: .35rem .7rem; font-size: .8rem; box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 14px 0; }

/* ---- Cards, stats, tables ---------------------------------------------------- */
.card { background: var(--uc-surface); border: 1px solid var(--uc-line); border-radius: var(--uc-radius-md); padding: 20px; margin-bottom: 18px; box-shadow: var(--uc-shadow-card); }
.card h2 { font-family: var(--uc-font-caps); font-weight: 700; font-size: .95rem; letter-spacing: .14em; text-transform: uppercase; color: var(--uc-gold-ink); margin-bottom: 12px; }
.card--flush { padding: 0; overflow-x: auto; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid2--wide-left { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat { border-radius: var(--uc-radius-md); padding: 16px 18px; border: 2px solid var(--uc-forest); display: grid; gap: 4px; }
.stat__label { font: 500 .72rem/1.3 var(--uc-font-mono); letter-spacing: .1em; text-transform: uppercase; }
.stat__value { font-family: var(--uc-font-caps); font-weight: 700; font-size: 1.7rem; letter-spacing: .02em; }
.stat--mint { background: var(--uc-mint); }
.stat--pistachio { background: var(--uc-pistachio); }
.stat--blush { background: var(--uc-blush); }
.stat--plum { background: var(--uc-plum); color: var(--uc-pistachio-50); }
.stat--teal { background: var(--uc-teal); color: var(--uc-pistachio-50); }
.stat--forest { background: var(--uc-forest); color: var(--uc-gold-300); }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font: 500 .72rem var(--uc-font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--uc-ink-muted); padding: 12px 14px; border-bottom: 2px solid var(--uc-line); }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--uc-line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table tr.is-archived td { opacity: .55; }
.feed { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.feed__when { font: .75rem var(--uc-font-mono); color: var(--uc-ink-muted); }
.note { background: var(--uc-mint-50); border-left: 4px solid var(--uc-teal); padding: 10px 14px; border-radius: 6px; font-size: .9rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; margin-bottom: 18px; }
.teamcard, .libcard { display: grid; gap: 6px; padding: 16px; border-radius: var(--uc-radius-md); border: 2px solid var(--uc-forest); background: var(--uc-pistachio); text-decoration: none; color: var(--uc-ink); }
.teamcard:nth-child(3n+2) { background: var(--uc-mint); }
.teamcard:nth-child(3n) { background: var(--uc-blush); }
.teamcard:hover { box-shadow: 4px 4px 0 var(--uc-forest); }
.teamcard__name { font-family: var(--uc-font-caps); font-weight: 700; font-size: 1.1rem; letter-spacing: .04em; }
.libcard { background: var(--uc-surface); border-width: 1px; border-color: var(--uc-line); }
.libcard .actions { margin: 6px 0 0; }

/* ---- Pills and tags ------------------------------------------------------------ */
.pill, .tag, .kind { display: inline-block; padding: 2px 9px; border-radius: 999px; font: 500 .72rem var(--uc-font-mono); letter-spacing: .04em; text-transform: uppercase; }
.tag { background: var(--uc-gold-300); color: var(--uc-forest-900); margin-left: 6px; }
.pill--active, .pill--paid { background: var(--uc-olive-300); color: var(--uc-forest-900); }
.pill--trial, .pill--due { background: var(--uc-mint); color: var(--uc-forest-900); }
.pill--past_due, .pill--overdue { background: var(--uc-plum); color: var(--uc-pistachio-50); }
.pill--cancelled { background: #d5d8cf; color: var(--uc-forest-900); }
.kind { background: var(--uc-pistachio); color: var(--uc-forest-900); }
.kind--game { background: var(--uc-blush); }
.kind--tryout { background: var(--uc-gold-300); }
.kind--tournament { background: var(--uc-rose); }

/* ---- Forms ---------------------------------------------------------------------- */
.form { display: grid; gap: 14px; }
.form--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form__full { grid-column: 1 / -1; }
.form--inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.form label { display: grid; gap: 6px; font-weight: 600; font-size: .88rem; }
.form small { font-weight: 400; }
input, select, textarea { font: 400 1rem var(--uc-font-body); padding: .6rem .8rem; border: 1.5px solid #b9c0a6; border-radius: 10px; background: #fff; color: var(--uc-ink); min-width: 0; }
input:focus, select:focus { border-color: var(--uc-forest); outline: none; box-shadow: 0 0 0 3px rgba(201,166,70,.35); }
input.copy { width: 100%; font: .85rem var(--uc-font-mono); background: var(--uc-pistachio-50); margin-top: 6px; }
input.sig { font-family: var(--uc-font-script); font-size: 1.6rem; }
.checks { display: grid; gap: 10px; border: 0; padding: 0; margin: 0; }
.checks legend { font-weight: 700; margin-bottom: 6px; }
.check { display: flex !important; flex-direction: row; gap: 10px; align-items: flex-start; font-weight: 400 !important; }
.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--uc-forest); }
.check span { display: grid; }
.filter { margin-bottom: 14px; }
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }
.flash--ok { background: var(--uc-mint-50); border: 1.5px solid var(--uc-teal); }
.flash--error { background: #fbe3e5; border: 1.5px solid var(--uc-coral-700); }

/* ---- Auth -------------------------------------------------------------------------- */
body.auth { background: var(--uc-pattern-checker-soft); min-height: 100vh; }
.auth__wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth__card { width: min(100%, 420px); background: var(--uc-pistachio-50); border: 2px solid var(--uc-forest); border-radius: var(--uc-radius-lg); padding: 30px; box-shadow: 8px 8px 0 var(--uc-forest); }
.auth__brand { text-align: center; font-size: 1.4rem; margin-bottom: 10px; }
.auth__card h1 { font-family: var(--uc-font-display); font-weight: 400; color: var(--uc-heading); text-align: center; margin-bottom: 16px; font-size: 1.8rem; }
.auth__alt { text-align: center; margin: 16px 0 0; font-size: .9rem; }

/* ---- Contracts (document + signing) ------------------------------------------------ */
.doc { max-width: 72ch; }
.doc__head h2 { font-family: var(--uc-font-display); font-weight: 400; color: var(--uc-heading); font-size: 1.6rem; letter-spacing: 0; text-transform: none; }
.doc__sub { color: var(--uc-ink-muted); margin-top: 4px; }
.doc h3 { font-family: var(--uc-font-caps); font-weight: 700; font-size: .95rem; letter-spacing: .06em; margin: 18px 0 6px; color: var(--uc-forest); }
.doc p, .doc li { line-height: 1.65; }
body.sign { background: var(--uc-pistachio-50); }
.sign__wrap { max-width: 820px; margin: 0 auto; padding: 30px 18px 60px; }
.sign__club { font-family: var(--uc-font-caps); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--uc-gold-ink); }
.sign__foot { text-align: center; color: var(--uc-ink-muted); font-size: .85rem; }
.evidence dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
.evidence dt { font-weight: 600; }
.evidence dd { margin: 0; word-break: break-all; }

/* ---- Responsive / print ------------------------------------------------------------ */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .side nav ul { grid-auto-flow: column; overflow-x: auto; }
  .grid2, .grid2--wide-left, .form--grid { grid-template-columns: 1fr; }
}
@media print {
  .side, .banner, .noprint, .actions { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; border: 0; }
}

.table input.copy { min-width: 300px; margin-top: 0; }
