/* Grey St. Tournament — built on the Tax Traders Design System.
   Flat colour fields, Creme base, Tax Black text, 5px/10px corners, no gradients/shadows/blur. */

@font-face { font-family: 'General Sans'; src: url('/brand/fonts/GeneralSans-Light.woff2') format('woff2'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('/brand/fonts/GeneralSans-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'General Sans'; src: url('/brand/fonts/GeneralSans-Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Sentient'; src: url('/brand/fonts/Sentient-Extralight.otf') format('opentype'); font-weight: 200; font-display: swap; }
@font-face { font-family: 'Sentient'; src: url('/brand/fonts/Sentient-Light.otf') format('opentype'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'American Grotesk'; src: url('/brand/fonts/american-grotesk-compressed-heavy.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
  /* brand palette */
  --tt-plum: #6b0d38;
  --tt-carrot: #e8402b;
  --tt-lavender: #c494f2;
  --tt-olive: #404530;
  --tt-blueberry: #004ab8;
  --tt-plum-tint: #ffd9ed;
  --tt-lavender-tint: #ebdbff;
  --tt-blueberry-tint: #99ddff;
  --tt-blueberry-mid: #009eff;
  --tt-plum-shade: #470428;
  --tt-lavender-shade: #450d8a;
  --tt-blueberry-shade: #00297d;
  --tt-creme: #faf7f0;
  --tt-white: #ffffff;
  --tt-light-blue: #ebf7ff;
  --tt-black: #1a1a1a;
  --tt-status-red: #f41939;
  --tt-status-green: #01a475;

  /* semantic */
  --bg: var(--tt-creme);
  --card: var(--tt-white);
  --text: var(--tt-black);
  --muted: color-mix(in srgb, var(--tt-black) 65%, transparent);
  --faint: color-mix(in srgb, var(--tt-black) 30%, transparent);
  --rule: color-mix(in srgb, var(--tt-black) 15%, transparent);
  --a: var(--tt-plum);          /* player A */
  --a-tint: var(--tt-plum-tint);
  --b: var(--tt-blueberry);     /* player B */
  --b-tint: var(--tt-light-blue);
  --bad: var(--tt-status-red);  /* mistakes: status colour, never a brand substitute */

  --sans: 'General Sans', system-ui, sans-serif;
  --serif: 'Sentient', Georgia, serif;
  --display: 'American Grotesk', 'Arial Narrow', sans-serif;
  --r-sm: 5px;
  --r-md: 10px;
  --ease: cubic-bezier(.4, 0, .2, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--sans); font-weight: 400; -webkit-font-smoothing: antialiased; }
strong, b { font-weight: 500; } /* General Sans never above Medium */
body.offline::after {
  content: 'Reconnecting'; position: fixed; top: 12px; right: 12px; padding: 8px 12px;
  background: var(--tt-black); color: var(--tt-creme); border-radius: var(--r-sm); font-size: 13px; z-index: 50;
}
canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }

/* ---------- type ---------- */
.caption { font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.display { font-family: var(--display); font-weight: 800; text-transform: uppercase; line-height: .95; letter-spacing: 0; }
.serif { font-family: var(--serif); font-weight: 300; }
h1, h2, h3 { font-weight: 500; letter-spacing: -.02em; line-height: 1.15; }
.muted { color: var(--muted); }

/* ---------- brand bits ---------- */
.logo { display: inline-flex; align-items: center; gap: 14px; }
.logo img { height: 22px; display: block; }
.logo .event { font-size: .75rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; padding-left: 14px; border-left: 1px solid currentColor; opacity: .8; }
.ico { display: inline-block; width: 1em; height: 1em; background: currentColor; -webkit-mask: var(--src) center / contain no-repeat; mask: var(--src) center / contain no-repeat; flex: none; vertical-align: -.12em; }
.mark { position: absolute; pointer-events: none; background: currentColor; -webkit-mask: url('/brand/graphics/mark-halftone.svg') center / contain no-repeat; mask: url('/brand/graphics/mark-halftone.svg') center / contain no-repeat; }
.fade { animation: fade .25s var(--ease); }
@keyframes fade { from { opacity: 0; } }

/* ---------- generic ---------- */
.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 16px; }
.card { background: var(--card); border-radius: var(--r-sm); padding: 24px; }
button, .btn {
  font: inherit; font-size: 14px; font-weight: 500; line-height: 1.33; cursor: pointer; border: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 16px 20px;
  border-radius: var(--r-sm); text-decoration: none; white-space: nowrap;
  background: var(--tt-white); color: var(--tt-black); box-shadow: inset 0 0 0 1px #c8c8c8;
  transition: background-color .25s var(--ease), color .25s var(--ease), box-shadow .25s var(--ease), transform .15s var(--ease);
}
button:hover, .btn:hover, button:focus-visible { background: #252525; color: var(--tt-white); box-shadow: inset 0 0 0 1px #252525; outline: none; }
button:active { transform: scale(.98); }
button:disabled { opacity: .4; cursor: not-allowed; background: var(--tt-white); color: var(--tt-black); box-shadow: inset 0 0 0 1px #c8c8c8; }
button.solid { background: var(--tt-black); color: var(--tt-creme); box-shadow: none; }
button.solid:hover { opacity: .88; }
button.quiet { background: transparent; box-shadow: none; padding: 8px 4px; color: var(--muted); }
button.quiet:hover { color: var(--tt-black); background: transparent; }
button.danger:hover { background: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
button .ico { font-size: 11px; }
input[type=text] {
  font: inherit; font-size: 1.15rem; padding: 15px 16px; border-radius: var(--r-md); width: 100%;
  border: 1.5px solid var(--tt-black); background: var(--tt-white); color: var(--text); outline: none;
}
input[type=text]:focus { box-shadow: 0 0 0 3px var(--tt-blueberry-mid); }

/* ---------- tags (5px, never pills) ---------- */
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: var(--r-sm); background: var(--tt-white); font-weight: 500; animation: fade .25s var(--ease); }
.tag .bot { font-size: .65rem; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 3px; background: var(--tt-lavender-tint); color: var(--tt-lavender-shade); }

/* ---------- passage rendering ---------- */
.passage { font-family: var(--sans); font-weight: 400; line-height: 1.7; word-break: break-word; white-space: pre-wrap; }
.passage .ok { color: var(--tt-black); }
.passage .bad { color: var(--tt-creme); background: var(--bad); border-radius: 2px; }
.passage .todo { color: var(--faint); }
.passage .caret { color: var(--faint); box-shadow: inset 2px 0 0 var(--tt-blueberry-mid); animation: blink 1s steps(1) infinite; }
.passage .ellipsis { color: var(--faint); }
@keyframes blink { 50% { box-shadow: inset 2px 0 0 transparent; } }

/* ---------- bracket ---------- */
.bracket { display: flex; gap: 32px; align-items: stretch; overflow-x: auto; padding: 4px 0 12px; }
/* Headings share one line; the match cards below them spread out vertically. */
.round { display: flex; flex-direction: column; min-width: 210px; }
.round .matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 12px; }
.round h4 { margin: 0 0 4px; }
.bm { background: var(--tt-white); border-radius: var(--r-sm); overflow: hidden; position: relative; z-index: 1; }
.bracket { position: relative; }
.bracket svg.links { position: absolute; top: 0; left: 0; pointer-events: none; overflow: visible; z-index: 0; }
.bracket svg.links path { fill: none; stroke: color-mix(in srgb, var(--tt-black) 25%, transparent); stroke-width: 1.5; }
.bracket svg.links path.won { stroke: var(--tt-blueberry); stroke-width: 2.5; }
.bracket svg.links .head { fill: color-mix(in srgb, var(--tt-black) 25%, transparent); stroke: none; }
.bracket svg.links .head.won { fill: var(--tt-blueberry); stroke: none; }
.bm.live { box-shadow: inset 0 0 0 2px var(--tt-carrot); }
.bm .slot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 500; }
.bm .slot + .slot { border-top: 1px solid var(--rule); }
.bm .slot.win { color: var(--tt-blueberry); }
.bm .slot.lose { color: var(--faint); text-decoration: line-through; }
.bm .slot.tbd { color: var(--faint); font-weight: 400; }
.bm .flag { font-size: 10px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; padding: 4px 14px; }
.bm .bye-tag { margin-left: 8px; font-size: .6em; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); vertical-align: .2em; }
.bm .flag.live { background: var(--tt-carrot); color: var(--tt-creme); }
.bm .flag.next { background: var(--tt-lavender-tint); color: var(--tt-lavender-shade); }

/* squeeze heat card: everyone in one list, ranked after the race */
.bm.heat .slot { padding-top: 7px; padding-bottom: 7px; }
.bm .rank { display: inline-block; min-width: 1.6em; color: var(--muted); font-weight: 400; }
.bm.heat .slot.lose { text-decoration: none; }
