* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --navy: #102a54;
  --ink: #11294b;
  --muted: #456181;
  --blue: #2263a8;
  --pale: #eaf4ff;
  --paper: #f6faff;
  --line: #afcbe3;
  --gold: #ffce42;
  --width: 520px;
  --nav-height: 76px;
  --dock-height: 69px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  font-weight: 600;
  color: var(--ink);
  background: #0a1830;
}
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 0, #285785, #0a1830 70%);
}
button, select { font: inherit; }
button { cursor: pointer; font-weight: 900; touch-action: manipulation; }
button:disabled { opacity: .52; cursor: default; }
button:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #076ad5; outline-offset: 2px; }
button:active:not(:disabled) { transform: translateY(1px); }
#app {
  width: 100%;
  max-width: var(--width);
  min-height: 100dvh;
  margin: auto;
  display: flex;
  flex-direction: column;
  background: #e3f1fc;
  box-shadow: 0 0 55px #061123a8;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
  padding: calc(10px + var(--safe-top)) 12px 11px;
  color: #fff;
  background: linear-gradient(110deg, #0d2449, #204d86);
  border-bottom: 2px solid #79bef1;
  text-shadow: 0 2px #081e40;
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.brand h1 { margin: 0; font-size: clamp(15px, 4.3vw, 21px); line-height: 1.2; letter-spacing: .02em; }
.brand small { color: #caeaff; font-weight: 800; }
.date { display: flex; align-items: center; gap: 5px; flex-shrink: 0; font-size: 10px; text-align: right; color: #c8e9ff; }
.date b { display: block; font-size: 13px; color: white; white-space: nowrap; }
.date .pixel-icon { width: 28px; height: 28px; }
.pixel-icon { width: 29px; height: 29px; display: inline-block; flex: none; vertical-align: middle; image-rendering: pixelated; }
.brand .pixel-icon { width: 36px; height: 36px; }
main {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px 12px calc(13px + var(--nav-height) + var(--safe-bottom));
  flex: 1;
}
main.has-dock { padding-bottom: calc(14px + var(--nav-height) + var(--safe-bottom) + var(--dock-height)); }
main.view-match { padding-bottom: calc(15px + var(--dock-height) + var(--safe-bottom)); }
main.view-home { padding: 0 0 calc(var(--nav-height) + var(--safe-bottom)); gap: 0; grid-template-rows: auto 1fr; }
h2, h3, p { margin: 0; }
h2 { font-size: 24px; line-height: 1.25; }
h3 { font-size: 16px; }
p, small { line-height: 1.5; }
small { color: var(--muted); font-size: 12px; }
.subtitle, .muted { color: var(--muted); }
.section-title { padding: 5px 3px 2px; }
.section-title p { font-size: 13px; margin-top: 5px; }
.kicker { font-size: 11px; font-weight: 900; color: #2365a9; letter-spacing: .06em; }
.metrics {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: 4px;
  background: #77b9e7;
  padding: 5px;
}
.metric {
  display: grid;
  justify-items: center;
  text-align: center;
  min-width: 0;
  padding: 5px 2px 6px;
  color: #fff;
  background: linear-gradient(#1a477c, #102950);
  border: 1px solid #abd9f6;
  border-radius: 8px;
  box-shadow: inset 0 1px #ffffff28;
}
.metric small { white-space: nowrap; color: #e1f2ff; font-size: clamp(9px, 2.8vw, 12px); }
.metric strong { display: flex; align-items: center; gap: 3px; min-height: 24px; font-size: clamp(14px, 4vw, 20px); white-space: nowrap; font-variant-numeric: tabular-nums; }
.metric .pixel-icon { width: 19px; height: 19px; }
.metric:first-child strong { color: #b3f4a4; }
.metric:last-child strong { color: #ffd86b; }
.home-stage {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: clamp(415px, 67dvh, 680px);
  padding: 10px;
  overflow: clip;
  background: #74ac53;
}
.campus-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 62%; z-index: -2; }
.home-stage.rain .campus-image { filter: brightness(.85) saturate(.77) hue-rotate(8deg); }
.home-stage::after { content: ""; position: absolute; z-index: -1; inset: 63% 0 0; background: linear-gradient(transparent,#244324ad); pointer-events: none; }
.home-top { display: flex; align-items: start; justify-content: space-between; gap: 8px; }
.fixture {
  width: max-content;
  max-width: 64%;
  overflow: hidden;
  color: var(--ink);
  background: #e9f6ff;
  border: 2px solid #153260;
  border-radius: 10px;
  box-shadow: 0 2px 3px #0a214798, inset 0 0 0 1px #fff;
}
.fixture .kicker { display: flex; gap: 5px; align-items: center; padding: 4px 8px; background: linear-gradient(#2875bb,#184478); color: white; letter-spacing: 0; }
.fixture .pixel-icon { width: 20px; height: 20px; }
.fixture-info { display: grid; gap: 1px; padding: 5px 8px 6px; }
.fixture-info strong { font-size: 16px; }
.fixture-info small { line-height: 1.3; font-size: 10px; }
.home-links { display: grid; gap: 6px; }
.home-links button { min-height: 44px; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 5px 8px; font-size: 12px; }
.home-links .pixel-icon { width: 22px; height: 22px; }
.home-bottom { display: grid; gap: 8px; scroll-margin-bottom: calc(var(--nav-height) + var(--safe-bottom) + 8px); }
.home-notice {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr);
  align-items: center;
  gap: 9px;
  background: #f7fbff;
  padding: 9px 10px;
  border: 2px solid #254f7c;
  box-shadow: 0 2px 0 #102d51, inset 0 0 0 1px #fff;
  border-radius: 10px;
}
.home-notice .portrait { width: 46px; height: 46px; }
.home-notice p { margin-top: 3px; font-size: 13px; font-weight: 800; line-height: 1.45; }
.home-notice .kicker { display: inline-block; padding: 2px 8px; border-radius: 4px; color: white; background: #2469ad; }
.home-actions { display: flex; gap: 7px; }
.home-actions .primary { flex: 1; }
.home-actions .quiet { flex: none; }
.home-status { padding: 7px 12px; font-size: 12px; margin: 0; background: #f9dc98; }
.card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 13px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 2px 0 #abc8e02e;
}
.primary, .secondary, .quiet {
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid #a6641b;
  border-radius: 8px;
  color: #49280d;
  background: linear-gradient(#fff08a 0, var(--gold) 65%, #f9b930 100%);
  box-shadow: inset 0 0 0 1px #fff5a9, 0 2px 0 #9f661a;
  font-size: 14px;
}
.home-actions .primary { min-height: 52px; font-size: 16px; }
.secondary { color: #fff; background: linear-gradient(#317cc2,#174a85); border-color: #123e70; box-shadow: inset 0 1px #8fc2e6, 0 2px #123a66; }
.quiet { color: var(--ink); background: linear-gradient(#fff9e9,#f7e3b6); border-color: #a98c58; box-shadow: inset 0 1px #fff, 0 2px #8e744a; }
.tag { border-radius: 5px; padding: 4px 7px; background: #dbeaff; color: #173f70; font-size: 11px; font-weight: 850; white-space: nowrap; }
.two { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
nav, .dock {
  position: fixed;
  z-index: 5;
  inset-inline: 0;
  margin-inline: auto;
  width: min(100%,var(--width));
}
nav {
  bottom: 0;
  min-height: calc(var(--nav-height) + var(--safe-bottom));
  display: grid;
  grid-template-columns: repeat(5,minmax(0,1fr));
  align-items: stretch;
  padding: 6px 5px calc(6px + var(--safe-bottom));
  gap: 4px;
  background: #0e284d;
  border-top: 2px solid #a1d5f6;
}
nav button {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1px;
  min-width: 0;
  min-height: 59px;
  border-radius: 8px;
  border: 1px solid #79b5e8;
  color: #fff;
  background: linear-gradient(#3d83bd,#1b4278);
  box-shadow: inset 0 0 0 1px #ffffff35, 0 2px #070f25;
  text-shadow: 0 1px #071d42;
  font-size: 12px;
  line-height: 15px;
}
nav button[aria-current=page] {
  color: #132647;
  border-color: #fff3a2;
  background: linear-gradient(#fff28b,#ffd242 75%,#f2b32e);
  box-shadow: inset 0 0 0 1px #fffaad, 0 2px #976021;
  text-shadow: 0 1px #fff7b6;
}
.dock {
  bottom: calc(var(--nav-height) + var(--safe-bottom));
  display: grid;
  gap: 7px;
  padding: 8px 12px 10px;
  background: var(--pale);
  border-top: 1px solid #7eaad2;
}
.dock .primary { width: 100%; }
.match-dock { bottom: 0; padding-bottom: calc(10px + var(--safe-bottom)); }
.match-dock .two { align-items: end; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); }
.view-match { --dock-height: 94px; }
select {
  display: block;
  width: 100%;
  height: 47px;
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid #88afd2;
  border-radius: 7px;
  background: white;
  color: var(--ink);
  font-size: 16px;
  text-overflow: ellipsis;
}
label { display: grid; gap: 4px; min-width: 0; font-size: 12px; font-weight: 850; }
summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  list-style: none;
  cursor: pointer;
  font-weight: 850;
  line-height: 1.4;
  touch-action: manipulation;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: ""; margin-left: auto; border: solid #32699c; border-width: 0 2px 2px 0; width: 7px; height: 7px; flex: none; transform: rotate(45deg); margin-right: 3px; }
details[open] > summary::after { transform: rotate(225deg); }
details.card { padding-block: 5px; }
details.card[open] { padding-bottom: 12px; }
details[open] > summary { margin-bottom: 8px; }
.roster label { grid-template-columns: 59px minmax(0,1fr); align-items: center; margin-bottom: 5px; }
.roster .num { font-variant-numeric: tabular-nums; color: #2365a9; }
.players { display: grid; gap: 6px; }
.person { padding-inline: 9px; }
.person summary { min-height: 62px; }
.person-name { display: grid; gap: 1px; min-width: 0; font-size: 16px; }
.person .tag { margin-left: auto; }
.person summary::after { margin-left: 0; }
.portrait { display: block; width: 52px; height: 52px; flex: none; object-fit: contain; image-rendering: pixelated; border-radius: 7px; background: radial-gradient(ellipse at 50% 82%, #b4d6a4, #edf6fc 63%); }
.skills { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 5px; margin-top: 7px; font-size: 12px; }
.skills span { border-top: 1px solid var(--line); padding: 4px 0; }
.growth-list { display: grid; gap: 5px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; }
.zone { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; padding: 9px 0; border-top: 1px solid #cbddee; }
.zone h3 { grid-column: 1 / -1; font-size: 14px; }
.scoreboard {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  gap: 6px;
  padding: 10px;
  border: 1px solid #6599c9;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(#265a96,#122b55);
  text-align: center;
  box-shadow: inset 0 1px #88adda;
}
.scoreboard div { display: grid; gap: 3px; font-size: 12px; font-weight: 850; }
.scoreboard b { font-size: 35px; line-height: 1; color: #ffdf74; font-variant-numeric: tabular-nums; }
.scoreboard small { color: white; background: #0a2349; border-radius: 5px; padding: 4px 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.match-layout { display: grid; grid-template-columns: minmax(62px,.29fr) minmax(0,1fr); gap: 9px; }
.pitch {
  position: relative;
  min-height: 186px;
  background: repeating-linear-gradient(0deg,#579747 0 10%,#6da751 10% 20%);
  border: 3px solid #eff8d5;
  outline: 1px solid #519845;
  border-radius: 4px;
}
.pitch i { position: absolute; inset-inline: 0; border-top: 1px solid #eef1ca; }
.pitch span { position: absolute; left: 50%; transform: translate(-50%,50%) rotate(-25deg); background: #fff4cf; border: 2px solid #835231; border-radius: 50%; height: 13px; width: 18px; transition: bottom .18s linear; }
.log { height: 186px; overflow: auto; display: flex; flex-direction: column; gap: 5px; padding: 7px; background: #eff7ff; border-radius: 5px; border: 1px solid var(--line); font-size: 12px; overscroll-behavior: contain; }
.log p { border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.log .major { font-weight: 900; color: #164e87; }
.log time { color: #4e6074; margin-right: 5px; font-variant-numeric: tabular-nums; }
.pause { padding: 8px; background: #fff0bf; border-radius: 5px; font-size: 13px; font-weight: 800; }
.stat { display: grid; grid-template-columns: 49px 1fr 49px; gap: 6px; text-align: center; font-size: 13px; padding: 5px 0; border-bottom: 1px solid var(--line); }
@media (max-width: 350px) {
  header { padding-inline: 8px; }
  .brand .pixel-icon { width: 29px; height: 29px; }
  .date b { font-size: 12px; }
  .date .pixel-icon { width: 23px; height: 23px; }
  nav button { font-size: 11px; }
  .home-links button { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none!important; } }
@media (max-height: 740px) {
  .campus-image { object-position: center bottom; }
}
@media (min-height: 741px) {
  .campus-image { object-position: center 86%; }
}
.portrait.tall { background-position: center 3px; }
