:root {
  color-scheme: light;
  --ink: #14241c;
  --muted: #5d6b63;
  --line: #e6e0d4;
  --canvas: #f3f0e6;
  --forest: #0b3d2a;
  --gold: #d39e46;
  --green: var(--forest);
  --green-dark: #07281c;
  --card: #ffffff;
  font-family: "Titillium Web", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--canvas);
}

a { color: inherit; }

.logo {
  display: flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  padding: 0;
  background: transparent;
  text-decoration: none;
}

.logo img {
  height: 58px;
  width: auto;
  max-width: 100%;
  display: block;
}

.topbar {
  display: flex;
  align-items: center;
  gap: .75rem;
  min-width: 0;
  padding: .7rem 1.5rem;
  background: #022716;
}

.today {
  margin: 0 0 0 auto;
  color: #f3f0e6;
  text-transform: capitalize;
  white-space: nowrap;
}

.session {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  min-width: 0;
  margin-left: auto;
  flex: 1 1 auto;
  color: #f3f0e6;
}

.session form { margin: 0; flex: none; }

.me {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.avatar {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
}

.avatar.initial {
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--forest);
  font-weight: 700;
}

.who {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.level {
  flex: none;
  padding: .15rem .45rem;
  border-radius: 999px;
  background: var(--gold);
  color: var(--forest);
  font-size: .78rem;
  font-weight: 700;
  white-space: nowrap;
}

.session button, .session a.enter {
  flex: none;
  font: inherit;
  font-weight: 700;
  border: 1px solid rgba(243, 240, 230, .35);
  background: transparent;
  color: #f3f0e6;
  border-radius: 999px;
  padding: .35rem .8rem;
  text-decoration: none;
  cursor: pointer;
}

.auth {
  max-width: 440px;
  margin: 1.2rem auto;
  padding: 1.4rem 1.3rem 1.5rem;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .05);
}

.auth h1 {
  margin: 0;
  font-style: italic;
  color: var(--forest);
}

.auth > p { margin: .4rem 0 1rem; color: var(--muted); }

.auth form { display: flex; flex-direction: column; gap: .35rem; }

.auth label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  margin-top: .45rem;
  font-weight: 700;
  color: var(--forest);
}

.auth .input-validation-error { border-color: #8a2a2a; }

.auth input, .auth select {
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  padding: .7rem .8rem;
  border-radius: 12px;
  border: 1px solid #e4ddd0;
  background: #faf8f3;
}

.auth .check {
  flex-direction: row;
  align-items: center;
  gap: .5rem;
  font-weight: 600;
}

.auth .check input { width: auto; }

.auth .hint { color: var(--muted); font-size: .82rem; }

.auth .error { margin: 0; color: #8a2a2a; font-size: .86rem; font-weight: 600; }

.auth .ok { margin: 0 0 .4rem; color: var(--forest); font-weight: 700; }

.auth .error:empty { display: none; }

.auth button[type="submit"] {
  margin-top: .7rem;
  font: inherit;
  font-weight: 700;
  border: 0;
  border-radius: 10px;
  background: var(--forest);
  color: white;
  padding: .75rem .8rem;
  cursor: pointer;
}

.auth button.secondary {
  width: 100%;
  margin-top: .5rem;
  font: inherit;
  font-weight: 700;
  border: 1px solid #e4ddd0;
  border-radius: 10px;
  background: transparent;
  color: #8a2a2a;
  padding: .65rem .8rem;
  cursor: pointer;
}

.profile { display: flex; align-items: center; gap: .9rem; margin: 1rem 0; }
.profile > div { min-width: 0; }
.profile .hint { margin: .15rem 0 0; overflow-wrap: anywhere; }

.profile-photo {
  flex: none;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--gold);
}

.profile-photo.initial {
  display: grid;
  place-items: center;
  background: var(--gold);
  color: var(--forest);
  font-size: 2.2rem;
  font-weight: 700;
}

.profile-name { margin: 0; font-size: 1.15rem; font-weight: 700; color: var(--forest); overflow-wrap: anywhere; }

.auth .switch { margin: 1rem 0 0; }
.auth .switch a { color: var(--forest); font-weight: 700; }

main { padding: 1.4rem 1.5rem 2.5rem; }

.hero {
  margin-bottom: 1.1rem;
}

.hero.compact { grid-template-columns: 1fr; }

.hero h1 {
  margin: 0;
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  line-height: 1.05;
  font-style: italic;
  font-weight: 700;
  color: var(--forest);
}

.hero h1 span { color: var(--gold); }

.hero p { margin: .45rem 0 0; color: var(--muted); }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.chips { display: flex; flex-wrap: wrap; gap: .55rem; margin: .9rem 0 1rem; }

.chips a, .pick select, .go {
  font: inherit;
}

.chips a {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .95rem;
  border-radius: 999px;
  background: white;
  border: 1px solid #e4ddd0;
  text-decoration: none;
  color: var(--ink);
}

.chips a svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.pick svg {
  width: 30px;
  height: 30px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.chips a.on {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--forest);
  font-weight: 700;
}

.picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .6rem;
}

.pick {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-width: 0;
  padding: .55rem .7rem;
  border-radius: 16px;
  background: white;
  border: 1px solid #e4ddd0;
  color: var(--forest);
}

.pick span { display: flex; flex-direction: column; min-width: 0; }
.pick small {
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.pick select {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-transform: capitalize;
  outline: none;
}

.board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  column-gap: 1rem;
  row-gap: .9rem;
  align-items: start;
}

.home-intro { grid-column: 1; grid-row: 1; }
.home-videos { grid-column: 1; grid-row: 2; }
.rail { grid-column: 2; grid-row: 1 / span 2; }

.match-grid, .court-grid {
  display: grid;
  gap: .9rem;
}

.match-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.court-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.match, .court-tile, .panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(16, 24, 40, .05);
}

.match {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  text-decoration: none;
  padding: .45rem .45rem .15rem;
}

.thumb {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(160deg, #0b3d2a, #08281c);
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 8px 18px rgba(0, 0, 0, .25);
}

.play::after {
  content: "";
  position: absolute;
  left: 20px;
  top: 16px;
  border-style: solid;
  border-width: 10px 0 10px 16px;
  border-color: transparent transparent transparent var(--gold);
}

.badge {
  position: absolute;
  right: .6rem;
  bottom: .6rem;
  padding: .15rem .45rem;
  border-radius: 8px;
  background: rgba(10, 14, 22, .75);
  color: white;
  font-size: .78rem;
}

.match-body, .court-tile { padding: .85rem .9rem 1rem; }

.match-body { display: flex; flex-direction: column; gap: .25rem; }
.match-body strong, .court-tile span { font-size: 1.05rem; }
.when, .court-tile small, .recent small { color: var(--muted); font-size: .86rem; }

.go {
  display: block;
  margin-top: .7rem;
  padding: .65rem .8rem;
  border-radius: 10px;
  background: var(--green);
  color: white;
  font-weight: 700;
  text-align: center;
}

.match:hover .go { background: var(--green-dark); }

.court-tile {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-height: 140px;
  padding: 1.1rem;
  text-decoration: none;
}

.court-tile strong { color: var(--green); }

.rail { display: flex; flex-direction: column; gap: .9rem; }
.panel { padding: 1rem; }
.panel h2, .day h2, .watch h1 {
  margin: 0 0 .8rem;
  font-style: italic;
}

.panel h2 { color: var(--forest); }
.day h2, .watch h1 { color: var(--forest); }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.stats div {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  padding: .7rem .4rem;
  border-radius: 12px;
  background: #f3efe4;
  text-align: center;
}

.stats strong { font-size: 1.35rem; color: var(--forest); }
.stats span, .meta, .info dt { color: var(--muted); font-size: .82rem; }

.recent { display: flex; flex-direction: column; gap: .65rem; }
.recent a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: .6rem;
  align-items: center;
  text-decoration: none;
}

.mini {
  display: block;
  height: 48px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--forest);
}

.mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent strong, .recent small { display: block; }

.day { margin-top: 1.4rem; }
.day:first-child { margin-top: 0; }
.day h2 { text-transform: capitalize; font-size: 1.15rem; }

.back { margin: 0 0 .9rem; }
.back a { color: var(--forest); text-decoration: none; font-weight: 700; }
.back a.back-btn { color: white; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  background: var(--forest);
  color: white;
  font-weight: 700;
  text-decoration: none;
}
.back-btn::before { content: "←"; }

.watch {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}

.meta { display: flex; flex-wrap: wrap; gap: .8rem; margin: .35rem 0 .8rem; }

.player {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
}

.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.info dl { margin: 0; display: flex; flex-direction: column; gap: .8rem; }
.info div { display: flex; flex-direction: column; gap: .15rem; }
.info dd { margin: 0; font-weight: 700; }

.empty {
  padding: 1rem;
  border-radius: 14px;
  background: white;
  color: var(--muted);
}

@media (max-width: 1100px) {
  .board, .watch { grid-template-columns: 1fr; }
  .home-intro, .home-videos, .rail { grid-column: auto; grid-row: auto; }
  .rail { display: contents; }
  .home-intro { order: 1; }
  .picks { order: 2; }
  .home-videos { order: 3; }
  .panel { order: 4; }
}

@media (max-width: 640px) {
  .picks { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .today { display: none; }
  .topbar, main { padding-left: .75rem; padding-right: .75rem; }
  .topbar { gap: .5rem; }
  .logo { flex: 0 0 auto; }
  .logo img { height: 42px; }
  .session { gap: .35rem; }
  .avatar { width: 28px; height: 28px; }
  .me { gap: .35rem; }
  .session button, .session a.enter { padding: .28rem .55rem; }
  .stats { grid-template-columns: 1fr; }
}
