:root {
  --ink: #f8f5fa;
  --paper: #312d55;
  --deep: #272446;
  --purple: #5a2d87;
  --lilac: #cfbddb;
  --accent: #ad79c2;
  --line: color-mix(in srgb, var(--lilac) 45%, transparent);
  --background-logo: none;
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }

body {
  background: var(--deep);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.screen { width: 100vw; height: 100vh; overflow: hidden; }

.dashboard {
  background:
    radial-gradient(ellipse 45% 65% at 50% 112%, rgb(179 104 196 / 52%), transparent 68%),
    radial-gradient(ellipse 45% 52% at 92% 5%, rgb(90 45 135 / 72%), transparent 74%),
    linear-gradient(123deg, #242142 0%, #35305c 46%, #2a294f 100%);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: clamp(10px, 1.6vh, 24px);
  padding: clamp(9px, 2vw, 36px);
}

.dashboard-header {
  border-bottom: clamp(2px, .35vh, 5px) solid var(--lilac);
  padding-bottom: clamp(8px, 1.2vh, 16px);
}

.brand-header { align-items: center; display: flex; justify-content: space-between; gap: 32px; }
h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(36px, 6vw, 96px); line-height: .9; margin: 0; }

.header-side { align-items: center; display: flex; gap: clamp(14px, 2vw, 32px); }
#date-label { color: var(--lilac); font-size: clamp(16px, 2vw, 36px); font-weight: 700; line-height: 1; margin: .35em 0 0; }
.venue-label { color: var(--lilac); font-family: Georgia, "Times New Roman", serif; font-size: clamp(22px, 3.7vw, 60px); font-weight: 700; line-height: 1; margin: 0; text-align: right; }
.logo-frame { align-items: center; background: #fff; border: clamp(2px, .3vw, 5px) solid var(--lilac); border-radius: 50%; display: flex; flex: 0 0 auto; height: clamp(74px, 10vw, 156px); justify-content: center; overflow: hidden; width: clamp(74px, 10vw, 156px); }
.logo-frame img { display: block; height: 100%; object-fit: cover; width: 100%; }

.summary { border-bottom: 1px solid var(--line); min-height: 0; padding-bottom: clamp(8px, 1.2vh, 16px); text-align: center; }
.summary h2 { color: var(--lilac); font-family: Georgia, "Times New Roman", serif; font-size: var(--summary-size, clamp(19px, 2.2vw, 42px)); line-height: 1; margin: 0 0 .45em; }
.summary-games { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 1.5vw, 24px); }
.summary-game { align-items: center; background: rgb(83 70 122 / 76%); border: 1px solid rgb(248 245 250 / 10%); border-radius: 12px; display: grid; font-size: var(--summary-size, clamp(19px, 2.2vw, 42px)); font-weight: 700; gap: .75em; grid-template-columns: minmax(9rem, 1fr) auto minmax(9rem, 1fr); padding: clamp(8px, 1vh, 14px) clamp(12px, 1.5vw, 24px); }
.team { align-items: center; display: inline-flex; min-width: 0; }
.summary-game .team { display: grid; justify-items: center; text-align: center; }
.summary-logo { background: #fff; border-radius: 6px; height: clamp(46px, 5vw, 75px); margin-bottom: .25em; object-fit: contain; padding: 3px; width: clamp(46px, 5vw, 75px); }

.matches { min-height: 0; overflow: hidden; }
table { border-collapse: separate; border-spacing: 0 clamp(4px, .55vh, 8px); table-layout: fixed; width: 100%; }
th, td { font-size: var(--table-size, clamp(15px, 1.55vw, 30px)); font-weight: 700; overflow-wrap: anywhere; padding: var(--table-padding, clamp(7px, 1vh, 14px)) clamp(8px, 1.15vw, 20px); text-align: left; }
th { border-bottom: 2px solid var(--lilac); color: var(--lilac); font-family: Georgia, "Times New Roman", serif; font-size: calc(var(--table-size, 30px) * 1.05); }
th:nth-child(1) { width: 11%; }
th:nth-child(2), th:nth-child(3) { width: 35%; }
th:nth-child(4) { width: 19%; }
tbody tr { animation: reveal .38s ease-out both; animation-delay: calc(var(--row-index, 0) * 65ms); }
tbody td { background: rgb(83 70 122 / 76%); border-bottom: 1px solid rgb(207 189 219 / 20%); border-top: 1px solid rgb(248 245 250 / 7%); }
tbody td:first-child { border-bottom-left-radius: 10px; border-top-left-radius: 10px; }
tbody td:last-child { border-bottom-right-radius: 10px; border-top-right-radius: 10px; }
tbody tr.ongoing td { background: rgb(173 121 194 / 38%); }
tbody tr.ongoing td:first-child { box-shadow: inset 4px 0 var(--accent); }
.logo { background: #fff; border-radius: 4px; flex: 0 0 auto; height: clamp(28px, 2.5vw, 42px); margin-right: .45em; object-fit: contain; padding: 2px; vertical-align: middle; width: clamp(28px, 2.5vw, 42px); }
.empty { align-self: end; color: var(--lilac); font-size: var(--table-size, clamp(15px, 1.55vw, 30px)); margin: 0; text-align: center; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 850px), (orientation: portrait) {
  html, body, .screen { height: auto; min-height: 100%; overflow: auto; }
  .dashboard { height: auto; min-height: 100vh; }
  .brand-header { align-items: flex-start; flex-direction: column; }
  .header-side { justify-content: space-between; width: 100%; }
  .venue-label { text-align: left; }
  .matches { overflow: visible; }
  th:nth-child(4), td:nth-child(4) { display: none; }
  .summary-game { grid-template-columns: minmax(6rem, 1fr) auto minmax(6rem, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  tbody tr { animation: none; }
}
