:root {
  color-scheme: light;
  --ink: #182f3e;
  --muted: #4c6472;
  --line: #d8e4ea;
  --blue: #204d65;
  --paper: #f2f7fa;
  font: 16px/1.5 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  scroll-behavior: smooth;
}
*, *::before, *::after { box-sizing: border-box; }
body, p, h1, h2, h3, figure { margin: 0; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid #b15e32; outline-offset: 3px; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.top { background: #fff; border-bottom: 1px solid var(--line); }
.nav { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 750; white-space: nowrap; }
.brand span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e0eef5; color: var(--blue); font-size: 1.25rem; }
.brand small { color: var(--muted); font-size: .8rem; font-weight: 600; }
nav { display: flex; gap: clamp(12px, 3vw, 35px); color: var(--muted); font-size: .94rem; font-weight: 600; }
nav a:hover { color: var(--blue); text-decoration: underline; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 46px; padding: 9px 17px; border: 1px solid var(--blue); border-radius: 9px; background: var(--blue); color: white; font-weight: 700; font-size: .94rem; }
.button:hover { background: #12364a; }
.button.outline { background: #ffffffbe; border-color: #a8bfcc; color: var(--blue); }
.button.outline:hover { background: #e8f1f6; }
.compact { min-height: 40px; padding: 7px 13px; }
.hero {
  position: relative;
  isolation: isolate;
  margin-top: 25px;
  min-height: 392px;
  display: grid;
  align-items: center;
  overflow: hidden;
  background-color: #d9eaf2;
  background-image: linear-gradient(90deg, #e1eff6 2%, #e1eff6ec 29%, #e1eff675 53%, transparent 70%), url("/winter.jpg");
  background-size: cover;
  background-position: center, center 51%;
  border: 1px solid #cddfe9;
  border-radius: 20px;
}
.hero-copy { padding: clamp(25px, 5.2vw, 60px); max-width: 620px; }
.eyebrow { display: flex; align-items: center; gap: 8px; color: var(--blue); font-size: .875rem; font-weight: 750; letter-spacing: .125em; text-transform: uppercase; }
h1, h2, figcaption { font-family: Georgia, "Times New Roman", serif; }
h1 { font-weight: 700; font-size: clamp(3rem, 6.7vw, 5.65rem); letter-spacing: -.065em; line-height: .94; margin: 16px 0; }
h1 em { font-weight: 400; color: #315e73; }
.hero-copy > p:last-of-type { max-width: 370px; color: #314e5f; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 23px; }
.dashboard { display: grid; grid-template-columns: minmax(0, 2.25fr) minmax(0, 1fr); gap: 18px; margin-top: 21px; }
.panel { min-width: 0; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 23px; }
.section-head, .dialog-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin-bottom: 15px; }
h2 { font-size: clamp(1.48rem, 2.45vw, 1.8rem); letter-spacing: -.035em; line-height: 1.12; }
.section-head p, .next p, .foot, .empty, #calendar-status { color: var(--muted); margin-top: 5px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; white-space: nowrap; }
thead { background: #edf4f8; color: #365a6d; }
th, td { padding: 8px clamp(7px, 1.2vw, 14px); text-align: center; }
thead th { font-size: .875rem; }
thead th:first-child { border-radius: 8px 0 0 8px; }
thead th:last-child { border-radius: 0 8px 8px 0; }
th:nth-child(2) { text-align: left; }
tbody tr + tr { border-top: 1px solid #e4edf2; }
.identity { display: flex; align-items: center; gap: 10px; }
.avatar { border-radius: 50%; object-fit: cover; }
.points { font-weight: 750; color: var(--blue); }
.next { background: #eaf3f8; display: flex; flex-direction: column; align-items: flex-start; gap: 11px; }
.calendar-icon { width: 41px; height: 41px; display: grid; place-items: center; border: 1px solid #c8dde8; border-radius: 10px; background: #f9fcfd; color: #315e73; font-size: 1.5rem; }
.next .button { margin-top: auto; }
.appointment { padding-block: 7px; }
.appointment + .appointment { border-top: 1px solid #c8dde8; }
.appointment small { color: var(--muted); font-size: .875rem; }
.crew { margin-block: 30px; }
.portraits { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
figure { min-width: 0; background: white; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
figure img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; background: var(--tint); }
figcaption { padding: 10px 13px; border-top: 3px solid var(--tint); font-size: 1.18rem; font-weight: 700; overflow-wrap: anywhere; }
.empty { padding: 13px 16px; border-radius: 8px; background: #f0f6fa; }
#history { display: grid; gap: 14px; }
.result { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #f8fbfd; }
.result h3 { font-size: 1.12rem; }
.game-places { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0; }
.game-place { display: grid; gap: 5px; padding: 9px 10px; background: white; border: 1px solid var(--line); border-radius: 9px; min-width: 0; }
.game-place.winner { border-color: #e4c893; background: #fff4df; }
.place-label, .score-help { color: var(--muted); font-size: .875rem; }
.winner .place-label { color: #795324; font-weight: 700; }
.game-player { display: flex; align-items: center; gap: 5px; overflow-wrap: anywhere; }
.game-player .avatar { width: 23px; height: 23px; flex: 0 0 auto; }
.game-player strong { font-size: .94rem; }
.game-points { font-size: 1.15rem; font-weight: 750; color: var(--blue); }
.game-details { border-top: 1px solid var(--line); }
.game-details summary { cursor: pointer; padding: 9px 0 2px; color: var(--blue); font-weight: 700; }
.game-details[open] summary { padding-bottom: 10px; }
.breakdown-table { background: white; }
.breakdown-table th:first-child { text-align: left; white-space: normal; }
.breakdown-table th:nth-child(2) { text-align: center; }
.breakdown-table tr:last-child { font-weight: 750; background: #edf4f8; }
.foot { display: flex; justify-content: space-between; gap: 10px; padding: 24px 0; font-size: .875rem; }
dialog { width: min(470px, calc(100% - 30px)); max-height: calc(100% - 30px); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 70px #142d4160; padding: 24px; color: var(--ink); }
dialog::backdrop { background: #152d40a9; }
#game { width: min(820px, calc(100% - 30px)); }
.score-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.player-score { display: grid; gap: 9px; min-width: 0; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--line); border-radius: 10px; background: #f8fbfd; }
.player-score > legend { padding-inline: 5px; color: var(--blue); font-size: 1.1rem; font-weight: 750; }
.score-line { grid-template-columns: minmax(0, 1fr) 66px; align-items: center; }
.player-score small { display: block; color: var(--muted); font-weight: 400; }
.player-score input { background: white; }
.round-score { min-width: 0; margin: 0; padding: 6px 0; border: 0; }
.round-score legend { padding: 0; font-size: .94rem; font-weight: 650; }
.round-inputs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.round-inputs label { font-size: .875rem; }
.score-footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 6px; font-weight: 700; color: var(--blue); }
.entry-total { font-size: 1.2rem; }
.dialog-head { align-items: center; margin: 0; }
.close { background: #eaf3f8; border: 0; border-radius: 8px; color: var(--blue); font-size: 1.4rem; width: 40px; height: 40px; }
form, label { display: grid; gap: 13px; }
label { gap: 4px; min-width: 0; font-size: .94rem; font-weight: 650; }
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.game-date { display: grid; gap: 4px; }
.date-control { display: flex; position: relative; gap: 6px; align-items: center; }
.date-control button { flex: 0 0 44px; height: 44px; }
.date-control input[type=date] { position: absolute; inset: 0 0 auto auto; width: 44px; opacity: 0; pointer-events: none; }
input { display: block; width: 100%; min-height: 44px; min-width: 0; border: 1px solid #a8bfcc; border-radius: 8px; padding: 7px 8px; color: var(--ink); background: #f8fbfd; }
.form-status { color: #922f22; }
.form-status:empty { display: none; }
#notice { position: fixed; inset: auto 20px 20px auto; max-width: min(400px, calc(100vw - 40px)); padding: 14px 17px; color: white; background: #183e53; border-radius: 10px; box-shadow: 0 5px 18px #183e5340; }
@media (max-width: 850px) {
  .dashboard { grid-template-columns: 1fr; }
  .hero { background-position: center, 57% center; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 26px); }
  .nav { flex-wrap: wrap; padding-block: 9px; gap: 8px; }
  nav { order: 1; width: 100%; padding: 4px 0; }
  .hero { margin-top: 13px; min-height: 360px; background-image: linear-gradient(90deg, #e1eff6f2, #e1eff6d9 49%, #e1eff640), url("/winter.jpg"); }
  .hero-copy { padding: 22px; }
  .panel { padding: 14px; }
  .portraits { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .game-places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .score-grid { grid-template-columns: 1fr; }
  .identity { gap: 5px; }
  .avatar { width: 24px; height: 24px; }
  th, td { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } }
