@font-face { font-family: Anton; src: url(../assets/fonts/Anton-Regular.ttf) format('truetype'); font-display: block; }
@font-face { font-family: Archivo; src: url(../assets/fonts/Archivo.ttf) format('truetype'); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
:root { --lime: #DBFF2E; --navy: #071A44; --ink: #040F2B; --blue: #1F4BFF; --electric: #2E7BFF; --frost: #F2F8FF; --ice: #BFE9FF; --pink: #FF2E7E; --r: 22px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--navy); color: var(--navy); font-family: Archivo, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; }
.screen { display: none; min-height: 100dvh; }
.screen.on { display: block; animation: in .35s cubic-bezier(.2,.9,.2,1); }
@keyframes in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.wrap { max-width: 560px; margin: 0 auto; padding: 8px 18px 40px; }
.mega { font-family: Anton, Impact, sans-serif; font-weight: 400; line-height: .9; letter-spacing: .005em; margin: 0; font-size: clamp(56px, 17vw, 112px); text-transform: uppercase; }
.mega.md { font-size: clamp(52px, 15vw, 92px); margin: 10px 0 18px; }
.lime { color: var(--lime); } .blue { color: var(--blue); }
.kicker { font-weight: 800; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.dim { opacity: .65; }
.card { background: #fff; border-radius: var(--r); padding: 20px; box-shadow: 0 18px 50px rgba(4,15,43,.18); }
.card.dark { background: var(--navy); color: #fff; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 999px; padding: 14px 22px; font-weight: 900; letter-spacing: .06em; background: var(--navy); color: #fff; transition: transform .12s, box-shadow .12s; }
.btn:active { transform: translateY(2px) scale(.98); }
.btn.big { width: 100%; font-family: Anton, sans-serif; font-weight: 400; font-size: 26px; letter-spacing: .04em; padding: 16px 22px; background: var(--lime); color: var(--navy); box-shadow: 0 6px 0 var(--navy); }
.btn.big:active { box-shadow: 0 2px 0 var(--navy); transform: translateY(4px); }
.btn.ghost { background: rgba(255,255,255,.12); color: #fff; font-size: 13px; flex: 1; }
.link { text-decoration: underline; text-underline-offset: 3px; font-weight: 700; font-size: 13px; }
.icon { width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 18px; display: grid; place-items: center; }
.fine { font-size: 12px; opacity: .7; margin: 12px 0 0; text-align: center; }
.center { text-align: center; }
.err { color: #E0004D; font-weight: 700; font-size: 14px; min-height: 18px; margin: 6px 0; }

/* bars */
.bar { display: flex; align-items: center; justify-content: space-between; padding: max(10px, env(safe-area-inset-top)) 16px 8px; max-width: 980px; margin: 0 auto; }
.logo { display: block; width: min(76vw, 340px); height: auto; }
.logo.sm { width: 132px; }
.bar-r { display: flex; gap: 10px; align-items: center; }
.me-chip { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: 4px 14px 4px 4px; font-weight: 800; font-size: 14px; }
.me-chip img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; background: #fff; }

/* AUTH */
.auth { background: radial-gradient(120% 70% at 50% 18%, #3D8BFF 0%, var(--blue) 42%, var(--navy) 100%); color: #fff; padding: max(18px, env(safe-area-inset-top)) 18px 40px; overflow: hidden; }
.auth.on { display: grid; gap: 22px; align-content: start; justify-items: center; }
.auth-hero { text-align: center; max-width: 620px; position: relative; }
.auth-hero .logo { margin: 0 auto -6px; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.bottle-fan { position: relative; height: 170px; display: flex; justify-content: center; align-items: flex-end; margin: 0 0 -26px; }
.bottle-fan img { height: 150px; margin: 0 -8px; filter: drop-shadow(0 14px 18px rgba(4,15,43,.45)); animation: bob 3s ease-in-out infinite; }
.bottle-fan img:nth-child(1) { transform: rotate(-14deg); animation-delay: -.2s; }
.bottle-fan img:nth-child(2) { transform: rotate(-5deg) translateY(-10px); animation-delay: -.9s; }
.bottle-fan img:nth-child(3) { transform: rotate(5deg) translateY(-10px); animation-delay: -1.5s; }
.bottle-fan img:nth-child(4) { transform: rotate(14deg); animation-delay: -2.2s; }
@keyframes bob { 50% { translate: 0 -8px; } }
.auth .mega { text-shadow: 5px 5px 0 var(--navy); position: relative; }
.lede { font-size: 17px; line-height: 1.4; max-width: 420px; margin: 14px auto 0; opacity: .95; }
.lede b { color: var(--lime); }
.auth-card { width: 100%; max-width: 420px; color: var(--navy); }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--frost); border-radius: 999px; padding: 4px; margin-bottom: 14px; }
.tab { border-radius: 999px; padding: 10px; font-weight: 800; font-size: 15px; color: rgba(7,26,68,.6); }
.tab.on { background: var(--navy); color: #fff; }
.field { display: block; margin: 12px 0; }
.field > span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px; color: rgba(7,26,68,.7); }
.field input { width: 100%; font: 600 17px Archivo, sans-serif; padding: 14px 16px; border-radius: 14px; border: 2px solid #DCE6F5; background: var(--frost); color: var(--navy); outline: none; }
.field input:focus { border-color: var(--blue); background: #fff; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.35; margin: 12px 0 4px; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); margin: 0; flex: none; }

/* PROFILE */
.profile, .board { background: linear-gradient(180deg, var(--frost), #DDEFFF); }
.profile .bar, .board .bar { background: var(--navy); max-width: none; }
.avatars { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.av { aspect-ratio: 1; border-radius: 50%; padding: 0; border: 3px solid transparent; overflow: hidden; transition: transform .15s; position: relative; background: #fff; }
.av img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 50%; }
.av.on { border-color: var(--navy); transform: scale(1.08); box-shadow: 0 0 0 3px var(--lime); }
.av.up { background: var(--frost); border: 2px dashed #9DB2D6; display: grid; place-items: center; font-weight: 900; font-size: 11px; letter-spacing: .06em; color: rgba(7,26,68,.7); }
.av.up input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.flavours { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fl { border-radius: 16px; padding: 10px 4px 8px; background: var(--frost); border: 3px solid transparent; display: grid; justify-items: center; gap: 6px; font-weight: 800; font-size: 11px; text-align: center; line-height: 1.1; }
.fl img { height: 84px; filter: drop-shadow(0 6px 8px rgba(4,15,43,.25)); transition: transform .2s; }
.fl.on { border-color: var(--navy); background: #fff; }
.fl.on img { transform: rotate(-8deg) scale(1.08); }

/* HUB */
.hub { background: radial-gradient(130% 50% at 50% 0%, var(--blue) 0%, var(--navy) 70%); color: #fff; }
.week { position: relative; overflow: hidden; background: linear-gradient(135deg, #0B2A8C, var(--navy)); border: 1px solid rgba(255,255,255,.1); }
.week::after { content: ''; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(var(--lime), transparent 70%); opacity: .25; }
.week-top { display: flex; justify-content: space-between; }
.week-num { font-family: Anton, sans-serif; font-size: 64px; line-height: 1; margin: 8px 0 12px; }
.week-num small { font-size: 22px; opacity: .6; margin-left: 6px; }
.meter { height: 14px; border-radius: 999px; background: rgba(255,255,255,.12); overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--electric), var(--lime)); transition: width 1s cubic-bezier(.2,.9,.2,1); }
.week-msg { margin: 12px 0 0; font-weight: 700; font-size: 15px; }
.draw-badge { display: inline-flex; align-items: center; gap: 8px; background: var(--lime); color: var(--navy); border-radius: 999px; padding: 8px 14px; font-weight: 900; font-size: 13px; letter-spacing: .04em; }
.draw-badge::before { content: '★'; }
.games { display: grid; gap: 14px; margin: 16px 0; }
@media (min-width: 900px) { .wrap.wide, .hub .wrap { max-width: 980px; } .games { grid-template-columns: 1fr 1fr; } .hub .wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; } .hub .week, .hub .games, .hub .foot { grid-column: 1 / -1; } }
.game-card { position: relative; display: grid; grid-template-columns: 38% 1fr; min-height: 200px; border-radius: var(--r); overflow: hidden; text-align: left; color: #fff; transition: transform .15s; box-shadow: 0 16px 40px rgba(0,0,0,.25); }
.game-card:active { transform: scale(.98); }
.game-card.run { background: linear-gradient(140deg, #2E7BFF 0%, #1F4BFF 40%, #0B1E66 100%); }
.game-card.stack { background: linear-gradient(140deg, #E8F7FF 0%, #BFE9FF 55%, #7FD3FF 100%); color: var(--navy); }
.gc-art { position: relative; display: grid; place-items: center; }
.game-card.run .gc-art::before { content: ''; position: absolute; width: 140px; height: 140px; border-radius: 50%; background: radial-gradient(var(--lime), transparent 65%); opacity: .5; }
.gc-art img { height: 170px; transform: rotate(-12deg); filter: drop-shadow(0 12px 16px rgba(0,0,0,.4)); position: relative; }
.gc-txt { padding: 18px 16px 64px 0; }
.gc-txt h3 { font-family: Anton, sans-serif; font-weight: 400; font-size: 46px; line-height: .9; margin: 6px 0 8px; }
.gc-txt p { margin: 0 0 10px; font-size: 14px; line-height: 1.35; opacity: .9; max-width: 26ch; }
.pb { font-size: 11px; font-weight: 800; letter-spacing: .12em; opacity: .8; }
.play { position: absolute; right: 14px; bottom: 14px; background: var(--lime); color: var(--navy); font-family: Anton, sans-serif; font-size: 20px; padding: 8px 18px; border-radius: 999px; box-shadow: 0 4px 0 var(--navy); }
.mini-stack { position: relative; width: 110px; height: 150px; }
.mini-stack i { position: absolute; left: 50%; width: 96px; height: 30px; transform: translateX(-50%) skewY(-8deg); border-radius: 6px; background: linear-gradient(180deg, #fff, #8BE6FF); box-shadow: inset 0 -6px 0 rgba(31,75,255,.25), 0 4px 10px rgba(7,26,68,.2); }
.mini-stack i:nth-child(1) { bottom: 10px; } .mini-stack i:nth-child(2) { bottom: 42px; margin-left: 6px; background: linear-gradient(180deg, #fff, #B57BFF); }
.mini-stack i:nth-child(3) { bottom: 74px; margin-left: 2px; width: 84px; background: linear-gradient(180deg, #fff, #FFB46B); } .mini-stack i:nth-child(4) { bottom: 106px; margin-left: -4px; width: 78px; background: linear-gradient(180deg, #fff, var(--lime)); animation: slide 1.6s ease-in-out infinite alternate; }
@keyframes slide { from { margin-left: -30px; } to { margin-left: 22px; } }
.board-peek { color: var(--navy); }
.peek-head { display: flex; justify-content: space-between; align-items: baseline; }
.peek-head h3 { font-family: Anton, sans-serif; font-weight: 400; font-size: 28px; margin: 0 0 6px; }
.foot { display: flex; flex-wrap: wrap; gap: 10px 18px; justify-content: center; padding: 26px 0 10px; font-size: 13px; opacity: .85; }

/* leaderboard rows */
.rows { list-style: none; margin: 0; padding: 0; }
.row { display: grid; grid-template-columns: 34px 40px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 16px; background: #fff; margin: 8px 0; box-shadow: 0 6px 16px rgba(4,15,43,.06); }
.row .rk { font-family: Anton, sans-serif; font-size: 22px; text-align: center; color: rgba(7,26,68,.55); }
.row img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; }
.row .nm { font-weight: 800; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .nm small { display: block; font-weight: 700; font-size: 11px; color: var(--blue); letter-spacing: .04em; }
.row .pts { font-family: Anton, sans-serif; font-size: 22px; }
.row.r1 { background: var(--lime); } .row.r1 .rk { color: var(--navy); }
.row.r2 .rk, .row.r3 .rk { color: var(--blue); }
.row.me { outline: 3px solid var(--blue); }
.rows.compact .row { box-shadow: none; background: var(--frost); padding: 6px 10px; margin: 6px 0; }
.rows.compact .row.r1 { background: var(--lime); }
.empty { text-align: center; padding: 24px; opacity: .7; font-weight: 700; }
.tabs.pill { max-width: 360px; background: #fff; }
.board-sub { font-weight: 700; font-size: 14px; margin: 4px 0 6px; }
#boardMe .row { margin-top: 14px; }
.me-label { font-size: 11px; font-weight: 900; letter-spacing: .14em; margin-top: 18px; color: rgba(7,26,68,.6); }

/* GAME */
.game { position: fixed; inset: 0; background: var(--ink); touch-action: none; user-select: none; -webkit-user-select: none; }
.game.on { display: block; }
#gameCanvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.close { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 3; background: rgba(4,15,43,.35); width: 36px; height: 36px; font-size: 15px; }
.over { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: rgba(4,15,43,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 18px; }
.over[hidden] { display: none; }
.over-in { width: 100%; max-width: 380px; text-align: center; color: #fff; animation: pop .35s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }
.over-in .kicker { color: var(--lime); font-size: 13px; }
.over-score { font-family: Anton, sans-serif; font-size: 96px; line-height: 1; margin: 6px 0 10px; text-shadow: 5px 5px 0 var(--blue); }
.over-badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; min-height: 10px; margin-bottom: 14px; }
.badge { background: #fff; color: var(--navy); border-radius: 999px; padding: 6px 12px; font-weight: 900; font-size: 12px; letter-spacing: .06em; }
.badge.blue { background: var(--blue); color: #fff; }
.over-week { margin: 6px 0 18px; } .over-week p { margin: 8px 0 0; font-weight: 700; font-size: 14px; }
.over-row { display: flex; gap: 10px; margin-top: 16px; }
.sting { position: fixed; inset: 0; z-index: 50; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 800; font-size: 14px; z-index: 60; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
@media (min-width: 900px) {
  .auth.on { grid-template-columns: 1.2fr 1fr; align-items: center; justify-items: stretch; min-height: 100dvh; padding: 40px max(40px, calc((100vw - 1180px) / 2)); }
  .auth { background: radial-gradient(70% 90% at 30% 40%, #3D8BFF 0%, var(--blue) 42%, var(--navy) 100%); }
  .auth-hero { text-align: left; } .auth-hero .logo { margin: 0 0 -6px; } .bottle-fan { justify-content: flex-start; padding-left: 30px; } .lede { margin-left: 0; }
  .bottle-fan { height: 220px; } .bottle-fan img { height: 200px; }
  .mega { font-size: 120px; }
}

.how { color: var(--navy); margin-top: 14px; }
.how h3 { font-family: Anton, sans-serif; font-weight: 400; font-size: 28px; margin: 0 0 10px; }
.how ol { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.how li { counter-increment: s; display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-weight: 600; font-size: 15px; line-height: 1.35; }
.how li::before { content: counter(s); font-family: Anton, sans-serif; font-size: 18px; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: var(--navy); }
.how .fine { text-align: left; }
@media (min-width: 900px) { .how { margin-top: 0; } }
/* production additions: setup / reset screens, notes, countdown, empty states */
.setup.on { display: grid; place-items: center; color: #fff; text-align: center; padding: 30px 0; }
.wrap.narrow { max-width: 440px; }
.setup .logo { width: min(260px, 70vw); margin: 0 auto; filter: drop-shadow(0 10px 24px rgba(0,0,0,.35)); }
.setup .lede { margin-bottom: 22px; }
.setup .card { color: var(--navy); text-align: left; }
.setup code { background: rgba(255,255,255,.14); padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.fine.left { text-align: left; margin-bottom: 18px; }
.note { background: var(--frost); border-left: 4px solid var(--blue); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.4; font-weight: 600; margin: 8px 0 12px; }
.note b { color: var(--blue); }
.forgot { display: block; margin: 14px auto 0; color: rgba(7,26,68,.75); }
.clock { font-variant-numeric: tabular-nums; }
.week-dates { font-size: 12px; font-weight: 700; letter-spacing: .06em; opacity: .7; margin: 2px 0 0; text-transform: uppercase; }
.rows .empty { list-style: none; text-align: center; padding: 22px 12px; font-weight: 700; line-height: 1.4; color: rgba(7,26,68,.75); }
.rows .empty b { display: block; font-family: Anton, sans-serif; font-weight: 400; font-size: 26px; letter-spacing: .02em; color: var(--navy); margin-bottom: 4px; }
.over-week p.muted { opacity: .8; }
.week-top { flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.week-top .kicker { white-space: nowrap; }
a.btn { text-decoration: none; }
