/* ============================================================
   RA Fantasy Football — War Room Theme
   Dark broadcast-inspired. Scoreboard precision.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:ital,wght@0,400;0,600;0,700;0,800;0,900;1,700&family=Barlow:wght@400;500;600;700&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg:          #06090f;
  --bg-2:        #0c1220;
  --bg-3:        #111928;
  --bg-4:        #18243a;
  --border:      rgba(255,255,255,0.07);
  --border-hi:   rgba(240,181,34,0.4);

  --navy:        #0a1628;
  --red:         #c8102e;
  --red-dim:     #7a0b1c;
  --gold:        #f0b522;
  --gold-dim:    #a87e18;

  --txt:         #e0e8f0;
  --txt-2:       #8fa3be;
  --txt-3:       #4d6480;

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;

  --shadow-sm:   0 2px 8px rgba(0,0,0,.4);
  --shadow:      0 4px 24px rgba(0,0,0,.55);
  --shadow-lg:   0 8px 48px rgba(0,0,0,.7);

  --transition:  all .18s cubic-bezier(.4,0,.2,1);
}

/* ── Reset ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Barlow', system-ui, sans-serif;
  background: var(--bg);
  color: var(--txt);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ── Noise texture overlay ───────────────────────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: .45;
}

/* ── Typography ──────────────────────────────────────────── */
h1, h2, h3 {
  font-family: 'Barlow Condensed', sans-serif;
  letter-spacing: .5px;
  line-height: 1.1;
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--txt);
  margin-bottom: .6rem;
}

h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--txt-2);
  margin-bottom: .4rem;
}

p { color: var(--txt-2); }

/* ── Links ───────────────────────────────────────────────── */
a         { color: var(--gold);         text-decoration: none; transition: var(--transition); }
a:visited { color: var(--gold-dim); }
a:hover   { color: #ffd055; text-decoration: none; }

/* ── Navigation ──────────────────────────────────────────── */
.site-nav {
  background: var(--navy);
  border-bottom: 3px solid var(--red);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 500;
  box-shadow: 0 2px 32px rgba(0,0,0,.6);
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 58px;
  gap: 1rem;
}

.nav-brand {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: .4rem;
  flex-shrink: 0;
}

.nav-brand::before {
  content: '🏈';
  font-size: 1.2rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: .15rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar { display: none; }

.nav-links a {
  color: #7a90ad;
  padding: .35rem .65rem;
  border-radius: var(--radius-sm);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .3px;
  white-space: nowrap;
  transition: var(--transition);
  text-transform: uppercase;
}

.nav-links a:hover {
  color: var(--txt);
  background: rgba(255,255,255,.07);
}

.nav-links a.active {
  color: var(--gold);
  background: rgba(240,181,34,.12);
}

.nav-logout {
  color: #e05 !important;
  border: 1px solid rgba(200,16,46,.3) !important;
  margin-left: .35rem;
}

.nav-logout:hover {
  background: rgba(200,16,46,.15) !important;
  color: #ff4060 !important;
}

/* ── Page wrapper ────────────────────────────────────────── */
.page-wrapper {
  max-width: 1440px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* ── Scoreboard stripe (decorative top accent) ───────────── */
.page-wrapper > h1:first-child,
.page-header {
  position: relative;
  padding-bottom: .75rem;
  margin-bottom: 1.5rem;
}

.page-wrapper > h1:first-child::after,
.page-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 4rem;
  height: 3px;
  background: var(--red);
  border-radius: 2px;
}

/* ── Tables ──────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}

thead tr,
table > tr:first-child {
  background: var(--navy);
}

thead th,
thead td,
table > tr:first-child td {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .8rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: .8px;
  padding: .75rem 1rem;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}

td {
  font-family: 'Barlow', sans-serif;
  color: var(--txt);
  font-size: .875rem;
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

tr:last-child td { border-bottom: none; }

tbody tr {
  background: var(--bg-2);
  transition: background .12s;
}

tbody tr:nth-child(even) { background: var(--bg-3); }
tbody tr:hover            { background: var(--bg-4); }

/* Highlight current user's row */
tr.my-row td {
  background: rgba(240,181,34,.07) !important;
  font-weight: 700;
}

tr.my-row td:first-child {
  border-left: 3px solid var(--gold);
}

/* ── Inputs ──────────────────────────────────────────────── */
input[type='text'],
input[type='password'],
input[type='email'],
select,
textarea {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--txt);
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-family: 'Barlow', sans-serif;
  font-size: .95rem;
  width: 100%;
  transition: var(--transition);
  outline: none;
}

input[type='text']:focus,
input[type='password']:focus,
input[type='email']:focus,
select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,181,34,.15);
  background: var(--bg-4);
}

input[type='checkbox'] { accent-color: var(--gold); width: auto; }

/* ── Buttons ─────────────────────────────────────────────── */
input[type='submit'],
button,
.btn {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: var(--red);
  color: #fff;
  border: none;
  padding: .7rem 2rem;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  display: inline-block;
  text-decoration: none;
}

input[type='submit']:hover,
button:hover,
.btn:hover {
  background: #e0122f;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(200,16,46,.4);
  color: #fff;
  text-decoration: none;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-hi);
  color: var(--gold);
}

.btn-ghost:hover {
  background: rgba(240,181,34,.1);
  box-shadow: 0 4px 16px rgba(240,181,34,.2);
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

/* ── Payout banner ───────────────────────────────────────── */
.payout-banner {
  background: linear-gradient(135deg, var(--navy) 0%, #0f1e35 100%);
  border: 1px solid rgba(240,181,34,.25);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: .75rem;
}

.payout-banner::before {
  content: '🏆';
  font-size: 1.4rem;
  flex-shrink: 0;
}

.payout-banner span {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .5px;
}

/* ── Menu grid (home page) ───────────────────────────────── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: .9rem;
  margin-bottom: 2rem;
}

.menu-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.25rem 1rem;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: .45rem;
  position: relative;
  overflow: hidden;
}

.menu-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 60%, rgba(240,181,34,.04));
  pointer-events: none;
}

.menu-card:hover {
  background: var(--bg-3);
  border-color: var(--border-hi);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.menu-card-icon {
  font-size: 1.6rem;
  line-height: 1;
}

.menu-card-label {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--txt);
  text-transform: uppercase;
  letter-spacing: .5px;
}

.menu-card-sub {
  font-size: .78rem;
  color: var(--txt-3);
  font-weight: 500;
}

.menu-card:hover .menu-card-label { color: var(--gold); }

/* ── Payment info card ───────────────────────────────────── */
.payment-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.payment-block { }

.payment-block h3 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--txt-2);
  text-transform: uppercase;
  letter-spacing: .8px;
  margin-bottom: .5rem;
}

.payment-block address {
  font-style: normal;
  font-size: .875rem;
  color: var(--txt);
  line-height: 1.7;
}

.payment-block a {
  color: var(--gold);
}

/* ── Week selector ───────────────────────────────────────── */
.week-selector {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1.5rem;
}

.week-selector a {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  padding: .35rem .75rem;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--txt-2);
  transition: var(--transition);
}

.week-selector a:hover,
.week-selector a.active {
  background: var(--navy);
  border-color: var(--gold-dim);
  color: var(--gold);
  text-decoration: none;
}

/* ── Info / notice banners ───────────────────────────────── */
.info-banner {
  background: rgba(10,22,40,.6);
  border: 1px solid rgba(100,140,180,.2);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .875rem;
  color: var(--txt-2);
  margin-bottom: 1rem;
}

.info-banner strong { color: var(--txt); }

/* ── Position badges ─────────────────────────────────────── */
.pos { display: inline-block; padding: .15em .5em; border-radius: 4px; font-family: 'Barlow Condensed', sans-serif; font-size: .75rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.pos-QB  { background: #4c1d95; color: #ddd6fe; }
.pos-RB  { background: #064e3b; color: #6ee7b7; }
.pos-WR  { background: #1e3a8a; color: #93c5fd; }
.pos-TE  { background: #78350f; color: #fcd34d; }
.pos-K   { background: #7f1d1d; color: #fca5a5; }
.pos-DEF { background: #1f2937; color: #9ca3af; }

/* ── Rank number (standings) ─────────────────────────────── */
.rank-1 { color: var(--gold); font-weight: 800; }
.rank-2 { color: #b0b8c8; font-weight: 700; }
.rank-3 { color: #cd7c3a; font-weight: 700; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  border-top: 2px solid var(--red);
  padding: 1.25rem 1.5rem;
  margin-top: 4rem;
  text-align: center;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem .1rem;
  justify-content: center;
  list-style: none;
}

.footer-links li::after { content: '·'; color: var(--txt-3); margin-left: .1rem; }
.footer-links li:last-child::after { display: none; }

.footer-links a {
  color: var(--txt-3);
  font-size: .8rem;
  font-weight: 500;
  padding: .3rem .6rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: .3px;
}

.footer-links a:hover { color: var(--gold); background: rgba(255,255,255,.04); text-decoration: none; }

.footer-copy {
  margin-top: .75rem;
  font-size: .75rem;
  color: var(--txt-3);
}

/* ── Login page ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* Diagonal field lines */
.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  background: repeating-linear-gradient(
    -55deg,
    transparent,
    transparent 60px,
    rgba(255,255,255,.013) 60px,
    rgba(255,255,255,.013) 61px
  );
  pointer-events: none;
}

/* Glow blobs */
.login-page::after {
  content: '';
  position: fixed;
  top: -20%;
  left: -10%;
  width: 70%;
  height: 70%;
  background: radial-gradient(ellipse at center, rgba(200,16,46,.12) 0%, transparent 65%);
  pointer-events: none;
}

.login-glow {
  position: fixed;
  bottom: -15%;
  right: -5%;
  width: 60%;
  height: 60%;
  background: radial-gradient(ellipse at center, rgba(10,22,40,.7) 0%, transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.login-box {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.login-emoji {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: .75rem;
  display: block;
  animation: loginBounce 2.5s ease-in-out infinite;
}

@keyframes loginBounce {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

.login-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  line-height: 1;
  margin-bottom: .35rem;
}

.login-sub {
  font-size: .85rem;
  color: var(--txt-3);
  font-weight: 500;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.login-form-box {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.login-form-box .field {
  margin-bottom: 1.1rem;
}

.login-form-box label {
  display: block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--txt-2);
  margin-bottom: .4rem;
}

.login-form-box input[type='text'],
.login-form-box input[type='password'] {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--txt);
  padding: .8rem 1rem;
  font-size: 1rem;
  width: 100%;
  transition: var(--transition);
}

.login-form-box input[type='text']:focus,
.login-form-box input[type='password']:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,181,34,.12);
  background: var(--bg-4);
}

.login-form-box input[type='submit'] {
  width: 100%;
  padding: .9rem;
  font-size: 1.1rem;
  letter-spacing: 2px;
  margin-top: .5rem;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .82rem;
  color: var(--txt-3);
  margin-top: .75rem;
  cursor: pointer;
}

.login-links {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.login-links a {
  font-size: .8rem;
  color: var(--txt-3);
  text-transform: uppercase;
  letter-spacing: .5px;
  font-weight: 600;
  transition: var(--transition);
}

.login-links a:hover { color: var(--gold); text-decoration: none; }

.login-error {
  background: rgba(200,16,46,.15);
  border: 1px solid rgba(200,16,46,.35);
  border-radius: var(--radius);
  padding: .65rem 1rem;
  font-size: .875rem;
  color: #ffa3b0;
  margin-bottom: 1rem;
}

/* ── Animations ──────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.page-wrapper > * { animation: fadeUp .35s ease both; }
.page-wrapper > *:nth-child(2) { animation-delay: .05s; }
.page-wrapper > *:nth-child(3) { animation-delay: .10s; }
.page-wrapper > *:nth-child(4) { animation-delay: .15s; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-brand { font-size: 1.3rem; }
  .menu-grid { grid-template-columns: 1fr 1fr; }
  .payment-card { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .page-wrapper { padding: 0 .9rem; margin: 1rem auto; }
  h1 { font-size: 1.75rem; }
  .menu-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .login-form-box { padding: 1.5rem; }
}

/* ── Standings: bold = current user row ─────────────────── */
tbody tr td b { color: var(--gold); }
tbody tr:has(b) td {
  background: rgba(240,181,34,.06) !important;
}
tbody tr:has(b) td:first-child {
  border-left: 3px solid var(--gold);
}

/* ── Pre / address reset ─────────────────────────────────── */
pre, address {
  font-family: 'Barlow', sans-serif;
  font-size: .875rem;
  color: var(--txt-2);
  line-height: 1.75;
}

/* ── Scrollbar ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--txt-3); }
