/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

:root {
  color-scheme: dark light;
  --bg: #111418;
  --surface: #1a1e24;
  --text: #e8eaed;
  --text-dim: #9aa4b2;
  --accent: #4f8cff;
  --border: #2a2f37;
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  padding-bottom: 4.5rem; /* room for the fixed bottom nav */
}

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.app-header__brand {
  font-weight: 700;
}

.app-header__account {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}

.role-badge {
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
  padding: 0.15rem 0.4rem;
  border-radius: 0.25rem;
  background: var(--border);
  color: var(--text);
}

.role-badge--admin {
  background: var(--accent);
  color: #fff;
}

.app-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem;
}

.flash {
  padding: 0.6rem 0.9rem;
  border-radius: 0.4rem;
  margin: 0 0 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
}

.flash--alert {
  border-color: var(--danger);
  color: var(--danger);
}

.button,
.link-button {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 0.4rem;
  padding: 0.6rem 1rem;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}

.link-button {
  background: transparent;
  color: var(--text-dim);
  padding: 0;
  font-size: 0.85rem;
  text-decoration: underline;
}

.sign-in {
  text-align: center;
  padding-top: 3rem;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-nav__tab {
  flex: 1;
  text-align: center;
  padding: 0.85rem 0.25rem;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
}

.bottom-nav__tab--active {
  color: var(--accent);
  font-weight: 600;
}

.bottom-nav__tab--soon {
  opacity: 0.4;
}

.week-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.week-header h1 {
  font-size: 1.25rem;
  margin: 0;
}

.week-header__nav {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
  white-space: nowrap;
}

.week-header__nav--disabled {
  color: var(--text-dim);
  opacity: 0.5;
}

.week-header__window {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin: 0.25rem 0 1.5rem;
}

.empty-state {
  color: var(--text-dim);
}

.games-section {
  margin-bottom: 1.5rem;
}

.games-section h2 {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.game-card--voided {
  opacity: 0.6;
}

.game-card__header {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.game-card__kickoff {
  font-weight: 400;
  color: var(--text-dim);
  font-size: 0.85rem;
  white-space: nowrap;
}

.game-card__voided-note {
  color: var(--danger);
  margin: 0;
}

.game-card__markets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0;
}

.game-card__market dt {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.15rem;
}

.game-card__market dd {
  margin: 0;
  font-size: 0.85rem;
}

@media (max-width: 30rem) {
  .game-card__markets {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.games-section__sport {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  color: var(--text-dim);
  margin: 1rem 0 0.5rem;
}

.my-slots,
.board {
  margin-bottom: 1.5rem;
}

.my-slots h2,
.board h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.slot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
}

.slot-card--empty {
  border-style: dashed;
  color: var(--text-dim);
}

.slot-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.slot-card__description {
  margin: 0 0 0.25rem;
}

.slot-card__meta {
  margin: 0 0 0.5rem;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.slot-card__result {
  font-weight: 600;
  margin: 0;
}

.slot-card__result--win {
  color: #4caf7d;
}

.slot-card__result--loss {
  color: var(--danger);
}

.board-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.board-row__player {
  font-weight: 600;
  white-space: nowrap;
}

.board-row__picks {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  text-align: right;
}

.board-pick {
  font-size: 0.85rem;
}

.board-pick--hidden {
  color: var(--text-dim);
}

.pick-form {
  margin-top: 0.75rem;
  border-top: 1px solid var(--border);
  padding-top: 0.5rem;
}

.pick-form summary {
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
}

.pick-form fieldset {
  border: none;
  padding: 0;
  margin: 0.5rem 0;
}

.pick-form legend {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 0;
  margin-bottom: 0.25rem;
}

.pick-form__option {
  display: block;
  font-size: 0.9rem;
  padding: 0.15rem 0;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

th,
td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  color: var(--text-dim);
  font-weight: 600;
  font-size: 0.8rem;
}

.admin-inline-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f6f8;
    --surface: #ffffff;
    --text: #1a1e24;
    --text-dim: #5b6472;
    --border: #dde1e6;
  }
}
