:root {
  --navy: #001d3d;
  --navy-2: #003566;
  --blue: #0077b6;
  --bright: #00a6fb;
  --green: #2da44e;
  --red: #c62828;
  --gold: #f4b942;
  --ink: #132238;
  --muted: #607086;
  --line: #dbe4ec;
  --surface: #ffffff;
  --background: #f3f7fa;
  --shadow: 0 12px 32px rgba(0, 29, 61, .10);
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: 'Arial Narrow', 'Roboto Condensed', sans-serif; line-height: 1.05; }
h1 { font-size: clamp(2.6rem, 8vw, 5rem); font-style: italic; text-transform: uppercase; letter-spacing: -.025em; }
h2 { font-size: clamp(1.7rem, 4vw, 2.5rem); margin-bottom: .6rem; }
h3 { font-size: 1.35rem; }
a { color: var(--blue); }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 80px; }
.shell--narrow { width: min(720px, calc(100% - 28px)); }
.hero { color: white; background: linear-gradient(135deg, var(--navy), var(--navy-2)); margin: -48px -24px 28px; padding: 64px 32px 36px; border-radius: 0 0 24px 24px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero::after { content: ''; position: absolute; width: 230px; height: 230px; border: 35px solid rgba(0,166,251,.15); border-radius: 50%; right: -70px; top: -80px; }
.hero h1 { margin-bottom: 0; }
.hero__season { color: #b9e6ff; font-weight: 600; font-size: 1.15rem; }
.eyebrow { margin: 0 0 6px; color: var(--bright); font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 4px 18px rgba(0,29,61,.06); }
.intro-card, .form-card, .success-card, .closed-card { padding: clamp(22px, 5vw, 36px); margin-bottom: 20px; }
.success-card, .closed-card { text-align: center; padding-block: 52px; }
.status-icon { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 18px; background: #daf4e1; color: var(--green); border-radius: 50%; font-size: 2rem; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 20px; font-weight: 600; }
.field b, .checkbox-field b { color: var(--red); }
.field small { color: var(--muted); font-weight: 400; }
input, select, textarea { width: 100%; border: 1px solid #bdcad7; border-radius: 8px; padding: 12px 13px; background: white; color: var(--ink); font: inherit; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,119,182,.14); }
.choice-field { border: 0; padding: 0; margin: 0 0 20px; }
.choice-field legend { margin-bottom: 10px; font-weight: 600; }
.choice-field label, .checkbox-field { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 9px; }
.choice-field input, .checkbox-field input { width: auto; margin-top: 5px; accent-color: var(--blue); }
.checkbox-field { margin-bottom: 24px; }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.button { display: inline-flex; justify-content: center; align-items: center; border: 0; border-radius: 8px; padding: 10px 16px; font: 700 1rem system-ui, sans-serif; cursor: pointer; text-decoration: none; transition: transform .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button--primary { color: white; background: var(--blue); }
.button--primary:hover { background: var(--navy-2); }
.button--secondary { color: var(--navy); background: #e8f1f7; }
.button--large { width: 100%; min-height: 50px; font-size: 1.08rem; }
.alert { max-width: 100%; margin: 0 0 20px; padding: 14px 18px; border-radius: 10px; }
.alert--error { color: #7b1111; background: #ffebeb; border: 1px solid #f5bcbc; }
.alert--success { color: #155d2a; background: #e4f6e8; border: 1px solid #b8e4c2; }
.alert ul { margin-bottom: 0; }

.admin-login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(145deg, var(--navy), #052b51); }
.login-shell { width: min(430px, calc(100% - 28px)); }
.login-brand { color: white; text-align: center; }
.login-brand h1 { font-size: 3rem; }
.login-card { padding: 28px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 20px clamp(20px, 4vw, 56px); color: white; background: var(--navy); }
.admin-header h1 { margin: 0; font-size: 2.1rem; }
.admin-header nav { display: flex; gap: 20px; }
.admin-header a { color: white; text-decoration: none; font-weight: 600; }
.admin-header nav form { margin: 0; }
.link-button { border: 0; padding: 0; color: white; background: transparent; font-family: inherit; font-size: 1rem; font-weight: 600; cursor: pointer; }
.admin-main { width: min(1500px, calc(100% - 32px)); margin: 0 auto; padding: 34px 0 80px; }
.admin-section { margin-bottom: 42px; }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 4px; }
.section-heading p:not(.eyebrow) { color: var(--muted); margin-bottom: 0; }
.status-badge, .tag { display: inline-flex; border-radius: 99px; padding: 5px 10px; font-size: .75rem; font-weight: 700; white-space: nowrap; }
.status-badge--open { color: #17672e; background: #daf4e1; }
.status-badge--closed { color: #6c4210; background: #fae8c9; }
.status-badge--assignment_draft { color: #07577d; background: #d9f2ff; }
.status-badge--approved { color: white; background: var(--green); }
.settings-card { padding: 0; }
.settings-card summary, .participant-table-card summary { cursor: pointer; padding: 18px 22px; font-weight: 700; }
.settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; border-top: 1px solid var(--line); padding: 22px; }
.field--wide { grid-column: 1 / -1; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 42px; }
.stat-card { display: flex; flex-direction: column; padding: 20px; color: white; background: linear-gradient(145deg, var(--navy-2), var(--blue)); border-radius: 12px; }
.stat-card strong { font: 700 2.4rem 'Arial Narrow', sans-serif; }
.stat-card span { opacity: .85; }
.league-settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 16px; }
.league-settings-card { padding: 20px; }
.league-settings-card--new { border: 2px dashed #a8bfce; background: rgba(255,255,255,.5); }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.admin-assignment-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.admin-assignment-card { display: grid; gap: 12px; padding: 18px; }
.league-board { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; align-items: start; }
.league-column { min-height: 280px; border: 1px solid #cddae5; border-radius: 14px; background: #eaf1f6; overflow: hidden; }
.league-column > header { padding: 16px; color: white; background: var(--navy-2); }
.league-column > header div { display: flex; justify-content: space-between; align-items: center; }
.league-column h3 { margin: 0; }
.participant-list { min-height: 220px; padding: 10px; transition: background .15s; }
.participant-list.is-over { background: #d5ebf7; }
.participant-card { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px; margin-bottom: 8px; background: white; border: 1px solid #d9e3eb; border-radius: 9px; box-shadow: 0 2px 5px rgba(0,29,61,.05); cursor: grab; }
.participant-card.is-dragging { opacity: .45; }
.participant-card--admin { border-left: 4px solid var(--gold); cursor: default; }
.participant-card strong, .participant-card span { display: block; }
.participant-card span { color: var(--muted); font-size: .82rem; }
.card-tags { display: flex; align-items: center; gap: 6px; }
.tag--admin { color: #694206 !important; background: #fff0bf; }
.tag--joined { color: #17672e !important; background: #daf4e1; }
.mail-dot { width: 9px; height: 9px; border-radius: 50%; background: #aeb9c3; }
.mail-dot--sent { background: var(--green); }
.mail-dot--failed { background: var(--red); }
.unassigned { padding: 16px; margin-bottom: 16px; border-color: var(--gold); }
.action-panel { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 26px; }
.action-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.participant-table-card { overflow: hidden; }
.table-scroll { overflow-x: auto; border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); background: #f7f9fb; font-size: .78rem; text-transform: uppercase; }

@media (max-width: 760px) {
  .admin-header, .section-heading, .action-panel { align-items: flex-start; flex-direction: column; }
  .admin-header nav { width: 100%; justify-content: space-between; }
  .settings-grid, .stats-grid { grid-template-columns: 1fr 1fr; }
  .field--wide { grid-column: 1 / -1; }
  .league-board { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .stats-grid, .settings-grid { grid-template-columns: 1fr; }
  .field--wide { grid-column: auto; }
  .hero { margin-inline: -14px; }
}
