:root {
  --navy: #141c34;
  --navy-2: #1b2542;
  --gold: #e0bd4f;
  --gold-dim: #c9a227;
  --bg: #0c0f16;
  --panel: #12151f;
  --panel-2: #181c29;
  --border: #262c3d;
  --text: #eaedf4;
  --muted: #8b93a7;
  --ok: #3fb96f;
  --amber: #d99e2b;
  --red: #e0645c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: 'JetBrains Mono', 'Share Tech Mono', ui-monospace, monospace;
  line-height: 1.6;
  font-size: 17px;
}

h1, h2, h3, h4 {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--text);
  margin-top: 0;
}
h3 { color: var(--gold); font-size: 0.95em; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }

/* ---------- MDT-style two-tier header ---------- */
.system-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 60px;
  padding: 0 24px;
  background: var(--navy);
  border-bottom: 1px solid var(--border);
}
.system-bar-left { display: flex; align-items: center; gap: 12px; min-width: 0; overflow: hidden; }
.system-bar-left .brand-logo { height: 34px; width: auto; flex-shrink: 0; }
.system-bar-left .greeting { font-size: 0.9em; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.system-bar-title {
  text-align: center;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 1.05em;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.system-bar-right { display: flex; align-items: center; gap: 12px; justify-content: flex-end; min-width: 0; flex-shrink: 0; }
.badge-chip {
  font-size: 0.88em;
  color: var(--gold);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 3px;
  letter-spacing: 0.04em;
}

.tab-bar {
  display: flex;
  justify-content: center;
  gap: 2px;
  background: var(--panel);
  border-top: 4px solid var(--gold);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.tab-bar .tab {
  padding: 13px 20px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.88em;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.tab-bar .tab:hover { color: var(--text); background: rgba(224, 189, 79, 0.06); }
.tab-bar .tab.active { color: var(--gold); border-bottom-color: var(--gold); }

.container { max-width: 1040px; margin: 0 auto; padding: 32px 20px 60px; }

.card-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 24px;
  margin-bottom: 18px;
}

h1 { font-size: 1.4em; text-transform: uppercase; letter-spacing: 0.05em; }
h2 { font-size: 1.1em; text-transform: uppercase; letter-spacing: 0.04em; }

.btn {
  display: inline-block;
  background: var(--gold);
  color: #14100a;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 18px;
  border: 1px solid var(--gold);
  border-radius: 3px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9em;
  transition: background 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--gold-dim); }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { border-color: var(--gold); color: var(--gold); }
.btn.small { padding: 7px 13px; font-size: 0.82em; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

label {
  display: block;
  font-size: 0.82em;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--panel-2);
  color: var(--text);
  margin-bottom: 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95em;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); }

.discord-login {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: #5865f2;
  color: white;
  padding: 13px 26px;
  border-radius: 3px;
  text-decoration: none;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85em;
  transition: background 0.15s;
}
.discord-login:hover { background: #4752c4; }

.hero { text-align: center; padding: 90px 20px 60px; }
.hero img { height: 92px; margin-bottom: 22px; }
.hero h1 { font-size: 1.6em; margin-bottom: 8px; }
.hero p { color: var(--muted); font-size: 0.95em; margin-bottom: 32px; }

.bingo-grid-wrap { position: relative; margin: 16px 0; }
.bingo-grid-wrap .win-lines { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }

.bingo-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.square {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  font-size: 0.9em;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: border-color 0.15s;
  min-width: 0;
}
.square:hover { border-color: var(--gold); }
.square.admin-square { aspect-ratio: auto; overflow: visible; min-height: 150px; }
.square.submitted { border-color: var(--amber); background: #20190c; }
.square.verified { border-color: var(--ok); background: #0d2117; }
.square .label {
  font-weight: 600;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.square .status-tag { font-size: 0.78em; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.lines-list { display: flex; flex-direction: column; gap: 6px; }
.line-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 14px;
  background: var(--panel-2);
  border-radius: 3px;
  border: 1px solid var(--border);
  font-size: 0.95em;
}
.tag {
  padding: 4px 11px;
  border-radius: 3px;
  font-size: 0.8em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.tag.pending { background: #2c2410; color: var(--amber); }
.tag.verified { background: #0d2117; color: var(--ok); }
.tag.paid { background: #0f1c2b; color: #6fa3d8; }

.team-list { display: flex; flex-direction: column; gap: 8px; }
.team-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 13px 15px; background: var(--panel-2); border-radius: 3px; border: 1px solid var(--border);
  font-size: 0.98em;
}

.modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(4, 6, 10, 0.75);
  align-items: center; justify-content: center;
  z-index: 10;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--panel);
  border: 1px solid var(--gold-dim);
  border-radius: 4px;
  padding: 24px;
  width: 90%;
  max-width: 440px;
}

.verify-toggle { display: inline-flex; cursor: pointer; }
.verify-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.verify-toggle .toggle-pill {
  font-size: 0.72em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 3px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--panel-2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.verify-toggle:hover .toggle-pill { border-color: var(--gold); color: var(--text); }
.verify-toggle input:checked + .toggle-pill { background: var(--ok); border-color: var(--ok); color: #08150e; }
.verify-toggle input:focus-visible + .toggle-pill { outline: 2px solid var(--gold); outline-offset: 1px; }

.error {
  color: var(--red);
  margin-bottom: 12px;
  font-weight: 600;
  border: 1px solid var(--red);
  background: #2a1210;
  padding: 10px 14px;
  border-radius: 3px;
  font-size: 0.85em;
}
.muted { color: var(--muted); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--panel-2); border-radius: 5px; }

/* ---------- mobile ---------- */
@media (max-width: 640px) {
  body { font-size: 15px; }

  .system-bar { padding: 0 12px; }
  .system-bar-left .greeting { display: none; }
  .system-bar-title { font-size: 0.85em; letter-spacing: 0.04em; }
  .badge-chip { display: none; }

  .tab-bar .tab { padding: 10px 12px; font-size: 0.72em; }

  .container { padding: 20px 12px 40px; }
  .card-box { padding: 16px; }

  h1 { font-size: 1.3em; }
  h2 { font-size: 1.05em; }

  .bingo-grid { gap: 4px; }
  .square { padding: 5px; font-size: 0.66em; justify-content: center; }
  .square .label { -webkit-line-clamp: 4; text-align: center; }
  .square .status-tag { display: none; }

  .line-row { padding: 10px 12px; font-size: 0.85em; flex-wrap: wrap; gap: 6px; }
  .team-row { padding: 11px 12px; font-size: 0.85em; flex-wrap: wrap; gap: 8px; }

  .modal { padding: 18px; }

  .hero { padding: 60px 16px 40px; }
  .hero img { height: 76px; }
  .hero h1 { font-size: 1.4em; }
}

/* ---------- rules page ---------- */
.rules-body { font-size: 0.95em; line-height: 1.6; max-width: 760px; }
.rules-h {
  color: var(--gold);
  font-size: 1.05em;
  text-transform: none;
  letter-spacing: 0.02em;
  margin-top: 28px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.rules-h:first-child { margin-top: 0; }
.rules-subhead {
  font-weight: 700;
  color: var(--text);
  margin-top: 18px;
  margin-bottom: 4px;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 0.05em;
  color: var(--gold-dim);
}
.rules-p { margin: 4px 0; color: var(--text); }
.rules-list { margin: 4px 0 4px 0; padding-left: 1.3em; }
.rules-list li { margin-bottom: 4px; color: var(--text); }
.rules-list li::marker { color: var(--gold); }
.rules-gap { height: 4px; }

/* ---------- admin panel: card thumbnails ---------- */
.thumb-row { display: flex; gap: 20px; flex-wrap: wrap; margin: 14px 0; }
.thumb-card {
  display: block;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px;
  background: var(--panel-2);
  transition: border-color 0.15s;
  width: 116px;
  text-decoration: none;
}
.thumb-card:hover, .thumb-card.active { border-color: var(--gold); }
.thumb-card .thumb-label { font-size: 0.72em; text-align: center; margin-top: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.thumb-card.active .thumb-label { color: var(--gold); }
.mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; width: 96px; margin: 0 auto; }
.mini-square { aspect-ratio: 1 / 1; border-radius: 1px; background: var(--panel); border: 1px solid var(--border); }
.mini-square.submitted { background: var(--amber); border-color: var(--amber); }
.mini-square.verified { background: var(--ok); border-color: var(--ok); }
.board-detail { border-top: 1px solid var(--border); padding-top: 18px; margin-top: 8px; }
.rules-yellow { color: #1a1400; background: var(--gold); padding: 1px 4px; border-radius: 2px; font-weight: 700; }
.rules-red { color: var(--red); font-weight: 700; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
