/* Micro Soccer — global styles */

:root {
  --ink: #0A0A0A;
  --ink-2: #2A2A2A;
  --paper: #F5F1E8;
  --paper-2: #ECE6D6;
  --paper-3: #E0D9C5;
  --red: #E11A1A;
  --red-deep: #A60F0F;
  --pitch: #1F8A3E;
  --pitch-deep: #156329;
  --pitch-line: rgba(31, 138, 62, 0.22);
  --chalk: #FFFFFF;
  --shadow: 0 2px 0 rgba(10,10,10,0.9);
  --shadow-card: 8px 8px 0 var(--ink);
}

[data-theme="dark"] {
  --ink: #F5F1E8;
  --ink-2: #C9C2AE;
  --paper: #0A0A0A;
  --paper-2: #161616;
  --paper-3: #222222;
  --red: #FF2E2E;
  --red-deep: #C71414;
  --pitch: #2BB957;
  --pitch-deep: #1F8A3E;
  --pitch-line: rgba(43, 185, 87, 0.28);
  --chalk: #0A0A0A;
  --shadow: 0 2px 0 rgba(245,241,232,0.9);
  --shadow-card: 8px 8px 0 var(--ink);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 0.2s, color 0.2s;
}

a { color: inherit; text-decoration: none; }

button { font-family: inherit; cursor: pointer; }

/* TYPE */
.display {
  font-family: 'Bebas Neue', 'Archivo Black', sans-serif;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 0.9;
  text-transform: uppercase;
}
.chunky {
  font-family: 'Archivo Black', sans-serif;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}
.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.7;
}

/* NAV */
.ms-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--ink);
  color: var(--paper);
  border-bottom: 3px solid var(--red);
  height: 72px;
  display: flex; align-items: center;
  padding: 0 24px;
}
.ms-nav-inner {
  max-width: 1440px; width: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
}
.ms-logo {
  display: flex; align-items: center; gap: 12px;
}
.ms-logo-badge {
  width: 40px; height: 40px;
  background: var(--red);
  border: 2px solid var(--paper);
  display: grid; place-items: center;
  font-family: 'Archivo Black', sans-serif;
  color: var(--paper);
  font-size: 18px;
  transform: rotate(-4deg);
  position: relative;
}
.ms-logo-badge::after {
  content: '';
  position: absolute; inset: 3px;
  border: 1px solid var(--paper);
  opacity: 0.5;
}
.ms-logo-text {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: 0.04em;
  line-height: 1;
}
.ms-logo-text small {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.22em;
  color: var(--red);
  margin-top: 2px;
}
.ms-nav-links {
  display: flex; gap: 28px; align-items: center;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.06em;
}
.ms-nav-links a {
  position: relative;
  padding: 6px 0;
  opacity: 0.7;
  transition: opacity 0.15s;
}
.ms-nav-links a:hover { opacity: 1; }
.ms-nav-links a.active {
  opacity: 1;
  color: var(--paper);
}
.ms-nav-links a.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 3px; background: var(--red);
}
.ms-nav-cta {
  background: var(--red);
  color: var(--paper);
  border: none;
  padding: 10px 18px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform 0.1s;
}
.ms-nav-cta:hover { transform: translate(-1px,-1px); box-shadow: 2px 2px 0 var(--paper); }

/* MOBILE NAV */
.ms-nav-mobile-toggle { display: none; }
@media (max-width: 880px) {
  .ms-nav-links { display: none; }
  .ms-nav-cta { display: none; }
  .ms-nav-mobile-toggle {
    display: grid; place-items: center;
    width: 40px; height: 40px;
    background: var(--red); color: var(--paper);
    border: none; cursor: pointer;
  }
  .ms-nav-links.open {
    display: flex;
    position: absolute; top: 72px; left: 0; right: 0;
    background: var(--ink);
    flex-direction: column; gap: 0;
    padding: 8px 0;
    border-bottom: 3px solid var(--red);
  }
  .ms-nav-links.open a {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(245,241,232,0.1);
    width: 100%;
  }
}

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 20px;
  letter-spacing: 0.06em;
  padding: 14px 22px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
  box-shadow: 4px 4px 0 var(--ink);
  text-transform: uppercase;
}
.btn:hover {
  transform: translate(-2px,-2px);
  box-shadow: 6px 6px 0 var(--ink);
}
.btn:active {
  transform: translate(2px,2px);
  box-shadow: 0 0 0 var(--ink);
}
.btn-red { background: var(--red); border-color: var(--red); color: var(--paper); box-shadow: 4px 4px 0 var(--ink); }
.btn-red:hover { box-shadow: 6px 6px 0 var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }

/* PITCH LINES BG */
.pitch-bg {
  background-image:
    linear-gradient(var(--pitch-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--pitch-line) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* STICKER */
.sticker {
  display: inline-block;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  padding: 4px 10px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--ink);
  transform: rotate(-2deg);
}
.sticker-red { background: var(--red); color: var(--paper); }
.sticker-green { background: var(--pitch); color: var(--paper); }
.sticker-rot-pos { transform: rotate(2deg); }

/* DIAGONAL RED BAND */
.red-band {
  background: var(--red);
  color: var(--paper);
  padding: 10px 0;
  overflow: hidden;
  position: relative;
}
.red-band-track {
  display: flex; gap: 48px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 22px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  animation: scroll-x 30s linear infinite;
}
@keyframes scroll-x {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.red-band-track > span {
  display: inline-flex; align-items: center; gap: 14px;
}
.red-band-dot {
  width: 8px; height: 8px; background: var(--paper);
}

/* CONTAINER */
.container {
  max-width: 1440px; margin: 0 auto;
  padding: 0 24px;
}
@media (min-width: 768px) {
  .container { padding: 0 48px; }
}

/* SECTION HEADER */
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  padding-bottom: 20px;
  border-bottom: 3px solid var(--ink);
  margin-bottom: 32px;
  gap: 24px;
}
.section-head h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: clamp(36px, 6vw, 72px);
  margin: 0;
  line-height: 0.85;
}
.section-head .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  opacity: 0.6;
}

/* CARD */
.card {
  background: var(--paper-2);
  border: 2px solid var(--ink);
  padding: 24px;
  position: relative;
}
.card-shadow { box-shadow: var(--shadow-card); }

/* FOOTER */
.ms-footer {
  background: var(--ink);
  color: var(--paper);
  margin-top: 80px;
  padding: 64px 0 32px;
  border-top: 4px solid var(--red);
}
.ms-footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}
@media (max-width: 768px) {
  .ms-footer-grid { grid-template-columns: 1fr 1fr; }
}
.ms-footer h4 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 18px;
  letter-spacing: 0.08em;
  margin: 0 0 16px;
  color: var(--red);
}
.ms-footer ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 8px;
  font-size: 14px;
  opacity: 0.85;
}
.ms-footer ul a:hover { color: var(--red); }
.ms-footer-bottom {
  border-top: 1px solid rgba(245,241,232,0.15);
  padding-top: 24px;
  display: flex; justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
}

/* PHOTO PLACEHOLDER */
.photo {
  background:
    repeating-linear-gradient(45deg,
      var(--paper-3) 0 8px,
      var(--paper-2) 8px 16px);
  border: 2px solid var(--ink);
  position: relative;
  display: grid; place-items: center;
  color: var(--ink);
  overflow: hidden;
}
.photo .photo-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: var(--paper);
  padding: 4px 10px;
  border: 1px solid var(--ink);
}

/* INPUTS */
.input, .textarea, .select {
  width: 100%;
  background: var(--paper);
  border: 2px solid var(--ink);
  padding: 12px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--red);
  box-shadow: 4px 4px 0 var(--red);
}
.label {
  display: block;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 16px;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.label .req { color: var(--red); }
.help {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 6px;
}

/* TABLE */
table.ms-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
}
.ms-table thead {
  background: var(--ink);
  color: var(--paper);
}
.ms-table th {
  text-align: left;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 14px;
  letter-spacing: 0.1em;
  padding: 12px 10px;
  font-weight: 400;
}
.ms-table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--paper-3);
}
.ms-table tbody tr:hover { background: var(--paper-2); }
.ms-table .num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  text-align: center;
  width: 48px;
}
.ms-table .pts {
  font-family: 'Archivo Black', sans-serif;
  font-size: 16px;
  text-align: center;
}

/* HEX PATTERN */
.hex-bg {
  background-color: transparent;
  background-image:
    radial-gradient(circle at 50% 0%, var(--ink) 1px, transparent 1.5px),
    radial-gradient(circle at 0% 50%, var(--ink) 1px, transparent 1.5px),
    radial-gradient(circle at 100% 50%, var(--ink) 1px, transparent 1.5px),
    radial-gradient(circle at 50% 100%, var(--ink) 1px, transparent 1.5px);
  background-size: 24px 24px;
  opacity: 0.18;
}

/* TAPE STRIP */
.tape {
  position: absolute;
  background: rgba(225, 26, 26, 0.7);
  border: 1px dashed rgba(0,0,0,0.25);
  width: 80px; height: 22px;
  transform: rotate(-6deg);
  z-index: 2;
}

/* SCROLL */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--paper-2); }
::-webkit-scrollbar-thumb { background: var(--ink); }

/* ============================================
   MOBILE — < 880px
   Overrides for inline-style grids and large
   typography on phones / small tablets.
   ============================================ */

/* Helper classes for JSX inline-style overrides */
.mobile-stack { }
.mobile-hide-md { }

@media (max-width: 880px) {
  html, body { font-size: 15px; }

  .container { padding: 0 16px !important; }

  /* NAV */
  .ms-nav { height: 60px; padding: 0 16px; }
  .ms-logo-text { font-size: 20px !important; }
  .ms-logo-text small { font-size: 8px !important; }
  .ms-logo-badge { width: 32px !important; height: 32px !important; font-size: 14px !important; }
  .ms-nav .ms-logo-img { height: 36px !important; }
  .ms-nav-links.open { top: 60px; }
  .ms-nav-links.open a { font-size: 20px; }

  /* TYPE — keep displays from blowing past viewport */
  h1.display, .display { word-break: break-word; }

  /* SECTION HEAD */
  .section-head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 14px;
  }
  .section-head h2 { font-size: clamp(32px, 9vw, 56px) !important; }

  /* CARD + general padding */
  .card { padding: 18px; }

  /* MOBILE STACK — collapse any 2-column inline grid that opts in */
  .mobile-stack {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  .mobile-stack-tight {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .mobile-stack-2 {
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
  }
  .mobile-hide { display: none !important; }
  .mobile-block { display: block !important; }

  /* Hero giant displays — clamp won't always save us; tighten max */
  .hero-display { font-size: clamp(56px, 14vw, 96px) !important; }
  .page-display { font-size: clamp(48px, 12vw, 84px) !important; }

  /* Hero red blob and ink square — scale + reposition so they don't
     swallow the headline on phones */
  .hero-blob { width: 320px !important; height: 320px !important; right: -20% !important; top: -10% !important; opacity: 0.85; }
  .hero-square { width: 100px !important; height: 100px !important; right: 4% !important; top: 4% !important; }

  /* MARQUEE BAND */
  .red-band-track { font-size: 16px; gap: 28px; }

  /* BUTTONS — full width feel on mobile, stay tappable */
  .btn { padding: 12px 16px; font-size: 17px; }

  /* FOOTER */
  .ms-footer { padding: 48px 0 24px; margin-top: 48px; }
  .ms-footer-grid { grid-template-columns: 1fr 1fr !important; gap: 24px !important; margin-bottom: 32px; }
  .ms-footer-bottom {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    font-size: 10px;
  }

  /* TABLES — horizontal scroll wrapper (assumed parent has overflow:auto) */
  .ms-table { font-size: 13px; }
  .ms-table th, .ms-table td { padding: 10px 8px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* STATS STRIP — 2x2 instead of 4-across */
  .stats-grid { grid-template-columns: 1fr 1fr !important; gap: 16px !important; }
  .stats-grid > * { border-right: none !important; padding-right: 0 !important; border-bottom: 1px solid rgba(245,241,232,0.15); padding-bottom: 16px; }

  /* MATCH ROW — reduce minimum column width */
  .fixtures-grid { grid-template-columns: 1fr !important; gap: 10px !important; }

  /* INPUTS — 16px font prevents iOS auto-zoom */
  .input, .textarea, .select { font-size: 16px; padding: 11px 12px; }

  /* PHOTOS / hero photo card — don't constrain to 380 cap on mobile */
  .hero-photo { max-width: 100% !important; margin-left: 0 !important; box-shadow: 6px 6px 0 var(--ink) !important; }

  /* Sticky aside — disable on mobile, it just steals viewport */
  .desktop-sticky { position: static !important; }

  /* Steps in register — wrap labels smaller */
  .reg-steps { flex-wrap: wrap; }
  .reg-steps button { flex: 1 0 50% !important; border-bottom: 2px solid var(--ink) !important; }
  .reg-steps button:nth-child(2) { border-right: none !important; }

  /* About tabs */
  .about-tabs button { padding: 12px 14px !important; font-size: 17px !important; }

  /* Generic 3-up rule grids etc. */
  .threeup { grid-template-columns: 1fr !important; gap: 16px !important; }

  /* Box feature grid - 4 cells -> 2 cells */
  .box-features { grid-template-columns: 1fr 1fr !important; }
}

@media (max-width: 480px) {
  .container { padding: 0 14px !important; }
  .hero-blob { width: 240px !important; height: 240px !important; right: -30% !important; }
  .hero-square { display: none !important; }
  .hero-display { font-size: clamp(48px, 13vw, 72px) !important; }
  .page-display { font-size: clamp(40px, 11vw, 64px) !important; }
  .stats-grid { grid-template-columns: 1fr !important; }
  .stats-grid > * { border-right: none !important; }
  .ms-footer-grid { grid-template-columns: 1fr !important; }
  .section-head h2 { font-size: clamp(28px, 10vw, 44px) !important; }
}
