:root{
  --bg:#fff;
  --text: rgba(0,0,0,.92);
  --muted: rgba(0,0,0,.62);
  --hairline: rgba(0,0,0,.12);
  --brand: #7b61ff;

  --blue1:#4f86f7; --blue2:#3f78f2;
  --purple1:#6e64ff; --purple2:#6a5cff;
  --pink1:#a65bff; --pink2:#9b53ff;

  --shadow-sm: 0 1px 0 rgba(0,0,0,.03);
  --shadow-lg: 0 10px 22px rgba(0,0,0,.08);
}

*{ box-sizing:border-box; }
html,body{ height:100%; touch-action: manipulation; }
body{
  margin:0;
  background:var(--bg);
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "SF Pro Text","SF Pro Display", Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,input{ font:inherit; }
button{ border:0; background:none; color:inherit; }

.hidden{ display:none !important; }
/* ---------- Screen transitions ---------- */
.screen{
  opacity: 1;
  transform: translateY(0);
  transition: opacity 180ms ease, transform 180ms ease;
  will-change: opacity, transform;
}

.screen.is-entering{
  opacity: 0;
  transform: translateY(8px);
}

.screen.is-exiting{
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce){
  .screen{ transition: none; }
}


/* Prevent iOS double-tap zoom weirdness on tappables */
button, .pointBtn, .actionBtn, .pillBtn, .navBtn, .primaryBtn { touch-action: manipulation; }

/* ---------- Shared screen container ---------- */
.screen{
  max-width: 520px;
  margin: 0 auto;
  padding:
    calc(10px + env(safe-area-inset-top))
    14px
    calc(12px + env(safe-area-inset-bottom))
    14px;
  min-height: 100dvh;
}

/* Screens must be flex columns so grid can fill and buttons can scroll */
.screen[data-screen="setup"],
.screen[data-screen="game"]{
  display:flex;
  flex-direction:column;
  min-height: 100dvh;
  overflow: hidden;
}

/* ---------- Top bar ---------- */
.topbar{
  display:grid;
  grid-template-columns: 1fr auto 1fr;
  align-items:center;
  gap:10px;
  padding: 6px 0 12px;
}

.topTitle{
  text-align:center;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: .02em;
  color: var(--brand);
  line-height: 1;
}

.topSpacer{
  width: 1px;
}

.pillBtn{
  display:inline-flex;
  align-items:center;
  gap:10px;
  padding: 10px 14px;
  border-radius: 18px;
  border: 1px solid var(--hairline);
  background:#fff;
  box-shadow: var(--shadow-sm);
  width: fit-content;
}

.topbar .pillBtn{ justify-self:start; }
.topbar .pillBtn:last-child{ justify-self:end; }

.pillIcon{ font-size: 16px; line-height: 1; }
.pillText{ font-size: 18px; font-weight: 700; line-height: 1; }

/* ---------- Setup screen ---------- */
.screen[data-screen="setup"] .topbar{
  padding: 10px 0 10px;
}
.screen[data-screen="setup"] .topTitle{
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
}

.navBtn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background:#fff;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

.topSpacer{ height: 1px; }

.screen[data-screen="setup"] .content{
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display:flex;
  flex-direction:column;
  gap: 22px;
  padding: 6px 2px 18px;
}

.section{
  display:flex;
  flex-direction:column;
  gap: 12px;
}

.label{
  margin: 0 2px 6px;
  font-size: 17px;
  font-weight: 650;
  color: rgba(0,0,0,.86);
}

.field{
  display:flex;
  flex-direction:column;
  gap: 8px;
}

.inputShell{
  background: #f7f8fa;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 14px;
  height: 56px;
  display:flex;
  align-items:center;
  padding: 0 16px;
}

.input{
  width:100%;
  border:none;
  outline:none;
  background: transparent;
  font-size: 17px;
  font-weight: 600;
  text-align:center;
  color: var(--text);
}

.radioStack{
  display:flex;
  flex-direction:column;
  gap:12px;
}

.radioBox{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background:#fff;
  box-shadow: var(--shadow-sm);
}

.radioBox input{ transform: scale(1.1); }
.radioBox span{ font-size: 16px; font-weight: 650; color: rgba(0,0,0,.86); }

.primaryBtn{
  margin-top: 10px;
  width: 100%;
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  color:#fff;
  font-weight: 850;
  font-size: 17px;
  box-shadow: 0 12px 26px rgba(123,97,255,.24);
}

/* ---------- Actions row (Undo / Swap / Reset / Copy) ---------- */
.actions{
  display:grid;
  grid-template-columns: 1.15fr 1fr 1fr 1fr;
  gap: 10px;
  padding: 8px 0 12px;
}

.actionBtn{
  height: 56px;
  border-radius: 16px;
  border: 1px solid var(--hairline);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 18px;
  color: rgba(0,0,0,.78);
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
}

.actionBtnPrimary{
  background: var(--brand);
  color:#fff;
  border-color: transparent;
}

.actionIcon{ font-size:18px; line-height:1; opacity:.95; }

/* =========================================================
   GAME GRID (FIXED)
   Your HTML places .divider FIRST inside .gameGrid.
   We explicitly assign grid columns so it never breaks layout.
   ========================================================= */
.gameGrid{
  display:grid;
  grid-template-columns: minmax(0, 1fr) 1px minmax(0, 1fr);
  gap:0;
  padding: 10px 0 0;
  flex: 1;
  min-height: 0;
  width: 100%;
}

/* divider must be the MIDDLE column */
.divider{
  grid-column: 2;
  grid-row: 1 / -1;
  width: 1px;
  background: rgba(0,0,0,.12);
  pointer-events:none;
}

/* team columns must be left/right columns regardless of DOM order */
.teamCol[data-team="A"]{ grid-column: 1; }
.teamCol[data-team="B"]{ grid-column: 3; }

/* your HTML uses .teamCol */
.teamCol{
  padding: 0 10px;
  display:flex;
  flex-direction:column;
  min-height: 0;
  min-width: 0;   /* critical for grid shrink on mobile */
  width: 100%;
}

/* ---------- Team name ---------- */
.teamHeader{
  display:flex;
  justify-content:center;
  padding: 0 0 8px;
  min-width: 0;
}

.teamName{
  width: 100%;
  text-align:center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.10);
  background: #fff;
  box-shadow: var(--shadow-sm);
  font-weight: 850;
  font-size: 22px;
  margin: 4px 0 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Score ---------- */
.scoreArea{
  display:flex;
  justify-content:center;
  min-width: 0;
}

.scoreWrap{
  position: relative;
  display: inline-block;
  line-height: 1;
  padding: 2px 0 10px;
}

/* your HTML uses .scoreNum */
.scoreNum{
  font-size: clamp(52px, 9vw, 68px);
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: rgba(0,0,0,.92);
  display:inline-block;
}

/* ball pinned like an apostrophe (20px) */
.scoreBall{
  position:absolute;
  left: 100%;
  top: 0.12em;
  margin-left: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.55), transparent 45%),
    radial-gradient(circle at 70% 80%, rgba(0,0,0,.16), transparent 60%),
    #d4f83a;
  outline: 2px solid rgba(0,0,0,.06);
  box-shadow: 0 10px 25px rgba(0,0,0,.10);
}

/* ---------- Pressure pill row (reserved space, no layout jump) ---------- */
.pillRow{
  height: 32px;
  display:flex;
  justify-content:center;
  align-items:center;
  margin: 0 0 10px;
}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 26px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(0,0,0,.10);
  background:#fff;
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 800;
  color: rgba(0,0,0,.70);
}
.pill.hidden{
  display:inline-flex !important;
  opacity: 0;
  pointer-events:none;
}

/* ---------- Big scoring buttons ---------- */
.points.scoring-buttons{
  display:grid;
  grid-template-columns: 1fr;
  gap: clamp(10px, 1.4vh, 16px);
  padding-bottom: 10px;

  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
}

.pointBtn{
  min-height: clamp(60px, 12vh, 65px);
  border-radius: 18px;
  color:#fff;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 8px;
  padding: 12px 12px;
  box-shadow: var(--shadow-lg);
}

.pointBtn .big{
  font-size: 40px;
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1;
}

.pointBtn .small{
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: .88;
  line-height: 1;
}

.pointBtn:active{ transform: scale(.995); }
.pointBtn:disabled,
.pointBtn.disabled{ opacity: .55; box-shadow:none; }

/* Match your HTML color classes */
.pointBtn.blue{ background: linear-gradient(135deg, var(--blue1), var(--blue2)); }
.pointBtn.purple1{ background: linear-gradient(135deg, var(--purple1), var(--purple2)); }
.pointBtn.purple2{ background: linear-gradient(135deg, var(--purple1), var(--purple2)); }
.pointBtn.purple3{ background: linear-gradient(135deg, var(--pink1), var(--pink2)); }

/* ---------- Toast ---------- */
.toast{
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(20,20,22,.92);
  color:#fff;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 12px 30px rgba(0,0,0,.20);
  z-index: 80;
}

/* ---------- Win overlay ---------- */
.winOverlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 18px;
  z-index: 90;
}

.winCard{
  width: min(86vw, 360px);
  background: #fff;
  border-radius: 18px;
  padding: 20px;
  text-align:center;
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
}

.confetti{ font-size: 22px; margin-bottom: 8px; }
.winText{ font-size: 24px; font-weight: 900; margin-bottom: 10px; }
.winScore{ font-size: 16px; font-weight: 800; color: rgba(0,0,0,.55); margin-bottom: 14px; }

.winCta{
  width: 100%;
  height: 56px;
  border-radius: 16px;
  background: var(--brand);
  color:#fff;
  font-weight: 850;
  font-size: 18px;
}

/* ---------- Responsive tweaks ---------- */
@media (max-width: 430px){
  .screen{ padding-left: 12px; padding-right: 12px; }
  .topTitle{ font-size: 24px; }
  .pillText{ font-size: 16px; }
  .actionBtn{ font-size: 17px; }
}

@media (max-height: 740px){
  .pointBtn{ min-height: clamp(60px, 10.5vh, 65px); }
  .points.scoring-buttons{ gap: clamp(8px, 1.1vh, 14px); }
  .teamName{ font-size: 20px; }
}

/* ---------- Landing Screen ---------- */
.landingWrap{
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 36px;
  padding: 24px;
}

.landingLogo{
  width: 340px;
  max-width: 90%;
  height: auto;
  display: block;         /* removes baseline gap under image */
  margin: 0 auto;         /* keeps it centered */
}

.playBtn{
  width: 180px;
  height: 180px;
  padding: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 34px;
  font-weight: 900;
  letter-spacing: .08em;

  border-radius: 50%;
  border: none;
  color: #fff;
  cursor: pointer;

  background: linear-gradient(
    135deg,
    var(--purple1),
    var(--purple2)
  );

  box-shadow: 0 20px 40px rgba(123,97,255,.35);
}

.playBtn:active{
  transform: scale(.96);
}

/* ---------- Score pop ( +1 / +5 / +10 / +20 ) ---------- */
.scorePopHost{ position: relative; }

.scorePop{
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -20%);
  opacity: 0;
  pointer-events: none;
  user-select: none;
  font-weight: 850;
  white-space: nowrap;
  color: var(--brand);
  text-shadow: 0 2px 8px rgba(123,97,255,.35);
  animation: scorePop 650ms ease-out forwards;
}

@keyframes scorePop{
  0%   { opacity: 0; transform: translate(-50%, -10%) scale(.98); }
  15%  { opacity: 1; transform: translate(-50%, -20%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -70%) scale(1.02); }
}

/* ---------- Disable bottom tap toast (+5 bubble) ---------- */
.tapToast,
.scoreToast,
.toast,
.pointToast,
.bottomToast {
  display: none !important;
}

.landingBrand{
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;                /* ← THIS fixes the left offset */
}

.tagline{
  margin-top: 2px;     /* was 10–12px */
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #2F3A45;
  text-align: center;
}


