/* =============================================================
   TRIP BOARD  -  design system
   Built by Nate Hladil / N8R5K  -  https://n8r5k.com
   (c) 2026 Nate Hladil. All rights reserved.
   -------------------------------------------------------------
   Direction: an airport departure board at 1am. Deep teal-black
   metal, amber split-flap numerals, one boarding-pass stub with
   a real perforation. Colour is used to identify players and
   nothing else - never to decorate.
   ============================================================= */

:root {
  --ink:      #08181d;
  --ink-2:    #0e262e;
  --ink-3:    #143540;
  --rule:     #1d4753;
  --amber:    #ffb020;
  --amber-dim:#8a6220;
  --paper:    #ece3d0;
  --mute:     #7ca3ad;
  --mint:     #3ddc97;
  --coral:    #ff5f56;

  --pad:      clamp(16px, 4vw, 34px);
  --radius:   4px;

  --display: 'Anton', 'Arial Narrow', sans-serif;
  --body:    'Space Grotesk', system-ui, sans-serif;
  --mono:    'IBM Plex Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--ink);
  background-image:
    repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

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

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 var(--pad) 90px; }

/* ---------- type ------------------------------------------- */

h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: .02em; margin: 0; }

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--mute);
}

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

/* ---------- boarding pass header ---------------------------- */

.pass {
  display: grid;
  grid-template-columns: 1fr auto;
  margin: var(--pad) 0 28px;
  background: linear-gradient(180deg, var(--ink-2), var(--ink));
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  overflow: hidden;
}

.pass-main { padding: clamp(18px, 3.4vw, 30px); }

.pass-main h1 {
  font-size: clamp(38px, 9vw, 82px);
  line-height: .92;
  text-transform: uppercase;
  color: var(--paper);
}

.pass-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin-top: 14px;
}

.pass-meta div { min-width: 88px; }
.pass-meta strong {
  display: block;
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 500;
  color: var(--amber);
}

/* the perforated stub - the signature element */
.stub {
  position: relative;
  padding: clamp(18px, 3.4vw, 30px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-width: 168px;
  background:
    radial-gradient(circle at left, var(--ink) 5px, transparent 5px) left / 100% 16px repeat-y;
  border-left: 2px dashed var(--rule);
}

.stub .big {
  font-family: var(--mono);
  font-size: clamp(34px, 7vw, 52px);
  font-weight: 600;
  color: var(--amber);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 640px) {
  .pass { grid-template-columns: 1fr; }
  .stub {
    border-left: 0;
    border-top: 2px dashed var(--rule);
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding: 14px 18px;
  }
}

/* ---------- section headers --------------------------------- */

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 8px;
  margin: 38px 0 16px;
}

.sec-head h2 { font-size: clamp(20px, 3.4vw, 26px); text-transform: uppercase; }

/* ---------- standings (split-flap rows) --------------------- */

.board { display: flex; flex-direction: column; gap: 6px; }

.row {
  position: relative;
  display: grid;
  grid-template-columns: 46px 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--pcol, var(--rule));
  border-radius: var(--radius);
  color: inherit;
  overflow: hidden;
}

a.row:hover { background: var(--ink-3); text-decoration: none; }

/* proportional bar sits behind the content */
.row .fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--pct, 0%);
  background: linear-gradient(90deg, color-mix(in srgb, var(--pcol, #fff) 22%, transparent), transparent);
  pointer-events: none;
}

.row > * { position: relative; }

.row .pos {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--mute);
  text-align: center;
}

.row.lead .pos { color: var(--amber); }

.avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ink-3);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 17px;
  color: var(--ink);
  border: 2px solid var(--pcol, var(--rule));
}
.avatar.letters { background: var(--pcol, var(--ink-3)); }

.row .who { min-width: 0; }
.row .who b {
  display: block;
  font-family: var(--display);
  font-size: clamp(19px, 4vw, 25px);
  text-transform: uppercase;
  letter-spacing: .01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.row .who span { font-family: var(--mono); font-size: 11.5px; color: var(--mute); }

.row .pts {
  font-family: var(--mono);
  font-size: clamp(22px, 5vw, 30px);
  font-weight: 600;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

.crown { position: absolute; top: 6px; right: 8px; font-size: 12px; opacity: .8; }

/* ---------- feed -------------------------------------------- */

.feed { list-style: none; margin: 0; padding: 0; }

.feed li {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid var(--rule);
}

.feed .delta {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 15px;
  text-align: right;
  color: var(--mint);
}
.feed .delta.neg { color: var(--coral); }

.feed .what b { font-weight: 600; }
.feed .what small { display: block; color: var(--mute); font-size: 12.5px; }
.feed time { font-family: var(--mono); font-size: 11.5px; color: var(--mute); }

.feed .shot {
  width: 44px; height: 44px; border-radius: 3px; object-fit: cover;
  border: 1px solid var(--rule);
}

/* ---------- stamps (player breakdown) ----------------------- */

.stamps { display: flex; flex-wrap: wrap; gap: 12px; }

.stamp {
  padding: 12px 16px;
  border: 2px dashed var(--amber-dim);
  border-radius: var(--radius);
  transform: rotate(var(--tilt, -1.2deg));
  background: rgba(255,176,32,.05);
  min-width: 148px;
}
.stamp b { display: block; font-family: var(--display); font-size: 17px; text-transform: uppercase; }
.stamp span { font-family: var(--mono); font-size: 12px; color: var(--mute); }
.stamp em { font-style: normal; font-family: var(--mono); font-size: 21px; color: var(--amber); }

/* ---------- gallery ----------------------------------------- */

.grid-shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.grid-shots img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--rule);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--ink-3);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 13px;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
}
.btn:hover { background: var(--rule); text-decoration: none; }
.btn.primary { background: var(--amber); border-color: var(--amber); color: #201400; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--coral); border-color: #4a2020; }
.btn.small { min-height: 34px; padding: 0 11px; font-size: 11px; }

label { display: block; font-family: var(--mono); font-size: 11px; letter-spacing: .18em;
        text-transform: uppercase; color: var(--mute); margin: 0 0 5px; }

input, select, textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  background: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  color: var(--paper);
  font-family: var(--body);
  font-size: 16px;           /* 16px stops iOS zooming on focus */
}
textarea { min-height: 84px; resize: vertical; }
input[type=color] { padding: 4px; height: 46px; }
input[type=file] { padding: 9px; font-family: var(--mono); font-size: 13px; }

.field { margin-bottom: 14px; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }

.card {
  background: var(--ink-2);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(16px, 3vw, 24px);
  margin-bottom: 18px;
}

.note {
  padding: 12px 14px;
  border-left: 3px solid var(--amber);
  background: rgba(255,176,32,.07);
  border-radius: var(--radius);
  margin-bottom: 16px;
  font-size: 14.5px;
}
.note.bad { border-left-color: var(--coral); background: rgba(255,95,86,.08); }

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

.empty {
  padding: 34px 20px;
  text-align: center;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  color: var(--mute);
}
.empty b { display: block; font-family: var(--display); font-size: 22px; color: var(--paper);
           text-transform: uppercase; margin-bottom: 4px; }

/* ---------- admin ------------------------------------------- */

.admin-nav {
  display: flex; flex-wrap: wrap; gap: 6px;
  border-bottom: 1px solid var(--rule);
  padding: 12px 0;
  margin-bottom: 20px;
  position: sticky; top: 0; z-index: 20;
  background: var(--ink);
}
.admin-nav a {
  padding: 8px 13px; border-radius: var(--radius);
  font-family: var(--mono); font-size: 12px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--mute);
}
.admin-nav a:hover { background: var(--ink-2); text-decoration: none; color: var(--paper); }
.admin-nav a.on { background: var(--amber); color: #201400; font-weight: 600; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  padding: 14px; text-align: left; cursor: pointer;
  background: var(--ink-2); border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--paper); font-family: inherit;
}
.tile:hover { border-color: var(--amber); }
.tile.on { border-color: var(--amber); background: var(--ink-3); }
.tile b { display: block; font-family: var(--display); font-size: 17px; text-transform: uppercase; }
.tile span { font-family: var(--mono); font-size: 13px; color: var(--amber); }

table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { font-family: var(--mono); font-size: 10.5px; letter-spacing: .16em;
     text-transform: uppercase; color: var(--mute); }
.table-scroll { overflow-x: auto; }

/* ---------- footer ------------------------------------------ */

.foot {
  border-top: 1px solid var(--rule);
  margin-top: 46px;
  padding: 20px 0 6px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--mute);
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
}

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

@keyframes flip-in {
  from { transform: translateY(-6px) scaleY(.9); opacity: 0; }
  to   { transform: none; opacity: 1; }
}
.row { animation: flip-in .32s ease both; }

@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.06); } 100% { transform: scale(1); } }
.row.changed { animation: pop .5s ease; border-color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
