/* ============================================================
   THEME: Captain Tsubasa — anime / shonen manga
   Bold ink panels, halftone sky, speed-line energy, italic action type.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Anton&family=Mochiy+Pop+One&family=Inter:wght@500;700;800&display=swap");

:root {
  --bg: #eaf4ff;
  --text: #0c1b3a;
  --muted: #3f5b86;
  --line: #0c1b3a;
  --soft: #d6e8ff;
  --accent: #e60023;
  --ink: #0c1b3a;
  --pop: #ffd400;
}

body {
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 212, 0, 0.18), transparent 38%),
    repeating-linear-gradient(115deg, rgba(12, 27, 58, 0.05) 0 2px, transparent 2px 9px),
    linear-gradient(160deg, #eaf4ff 0%, #c4ddff 100%);
  background-attachment: fixed;
  font-family: Inter, system-ui, sans-serif;
  font-weight: 500;
}

/* --- Big slanted manga title with speed lines --- */
.marquee {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(14px, 3vw, 34px);
  min-height: 148px;
  margin-bottom: 14px;
  padding: 12px clamp(14px, 3vw, 28px) 10px;
  border: 4px solid var(--ink);
  border-radius: 4px;
  background: var(--pop);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: visible;
}
.marquee::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(105deg, transparent 0 8px, rgba(12, 27, 58, 0.08) 8px 10px);
  pointer-events: none;
}
.marquee-copy {
  position: relative;
  z-index: 2;
  flex: 1 1 58%;
  min-width: 0;
}
.marquee h1 {
  position: relative;
  font-family: Anton, Impact, sans-serif;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  line-height: 0.92;
  text-transform: uppercase;
  color: var(--accent);
  -webkit-text-stroke: 2px var(--ink);
  text-shadow: 4px 4px 0 #fff, 6px 6px 0 var(--ink);
}
.marquee-art {
  position: relative;
  align-self: flex-end;
  flex: 0 0 clamp(94px, 15vw, 154px);
  z-index: 1;
  width: clamp(94px, 15vw, 154px);
  height: clamp(98px, 15vw, 156px);
  max-width: 30%;
  max-height: 156px;
  object-fit: cover;
  object-position: 78% 30%;
  clip-path: polygon(18% 4%, 92% 0, 100% 82%, 70% 100%, 5% 84%, 0 24%);
  pointer-events: none;
}

/* --- Tabs as manga action buttons --- */
.view-tabs {
  gap: 8px;
  border-bottom: 0;
}
.view-tabs button {
  font-family: "Mochiy Pop One", sans-serif;
  font-size: 0.82rem;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.05s ease;
}
.view-tabs button.active {
  color: #fff;
  background: var(--accent);
  border-bottom-color: var(--ink);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

/* --- Section headings --- */
h2 {
  font-family: Anton, Impact, sans-serif;
  font-weight: 400;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: var(--ink);
}
h2::before {
  content: "▶ ";
  color: var(--accent);
}
.board-head {
  border-bottom: 3px solid var(--ink);
  padding-bottom: 8px;
}

/* --- Tables as bold ink panels --- */
/* Style the container, not the <table>: base sets border-collapse, which makes
   border-radius a no-op on the table itself (square corners). The group cards
   already frame an article wrapper, so framing the contender wrapper keeps the
   rounded manga panel consistent across every view. */
.contender-table,
.group-table {
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  overflow: hidden;
}
.contender-table thead th,
.group-table thead th {
  background: var(--ink);
  color: var(--pop);
  font-family: Inter, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
}
/* Inner tables share the white card surface (were inheriting --bg). */
.contender-table table,
.group-table table {
  background: #fff;
}
/* Give the points column room so "PTS" isn't clipped in the tight grid. */
.group-table th:last-child,
.group-table td:last-child {
  width: 34px;
}
th,
td {
  border-bottom: 2px solid rgba(12, 27, 58, 0.18);
}
.gambler-name {
  font-family: "Mochiy Pop One", sans-serif;
  color: var(--ink);
}
.contender-row strong,
.group-table strong,
.match-card strong {
  color: var(--accent);
  font-family: Anton, sans-serif;
  font-style: italic;
}
/* Almost every group row is a picked team, so keep the highlight faint —
   otherwise the group tables read as blue against the white standings table. */
tr.selected {
  background: #eef4fd;
}

.group-table .card-context {
  font-family: Anton, Impact, sans-serif;
  background: var(--accent);
  color: #fff;
  border-bottom: 3px solid var(--ink);
  min-height: 42px;
  padding: 8px 10px;
}
.group-table .card-context h3,
.fixture .card-context h3,
.match-card .card-context h3 {
  font-family: Anton, Impact, sans-serif;
  font-weight: 400;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  line-height: 1.28;
}
.group-table .card-context h3 {
  color: #fff;
}
.group-table .fixture-share {
  color: #fff;
}

/* --- Flags get a thick ink frame --- */
.team-flag img,
.table-flag {
  border: 2px solid var(--ink);
  border-radius: 2px;
}

/* --- Fixtures & knockout cards as manga panels --- */
.fixture,
.match-card {
  border: 3px solid var(--ink);
  border-radius: 4px;
  background: #fff;
  box-shadow: 4px 4px 0 var(--ink);
}
.fixture.next {
  background: var(--pop);
  border-color: var(--accent);
  box-shadow: 4px 4px 0 var(--accent);
}
.fixture.next .card-context h3 {
  color: var(--ink);
}
.fixture-foot {
  border-top: 2px dashed var(--ink);
}
.fixture .card-context h3,
.match-card .card-context h3 {
  color: var(--accent);
}
.fixture-foot .fixture-live {
  color: var(--accent);
  font-family: "Mochiy Pop One", sans-serif;
}
.fixture-day,
.round-column h3 {
  font-family: "Mochiy Pop One", sans-serif;
  color: #fff;
  background: var(--accent);
  border: 3px solid var(--ink);
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--ink);
}

.fixture.deep-linked,
.match-card.deep-linked,
.group-table.deep-linked {
  box-shadow: inset 0 0 0 4px var(--pop), 4px 4px 0 var(--ink);
}

@media (max-width: 430px) {
  .marquee {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 88px;
    gap: 8px;
    min-height: 112px;
    padding: 8px 10px;
  }
  .marquee-copy {
    width: auto;
  }
  .marquee h1 {
    font-size: clamp(1.9rem, 12vw, 3rem);
    text-shadow: 3px 3px 0 #fff, 5px 5px 0 var(--ink);
  }
  .marquee-art {
    width: 88px;
    height: 92px;
    max-width: 88px;
    max-height: 92px;
  }

  /* Keep the manga tab font, but trim the chrome for narrow iPhones. */
  .view-tabs {
    gap: 5px;
  }
  .view-tabs button {
    font-size: 0.68rem;
    padding: 8px 1px;
    border-width: 2px;
    box-shadow: 2px 2px 0 var(--ink);
  }
  .view-tabs button.active {
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 var(--ink);
  }
}

@media (max-width: 340px) {
  .view-tabs button {
    font-size: 0.61rem;
    padding-right: 1px;
    padding-left: 1px;
  }
}
