:root {
  --bg: #140a0c;
  --bg-elevated: #1c1014;
  --charcoal: #2a181c;
  --crimson: #8b1e2d;
  --crimson-deep: #5c1420;
  --gold: #d4af37;
  --text: #f5f0eb;
  --text-muted: #a89890;
  --win: #1f6b3a;
  --loss: #7a1f2a;
  --border: #3a2428;
  --font: "Segoe UI", "Trebuchet MS", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--charcoal);
  border-bottom: 1px solid var(--border);
}
.header-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}
.header-links a {
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.03em;
}
.brand-row {
  display: flex;
  align-items: center;
  gap: 50px;
}
.portal-brand-logo { height: 42px; width: auto; display: block; }
.vut-brand img { height: 36px; width: auto; display: block; }

.portal-main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }

.signup { text-align: center; }
.vpa-large { width: min(280px, 70vw); height: auto; margin: 0.5rem auto 1.5rem; display: block; }
.signup h1 { font-weight: 600; letter-spacing: 0.04em; }
.thanks { font-size: 1.2rem; color: var(--gold); }

.panel {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.4rem;
  margin: 1rem 0;
  text-align: left;
}
.form label, fieldset label { display: block; margin: 0.75rem 0; color: var(--text-muted); font-size: 0.92rem; }
input, select {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--charcoal);
  color: var(--text);
}
button {
  background: var(--crimson);
  color: var(--text);
  border: 0;
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: var(--crimson-deep); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.ghost { background: transparent; border: 1px solid var(--border); }
button.danger { background: var(--loss); }
.draft-btn { background: var(--win); }
.draft-btn:hover { filter: brightness(1.1); }

.flash-list { list-style: none; padding: 0; }
.flash { padding: 0.7rem 0.9rem; border-radius: 6px; margin-bottom: 0.6rem; }
.flash-error { background: #3a1218; border: 1px solid var(--loss); }
.flash-ok { background: #12301c; border: 1px solid var(--win); }
.muted { color: var(--text-muted); }
.narrow { max-width: 420px; margin: 0 auto; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.admin-actions { display: flex; align-items: center; gap: 0.6rem; }
a.button {
  display: inline-block;
  background: var(--crimson);
  color: var(--text);
  border-radius: 6px;
  padding: 0.6rem 1.1rem;
  font-weight: 600;
  text-decoration: none;
}
a.button.ghost { background: transparent; border: 1px solid var(--border); }
a.button:hover { text-decoration: none; background: var(--crimson-deep); }
a.button.ghost:hover { background: var(--charcoal); }
.add-player-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.25rem;
}
.add-player-row label { margin: 0; flex: 1 1 220px; }
.add-player-row .bot-check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 0 0 auto;
  color: var(--text);
  font-size: 1rem;
}
.add-player-row .bot-check input {
  width: 1.1rem;
  height: 1.1rem;
  margin: 0;
}
.signup-table { width: 100%; border-collapse: collapse; margin-top: 0.75rem; }
.signup-table th, .signup-table td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--border); }
.signup-table th { color: var(--crimson); font-weight: 600; }
.tpa-input { width: 5.5rem; }
.tpa-save-row td { border-bottom: 0; padding-top: 0.75rem; }
button.danger-text { color: var(--text); border-color: var(--loss); }

.round-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.round { margin: 1.75rem 0; }
.round h2 { color: var(--gold); font-size: 1rem; letter-spacing: 0.08em; text-transform: uppercase; }
.cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  text-align: center;
  min-height: 160px;
}
.cell.on-clock { outline: 2px solid var(--gold); box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.25); }
.cell-edit { margin-top: 0.55rem; text-align: left; }
.cell-edit label { margin: 0 0 0.4rem; }
.cell-edit button { width: 100%; }
.team-logo { width: 56px; height: 56px; object-fit: contain; margin: 0 auto 0.4rem; display: block; }
.team-logo.placeholder { background: var(--charcoal); border-radius: 6px; }
.team-name { margin: 0 0 0.5rem; font-weight: 600; }
.player-slot { margin: 0; min-height: 2.4rem; }
.pick-label { color: var(--text-muted); font-weight: 600; margin-right: 0.25rem; }
.pos { display: inline-block; margin-left: 0.35rem; color: var(--text-muted); font-size: 0.85rem; }
.clock { color: var(--gold); font-weight: 600; }
.clock-locked { color: #f0c36a; }

.team-admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.8rem; }
.team-card { border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem; }
.draft-list { margin-top: 0.5rem; width: 38rem; max-width: 100%; }
.draft-list h2 { color: var(--gold); font-size: 1rem; letter-spacing: 0.06em; margin: 1.25rem 0 0.4rem; }
.draft-list-row {
  display: grid;
  grid-template-columns: 12rem 5.5rem 4.5rem 10rem;
  align-items: center;
  column-gap: 0.75rem;
  min-height: 2.4rem;
  padding: 0.4rem 0;
  border: 0;
  border-bottom: 1px solid var(--border);
}
.draft-list-row > * { min-width: 0; }
.draft-list-row a {
  overflow-wrap: break-word;
  line-height: 1.3;
}
.draft-list-head {
  color: var(--crimson);
  font-weight: 600;
  border: 0;
}
.draft-list-row form { margin: 0; justify-self: stretch; }
.draft-actions { display: flex; align-items: center; gap: 0.4rem; }
.draft-list-row .draft-btn { width: auto; min-width: 5.4rem; }
.cancel-btn { background: var(--loss); color: var(--text); border: 0; border-radius: 6px; padding: 0.6rem 1.1rem; font-weight: 600; cursor: pointer; }
.cancel-btn:hover { filter: brightness(1.08); }
.board-head .button { margin: 0.35rem 0 0; }
.roster-limits { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; }
.roster-limits fieldset { border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; min-width: 16rem; }
.roster-limits label { display: inline-block; margin: 0.35rem 0.6rem 0.35rem 0; width: auto; }
.roster-limits input { display: inline-block; width: 4.2rem; margin-top: 0.2rem; }
.roster-viz h3 { margin: 0.9rem 0 0.4rem; font-size: 0.95rem; color: var(--gold); }
.roster-slots { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.roster-slot {
  min-width: 7.5rem;
  max-width: 11rem;
  flex: 1 1 7.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  background: var(--charcoal);
  min-height: 3.2rem;
}
.roster-slot.filled { border-color: var(--crimson); }
.roster-slot.final-slot { opacity: 0.9; }
.roster-slot .slot-pos { display: block; color: var(--text-muted); font-size: 0.75rem; }
.filter-row { margin: 1rem 0; max-width: 200px; }
.lottery-results { margin: 0.75rem 0 0; padding-left: 1.25rem; }
.lottery-results li { margin: 0.35rem 0; }

@media (max-width: 720px) {
  .round-grid { grid-template-columns: 1fr 1fr; }
  .portal-main { padding: 1.25rem 0.85rem 3rem; }
}
