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

:root {
  /* Fenway Greens Palette */
  --paper: #53786c;             /* Monster Green background */
  --panel: #3a564c;             /* Darker green surface */
  --panel-dark: #2f473e;        /* Deep shade for shadows */
  --line: #628377;              /* Crisp wall-seam border */
  
  --ink: #f7f9f8;               /* Scoreboard off-white for body text */
  --muted: #c3d4cd;             /* Muted text for subheadings */
  
  --primary: #936138;           /* Infied Dirt */
  --primary-glow: #7a4f2c;
  --accent: #fdb827;            /* Foul Pole Gold */
  --accent-hover: #e0a11d;
  
  /* Crimson Alert System (Fenway Red) */
  --crimson: #8a1c14;
  --crimson-bg: #2b1110;
  --crimson-light: #f8d8d5;

  /* Deep Navy System */
  --navy: #0c2340;              /* Core Deep Navy primary color */
  --navy-bg: #121c27;           /* Dark tinted background for navy cards/panels */
  --navy-light: #d9e1e8;        /* Light tinted background for navy badges */
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  /* Muted radial glare mimicking stadium lighting */
  background: radial-gradient(circle at 85% 10%, #688e80 0, transparent 35%), var(--paper);
  font-family: 'DM Sans', Arial, sans-serif;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 76px 0 90px;
}

.intro {
  max-width: 700px;
  margin-bottom: 55px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

.panel-kicker {
  margin: 0 0 36px;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 24px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

h1, h2 {
  margin: 0;
  font-family: 'Impact', 'Arial Narrow', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h1 {
  max-width: 650px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: .97;
}

h2 {
  font-size: 28px;
}

.lede {
  max-width: 520px;
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.constitution-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(700px, 100%);
  margin-bottom: 28px;
  padding: 18px 22px;
  color: var(--ink);
  background: var(--primary);
  border: 1px solid var(--primary);
  box-shadow: 6px 6px 0 var(--panel-dark);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.constitution-link small,
.constitution-link strong {
  display: block;
}

.constitution-link small {
  margin-bottom: 6px;
  color: var(--accent);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 1px;
}

.constitution-link strong {
  font-family: 'DM Sans', Arial, sans-serif;
  font-size: 17px;
  font-weight: 600;
}

.constitution-link > span:last-child {
  color: var(--accent);
  font-size: 24px;
}

.constitution-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.reference-links {
  width: min(700px, 100%);
  margin-bottom: 28px;
}

.reference-links .constitution-link {
  width: 100%;
  margin-bottom: 12px;
}

.reference-links .constitution-link:last-child {
  margin-bottom: 0;
}

.upload-panel {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 50px;
  padding: 38px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  box-shadow: 10px 10px 0 var(--panel-dark);
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

form {
  display: flex;
  align-items: stretch;
  gap: 12px;
}

.file-drop {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 12px 16px;
  border: 1px dashed var(--line);
  background: rgba(0, 0, 0, 0.12);
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.file-drop:hover {
  border-color: var(--accent);
}

.file-drop:hover strong {
  color: var(--accent);
}

.file-drop small,
.file-drop strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-drop small {
  margin-top: 3px;
  color: var(--muted);
}

.file-icon {
  display: grid;
  flex: 0 0 30px;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--accent);
  background: var(--primary);
  font-family: 'DM Mono', monospace;
  font-size: 18px;
}

input[type=file] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

button {
  border: 0;
  padding: 0 24px;
  color: var(--ink);
  background: var(--primary);
  font-family: 'Impact', 'Arial Narrow', sans-serif;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

button:hover {
  color: var(--accent);
  background: var(--primary-glow);
}

.alert {
  padding: 14px 18px;
  color: var(--ink);
  background: var(--crimson-bg);
  border-left: 4px solid var(--crimson);
}

.loading-screen {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(12, 35, 64, 0.94);
}

.loading-card {
  width: min(100%, 480px);
  padding: 42px 32px 38px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 5px solid var(--accent);
  box-shadow: 10px 10px 0 var(--panel-dark);
  text-align: center;
}

.loading-screen[hidden] {
  display: none;
}

.loading-card .panel-kicker {
  margin-bottom: 12px;
}

.loading-card h2 {
  color: var(--ink);
}

.loading-copy {
  margin: 12px 0 0;
  color: var(--muted);
}

.loading-dots {
  display: inline-block;
  width: 24px;
  overflow: hidden;
  vertical-align: bottom;
  animation: loading-dots 1.2s steps(4, end) infinite;
}

.baseball-loader {
  position: relative;
  width: 150px;
  height: 120px;
  margin: 0 auto 28px;
}

.diamond {
  position: absolute;
  right: 25px;
  bottom: 9px;
  width: 82px;
  height: 82px;
  transform: rotate(45deg);
  border: 2px solid var(--accent);
  background: rgba(83, 120, 108, 0.35);
}

.base {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--panel);
}

.base.first,
.base.second {
  top: -7px;
}

.base.first {
  right: -7px;
}

.base.second {
  left: -7px;
}

.base.third {
  bottom: -7px;
  left: -7px;
}

.base.home {
  right: -7px;
  bottom: -7px;
}

.stovetop {
  position: absolute;
  left: 21px;
  bottom: 5px;
  display: grid;
  grid-template-columns: repeat(2, 42px);
  gap: 8px 16px;
}

.burner {
  width: 42px;
  height: 42px;
  border: 2px solid var(--crimson-bg);
  border-radius: 50%;
  background: radial-gradient(circle, var(--crimson) 0 3px, transparent 4px 9px, var(--crimson) 10px 12px, transparent 13px);
}

.ball {
  position: absolute;
  top: 110px;
  left: 72px;
  width: 25px;
  height: 25px;
  color: #ffffff;
  font-size: 25px;
  line-height: 1;
  animation: run-bases 4.8s linear infinite;
}

.coffee {
  position: absolute;
  top: 28px;
  left: 26px;
  width: 32px;
  height: 32px;
  font-size: 27px;
  line-height: 1;
  animation: brew-burners 4.8s linear infinite;
}

@keyframes run-bases {
  0%, 8% {
    transform: translate(0, 0) rotate(0);
  }
  25%, 33% {
    transform: translate(58px, -58px) rotate(360deg);
  }
  50%, 58% {
    transform: translate(0, -116px) rotate(720deg);
  }
  75%, 83% {
    transform: translate(-58px, -58px) rotate(1080deg);
  }
  100% {
    transform: translate(0, 0) rotate(1440deg);
  }
}

@keyframes brew-burners {
  0%, 8% {
    transform: translate(0, 0);
  }
  25%, 33% {
    transform: translate(58px, 0);
  }
  50%, 58% {
    transform: translate(58px, 50px);
  }
  75%, 83% {
    transform: translate(0, 50px);
  }
  100% {
    transform: translate(0, 0);
  }
}

@keyframes loading-dots {
  0%, 20% {
    width: 0;
  }
  40% {
    width: 8px;
  }
  60% {
    width: 16px;
  }
  80%, 100% {
    width: 24px;
  }
}

.results-shell {
  padding-top: 50px;
}

.results-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 38px;
}

.results-header h1 {
  font-size: clamp(40px, 6vw, 66px);
}

.text-link {
  padding: 12px 18px;
  color: var(--accent);
  border: 1px solid var(--accent);
  text-decoration: none;
  font-family: 'DM Mono', monospace;
  font-size: 13px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.15s ease;
}

.text-link:hover {
  color: var(--primary);
  background: var(--accent);
}

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

.stat {
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.stat span {
  display: block;
  margin-bottom: 11px;
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  text-transform: uppercase;
}

.stat strong {
  font-family: 'Impact', sans-serif;
  font-size: 42px;
  letter-spacing: 1px;
}

.stat small {
  color: var(--muted);
  font-size: 14px;
}

.site-footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 32px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
}

.site-footer p {
  margin: 0 0 6px;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

.site-footer a {
  color: var(--accent);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--ink);
  text-decoration: underline;
}


.bad-number {
  color: #ff8b82;
}

.status-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 28px 0 48px;
  padding: 20px 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
}

.status-banner.has-violations {
  background: var(--crimson-bg);
  border-left-color: var(--crimson);
}

.status-banner.has-warnings {
  background: var(--navy-bg);
  border-left-color: var(--navy);
}

.status-banner p {
  margin: 4px 0 0;
  color: var(--muted);
}

.status-mark {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: var(--accent);
  background: var(--primary);
  font-family: 'DM Mono', monospace;
  font-size: 14px;
  font-weight: 500;
}

.has-violations .status-mark {
  color: var(--ink);
  background: var(--crimson);
}

.has-warnings .status-mark {
  color: var(--ink);
  background: var(--navy);
}

.section-heading {
  margin-bottom: 18px;
}

.section-heading .panel-kicker {
  margin-bottom: 8px;
}

.violations {
  margin-bottom: 48px;
}

.violation {
  margin: 8px 0;
  padding: 13px 16px;
  color: var(--ink);
  background: var(--crimson-bg);
  border-left: 4px solid var(--crimson);
}
.warnings {
  margin-bottom: 48px;
}

.warning {
  margin: 8px 0;
  padding: 13px 16px;
  color: var(--ink);
  background: var(--navy-bg);
  border-left: 4px solid var(--navy);
}

.table-wrap {
  overflow-x: auto;
  background: var(--panel);
  border: 1px solid var(--line);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
}

th {
  padding: 14px 16px;
  color: var(--accent);
  background: var(--primary);
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
}

td {
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 14px;
}

td strong,
td small {
  display: block;
}

td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.stats {
  color: var(--muted);
  font-family: 'DM Mono', monospace;
  font-size: 12px;
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 4px 8px;
  color: #53786c;
  background: #e8ede8;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 2px;
}

.badge.minors {
  color: #6c4d00;
  background: #fde8b3;
}

.badge.injured {
  color: #8a1c14;
  background: #f8d8d5;
}

.badge.reserves {
  color: #0c2340;
  background: #d9e1e8;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 28px, 560px);
    padding: 44px 0 60px;
  }

  .upload-panel {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px;
  }

  .upload-panel form {
    flex-direction: column;
  }

  .file-drop {
    min-height: 62px;
  }

  button {
    min-height: 52px;
  }

  .results-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat {
    padding: 16px;
  }

  .stat strong {
    font-size: 30px;
  }

  .loading-card {
    padding: 34px 22px 30px;
  }
}