/* Legendary Playz - violet theme (SPEC 3.3). Phone first. */
:root {
  --bar-top: #611A8E;
  --bar-bottom: #430A75;
  --bottom-top: #5F198A;
  --bottom-bottom: #320661;
  --btn-top: #7E2BB4;
  --btn-bottom: #59148F;
  --ink: #3800AA;
  --heading: #2A0A5E;
  --muted: #6B4FA8;
  --col-head-bg: #F3EEFB;
  --divider: #E7DEF6;
  --glow: #B873F5;
  --line: #A96BDE;
  --outline: #490F79;
  --box-border: #3A12B8;
}

/* Poppins for text, Inter for the odds numbers, as in A_Violet_v13_Games.png. Both self-hosted. */
@font-face { font-family: "Poppins"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/Poppins-Regular.36408cc4fbb9.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/Poppins-Medium.e00010c2184f.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/Poppins-SemiBold.7c77dcebdf39.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/Poppins-Bold.8ea2f32b2457.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/Inter-500.eca29b33d494.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/Inter-600.faad225b4d15.woff2") format("woff2"); }

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #fff;
  color: var(--heading);
  padding-bottom: calc(42px + env(safe-area-inset-bottom));
  -webkit-text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }

/* Sizes follow SPEC 4 and assets/mockups/A_Violet_v13_Games.png (measured at 390 px wide). */

/* Header: lavender swirl banner, about 63 px high */
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 63px; padding: 0 12px 0 17px;
  background: #E4D0F6 url("../img/Banner_Background_Lavender_Swirl.8145451fa735.png") center / cover no-repeat;
}
.logo { height: 53px; width: auto; display: block; }
.header-buttons { display: flex; gap: 8px; flex-shrink: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 90px; height: 31px; border-radius: 999px;
  font-weight: 700; font-size: 12.7px; white-space: nowrap;
  box-shadow: 0 2px 4px rgba(42,10,94,.28);
}
.btn-secondary {
  background: linear-gradient(#fff, #EDE0FA); color: #2A0A5E;
  border: 1px solid #6E21A6;
}
.btn-main {
  background: linear-gradient(var(--btn-top), var(--btn-bottom)); color: #fff;
  border: 1px solid #59148F; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 2px 4px rgba(42,10,94,.28);
}

/* Top menu bar, about 35 px high. The selected item is 10% larger. */
.menu-bar {
  display: flex; height: 35px;
  background: linear-gradient(var(--bar-top), var(--bar-bottom));
  border-top: 1px solid rgba(255,255,255,.35);
}
.menu-bar a {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 500; font-size: 12.15px; white-space: nowrap; position: relative;
  border-left: 1px solid var(--line);
}
.menu-bar a:first-child { border-left: 0; }
.menu-bar a.current { font-weight: 600; font-size: 13.5px; }
/* The selected-item underline: used by the top menu and, identically, the bottom bar. */
.menu-bar a.current .label, .bottom-bar a.current .label {
  border-bottom: 2px solid var(--glow); padding-bottom: 2px;
}

/* Week bar, about 28 px high, tabs about 74 px wide. Arrow buttons show on wide screens only. */
.week-wrap { position: relative; display: flex; background: #F8F5FD; }
.week-wrap .week-banner { flex: 1; min-width: 0; }
.week-arrow { display: none; }
.week-banner {
  display: flex; overflow-x: auto; scrollbar-width: none; height: 28px;
  background: #F8F5FD; border-bottom: 1px solid var(--divider);
  scroll-snap-type: x proximity;
}
.week-banner::-webkit-scrollbar { display: none; }
.week-item {
  flex: 0 0 74px; text-decoration: none; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-weight: 500; font-size: 12px;
  border-right: 1px solid var(--divider); white-space: nowrap; scroll-snap-align: center;
}
.week-item.current {
  background: linear-gradient(var(--bar-top), var(--bar-bottom)); color: #fff;
  font-weight: 700; box-shadow: inset 0 -2px 0 var(--glow);
}

/* Heading row and column header row (24 px) */
.title-row { display: flex; justify-content: space-between; align-items: center; height: 31px; padding: 0 12px; }
h1 { margin: 0; font-size: 21px; font-weight: 700; color: var(--heading); }
.week-label { color: var(--muted); font-weight: 600; font-size: 13px; }
.col-head {
  display: grid; grid-template-columns: 1fr 70px 70px 70px; column-gap: 4px; align-items: center;
  height: 24px; padding: 0 8px 0 12px; background: var(--col-head-bg);
  border-top: 1px solid var(--divider); border-bottom: 1px solid var(--divider);
  font-size: 10px; font-weight: 500; color: var(--muted); text-align: center;
}
.col-head .col-nfl { text-align: left; color: var(--heading); font-weight: 700; font-size: 12px; }

/* One game: about 124 px high */
.game { padding: 12px 8px 11px 13px; border-bottom: 1px solid var(--divider); }
.game-grid { display: grid; grid-template-columns: 1fr auto; column-gap: 4px; align-items: center; }
.teams { min-width: 0; }
.team {
  display: flex; align-items: center; gap: 8px; height: 38px;
  font-weight: 600; font-size: 14.52px; color: var(--ink);
}
.team img { flex: 0 0 auto; }
.team span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.at { display: flex; align-items: center; gap: 3px; height: 5px; margin: 0 0 0 -1px; }
.at b {
  width: 13px; height: 13px; border-radius: 50%; background: var(--divider); color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 8px; flex: 0 0 auto;
}
.at::after { content: ""; flex: 1; height: 1px; background: #D5C8EC; margin-right: 12px; }
.odds { display: grid; row-gap: 5px; }
.odds-row { display: grid; grid-template-columns: 70px 70px 70px; column-gap: 4px; }
.obox {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 37px; border: 1.5px solid #4A1FC0; border-radius: 6px;
  background:
    radial-gradient(ellipse 28px 14px at 4px 3px, rgba(190,170,255,.4), transparent),
    linear-gradient(#fff, #F8F4FE);
  font-family: "Inter", system-ui, sans-serif; font-weight: 500; font-size: 11.12px; line-height: 1.25; color: #000;
}
.obox i { font-style: normal; }

/* Past weeks and finished games: FINAL column to the left of SPREAD (SPEC 6.1) */
.col-head.with-final { grid-template-columns: 1fr 40px 62px 62px 62px; }
.odds.with-final .odds-row { grid-template-columns: 40px 62px 62px 62px; }
/* Phones: slightly narrower boxes (and gaps) so long team names such as "TB Buccaneers" still fit */
@media (max-width: 480px) {
  .col-head.with-final { grid-template-columns: 1fr 38px 56px 56px 56px; column-gap: 3px; }
  .odds.with-final .odds-row { grid-template-columns: 38px 56px 56px 56px; column-gap: 3px; }
}
.obox.hit { background: #FFFBE0; }
.fbox { font-size: 15px; font-weight: 700; background: #fff; }
.fbox.win, .fbox.tie { color: #1747C9; }
.fbox.lose { color: #C42B2B; }
.fbox.pending { color: #B9AEDB; font-weight: 500; }
.obox i:first-child { color: var(--ink); font-weight: 600; }

.game-foot { display: flex; align-items: center; gap: 10px; margin-top: 8px; height: 20px; }
.playz-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 20px; transform: skewX(-8deg);
  border-radius: 6px; font-style: italic; font-weight: 800; font-size: 9.5px; letter-spacing: .03em; color: #fff;
  background: linear-gradient(#5E16AA, #470A90); border: 1.5px solid #8329E9;
  box-shadow: 0 0 0 1px #E9DDFB, inset 4px 2px 3px -2px rgba(255,255,255,.55);
}
.when { font-size: 10.5px; font-weight: 400; color: #3b3350; white-space: nowrap; }
.links { margin-left: auto; display: flex; gap: 14px; }
.link { color: var(--ink); font-weight: 500; font-size: 11.5px; display: inline-flex; align-items: center; gap: 3px; }
.link svg { width: 9px; height: 9px; }

.soon { padding: 0 12px; color: var(--muted); }
.empty-note { margin: 0; padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.inline-link { color: var(--ink); text-decoration: underline; }

/* Log in / Join pop-up (placeholder until accounts exist), SPEC 6.1 */
.lock-dialog {
  width: min(86vw, 340px); padding: 0; border: 2px solid var(--glow); border-radius: 10px;
  overflow: hidden; color: var(--heading); box-shadow: 0 8px 30px rgba(42,10,94,.4);
}
.lock-dialog::backdrop { background: rgba(26,6,56,.55); }
.lock-head {
  display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  background: linear-gradient(var(--bar-top), var(--bar-bottom)); color: #fff; font-weight: 600; font-size: 14px;
}
.lock-close { background: none; border: 0; color: #fff; font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px; }
.lock-body { padding: 14px 14px 16px; font-size: 13px; }
.lock-body p { margin: 0 0 14px; line-height: 1.45; }
.lock-buttons { display: flex; gap: 10px; justify-content: center; }

/* Bottom bar, about 42 px high, three equal buttons */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; display: flex; height: calc(42px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background:
    radial-gradient(circle at 0 0, rgba(123,34,212,.8), transparent 45%),
    radial-gradient(circle at 100% 0, rgba(123,34,212,.8), transparent 45%),
    linear-gradient(var(--bottom-top), var(--bottom-bottom));
  border-top: 1px solid rgba(255,255,255,.35);
}
.bottom-bar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: #fff; font-weight: 600; font-size: 10px; line-height: 12px; position: relative; padding: 2px 0 5px;
}
.bottom-bar a + a::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.bottom-bar svg { display: block; }
.bucks { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; line-height: 18px; }
.bucks img { display: block; }

/* Narrow phones (about 360 px): slightly narrower odds boxes so long team names still fit */
@media (max-width: 380px) {
  .col-head { grid-template-columns: 1fr 60px 60px 60px; }
  .odds-row { grid-template-columns: 60px 60px 60px; }
  .col-head.with-final { grid-template-columns: 1fr 34px 50px 50px 50px; }
  .odds.with-final .odds-row { grid-template-columns: 34px 50px 50px 50px; }
  .obox { font-size: 10.6px; }
  .obox.fbox { font-size: 14px; }
  .team { gap: 6px; }
}

/* Wider screens: center the content in a column */
@media (min-width: 760px) {
  .page { max-width: 900px; margin: 0 auto; }
  .site-header { padding: 0 max(12px, calc((100vw - 900px) / 2)); }
  .week-item { flex-basis: 110px; }
  .week-banner { cursor: grab; }
  .week-arrow {
    display: flex; align-items: center; justify-content: center; flex: 0 0 28px; border: 0; cursor: pointer;
    background: linear-gradient(var(--bar-top), var(--bar-bottom)); color: #fff; font-size: 20px; line-height: 1;
  }
  .col-head { padding-left: 24px; padding-right: 24px; grid-template-columns: 1fr 96px 96px 96px; }
  .game { padding-left: 24px; padding-right: 24px; }
  .odds-row { grid-template-columns: 96px 96px 96px; }
  .obox { height: 44px; font-size: 13px; }
}
