/* ThunderBoard — shared styles. Deliberately dark: the board is the hero. */

/* BRANDING: when official ThunderBoard branding lands, swap the two accent
   tokens below (--gold, --maroon) for the brand palette, and drop a logo
   <img class="brand-logo"> into each page's header (slot is marked in the
   HTML; sizing rule is under .brand-logo). */

:root {
  --bg: #0c0e11;
  --panel: #14171c;
  --panel-2: #1a1e24;
  --line: #262b33;
  --ink: #ece9e2;
  --muted: #98a0ab;
  --gold: #ffc627;   /* ASU gold */
  --maroon: #8c1d40; /* ASU maroon */
  --ok: #3aa55d;
  --warn: #f2a71e;
  --bad: #d95c4a;
  --tile: #1d2127;
  --tile-glyph: #f4f1ea;
  --radius: 12px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 980px; margin: 0 auto; padding: 0 20px 60px; }

/* ---- header / footer ---- */
.site-head { padding: 26px 0 8px; display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.brand { font-weight: 800; letter-spacing: 0.16em; font-size: 18px; }
.brand-logo { height: 26px; vertical-align: middle; margin-right: 8px; }
.brand .sq { color: var(--gold); }
.site-head .sub { color: var(--muted); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
footer { margin-top: 48px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); padding-top: 18px; }

/* ---- cards & layout ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}
.card h2 { margin: 0 0 12px; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.card h3 { margin: 20px 0 8px; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.hint kbd { background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; font-size: 12px; }

/* ---- banner ---- */
.banner {
  margin-top: 22px; padding: 16px 20px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(140,29,64,.35), rgba(255,198,39,.12));
  border: 1px solid rgba(255,198,39,.35);
  font-size: 17px;
}
.banner strong { color: var(--gold); }
.banner.inactive { background: var(--panel); border-color: var(--line); color: var(--muted); }

/* ---- the board ---- */
/* .board-shell is the container-query scope; .board is the grid inside it.
   (cq units on the element that declares container-type resolve against the
   viewport, so gap/padding must live one level down.) */
.board-shell { container-type: inline-size; width: 100%; }
.board {
  display: grid;
  grid-template-columns: repeat(22, 1fr);
  /* tight columns, airy rows — like the physical board (row gap ≈ ⅓ tile height) */
  gap: 2.15cqw 0.65cqw;
  background: #08090b;
  border: 1px solid #23262c;
  border-radius: 10px;
  padding: 2cqw 2.2cqw;
  width: 100%;
}
.cell {
  aspect-ratio: 0.72;
  border-radius: 0.6cqw;
  background: linear-gradient(180deg, #262a31 0%, #1e2228 48%, #15181d 52%, #1b1f25 100%);
  color: var(--tile-glyph);
  display: flex; align-items: center; justify-content: center;
  /* thin strokes like the physical flaps */
  font-weight: 200;
  font-size: 3.4cqw;
  font-family: "Helvetica Neue", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  user-select: none;
  position: relative;
}
.cell.clickable { cursor: pointer; }
.cell.clickable:hover { outline: 1px solid rgba(255,198,39,.5); }
.cell.cursor { outline: 2px solid var(--gold); outline-offset: 1px; z-index: 1; }
.cell.flip { animation: flip .32s ease both; }
@keyframes flip {
  0% { transform: rotateX(0); }
  49% { transform: rotateX(-88deg); }
  51% { transform: rotateX(88deg); filter: brightness(1.4); }
  100% { transform: rotateX(0); }
}
/* color chips keep the split-flap midline via an overlay */
.cell[class*="chip-"]::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,.16) 0%, rgba(255,255,255,.02) 48%, rgba(0,0,0,.25) 52%, rgba(0,0,0,.08) 100%);
}
.chip-red { background: #d93a2b; } .chip-orange { background: #f2801e; }
.chip-yellow { background: #f4c52c; } .chip-green { background: #3aa55d; }
.chip-blue { background: #2f6fd6; } .chip-violet { background: #7b52c9; }
.chip-white, .chip-filled { background: #efeae0; }
.chip-black { background: #000; box-shadow: inset 0 0 0 1px #2a2e35; }

.board-mini { pointer-events: none; }
.board-mini .board { border-radius: 6px; }
.board-mini .cell { font-weight: 500; } /* thin strokes vanish at thumbnail size */

/* ---- live embed ---- */
.embed { border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.embed iframe { width: 100%; aspect-ratio: 16 / 8.4; border: none; display: block; }

/* ---- tabs ---- */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button {
  background: none; border: none; color: var(--muted); font: inherit; font-weight: 600;
  padding: 8px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ---- controls ---- */
button.btn, .btn {
  background: var(--panel-2); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; font-size: 14px; font-weight: 600;
  padding: 8px 14px; cursor: pointer;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--gold); color: #191102; border-color: var(--gold); }
.btn.primary:hover { filter: brightness(1.07); }
.btn.primary:disabled { opacity: .45; cursor: default; filter: none; }
.btn:disabled { opacity: .4; cursor: default; }
.btn:disabled:hover { border-color: var(--line); }
.btn.danger { color: #ff9d8f; border-color: #5c322c; }
.btn.small { padding: 4px 10px; font-size: 12.5px; }

textarea, input[type=text], input[type=password], input[type=datetime-local], select {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line);
  color: var(--ink); border-radius: 8px; padding: 10px 12px; font: inherit;
}
textarea { resize: vertical; text-transform: uppercase; }
textarea::placeholder { text-transform: none; }
label.lbl { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
input[type=checkbox] { width: auto; accent-color: var(--gold); }

.errors { color: #ffb0a3; font-size: 13.5px; margin-top: 8px; white-space: pre-line; }
.status { font-size: 14px; color: var(--muted); }
.status.ok { color: #7ed99a; }
.status.warn { color: var(--warn); }
.status.bad { color: #ffb0a3; }

/* ---- palette (design tab) ---- */
.palette { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.palette .swatch {
  width: 30px; height: 34px; border-radius: 6px; cursor: pointer;
  border: 2px solid transparent; padding: 0;
}
.palette .swatch.active { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(255,198,39,.3); }
.palette .mode {
  font-size: 12.5px; font-weight: 700; letter-spacing: .05em;
}

/* ---- send bar ---- */
.sendbar {
  display: flex; gap: 14px; align-items: center; justify-content: flex-end;
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line);
}

/* ---- badges ---- */
.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; padding: 2px 8px; border-radius: 20px;
  border: 1px solid var(--line); color: var(--muted);
}
.badge.active { color: #7ed99a; border-color: #2c5c3c; }
.badge.upcoming { color: #8fc1ff; border-color: #2c455c; }
.badge.ended { color: var(--muted); }
.badge.revoked, .badge.blocked, .badge.rejected, .badge.failed { color: #ffb0a3; border-color: #5c322c; }
.badge.pending { color: var(--warn); border-color: #5c4a1e; }
.badge.posted { color: #7ed99a; border-color: #2c5c3c; }
.badge.approval { color: #d9b3ff; border-color: #4a325c; }
.badge.ai { color: #7fd4e8; border-color: #24505c; }

/* ---- takeover history strip ---- */
.history { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; }
.hist {
  flex: 0 0 172px; cursor: pointer;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px;
}
.hist:hover { border-color: var(--gold); }
.hist .cap {
  display: flex; justify-content: space-between; align-items: center;
  gap: 6px; margin-top: 7px; font-size: 11.5px; color: var(--muted);
}

/* ---- admin lists ---- */
.list { display: flex; flex-direction: column; gap: 14px; }
.item {
  display: grid; grid-template-columns: 190px 1fr auto; gap: 16px; align-items: center;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px;
}
.item .meta { min-width: 0; }
.item .meta .name { font-weight: 700; }
.item .meta .detail { color: var(--muted); font-size: 13px; margin-top: 2px; overflow-wrap: anywhere; }
.item .actions { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.empty { color: var(--muted); font-style: italic; padding: 6px 0; }

.tk-row {
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.tk-row:last-child { border-bottom: none; }
.tk-row .name { font-weight: 700; min-width: 140px; }
.tk-row .when { color: var(--muted); font-size: 13px; }
.tk-row .spacer { flex: 1; }

.linkbox {
  background: var(--panel-2); border: 1px dashed var(--gold); border-radius: 8px;
  padding: 10px 12px; margin-top: 12px; font-size: 14px; word-break: break-all;
}

/* ---- about page ---- */
.hero { text-align: center; padding: 40px 0 10px; }
.hero h1 { font-size: 34px; margin: 0 0 6px; letter-spacing: .04em; }
.hero p { color: var(--muted); max-width: 640px; margin: 0 auto; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 20px; }
@media (max-width: 720px) { .about-cols { grid-template-columns: 1fr; } }

/* ---- ai instructions page ---- */
pre.instructions {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 18px; overflow-x: auto; font-size: 13px; line-height: 1.5;
  white-space: pre-wrap; word-break: break-word;
}

/* ---- admin two-column ---- */
.admin-grid { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }
.topbar { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.topbar .spacer { flex: 1; }

@media (max-width: 640px) {
  .item { grid-template-columns: 1fr; }
  .sendbar { flex-direction: column; align-items: stretch; }
}
