:root {
    --bg: #0b0b14; --panel: #14141f; --card: #1a1a29; --line: #2b2b42; --ink: #fff; --muted: #9b9bb8;
    --lime: #d2ff3c; --purple: #a78bfa; --cyan: #5cc8ff; --orange: #fb923c; --danger: #ff6b81;
    --radius: 18px;
    --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Roboto Mono", monospace;
    --spring: cubic-bezier(.34, 1.56, .64, 1);
    --out: cubic-bezier(.22, 1, .36, 1);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body {
    margin: 0; color: var(--ink); background: radial-gradient(900px 500px at 50% -100px, #1d1b3a 0%, var(--bg) 60%) no-repeat, var(--bg);
    font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    padding-bottom: calc(96px + env(safe-area-inset-bottom)); min-height: 100vh; overflow-x: hidden;
}
body.anon { padding-bottom: 24px; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
.page { max-width: 560px; margin: 0 auto; padding: 8px 18px 24px; }
.ic { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.24em; }

/* ----- page + navigation motion ----- */
@view-transition { navigation: auto; }
.top { view-transition-name: top; }
.tabbar { view-transition-name: tabbar; }
::view-transition-old(root) { animation: vt-out .14s ease-in both; }
::view-transition-new(root) { animation: vt-in .32s var(--out) both; }
@keyframes vt-out { to { opacity: 0; transform: translateY(-6px); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(14px); } }

.page > *, .stagger > * { animation: rise .5s var(--out) both; }
.page > :nth-child(2), .stagger > :nth-child(2) { animation-delay: .05s; }
.page > :nth-child(3), .stagger > :nth-child(3) { animation-delay: .1s; }
.page > :nth-child(4), .stagger > :nth-child(4) { animation-delay: .15s; }
.page > :nth-child(5) { animation-delay: .2s; }
.page > :nth-child(6) { animation-delay: .25s; }
.page > :nth-child(7) { animation-delay: .3s; }
.page > :nth-child(8) { animation-delay: .35s; }
.page > :nth-child(n+9) { animation-delay: .4s; }
.still .page > *, .still .chip.xp, .still .photowrap { animation: none !important; }
.still::view-transition-old(root), .still::view-transition-new(root) { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes drop { from { opacity: 0; transform: translateY(-18px) scale(.96); } }

/* ----- header ----- */
.top { max-width: 560px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px 6px; padding-top: calc(14px + env(safe-area-inset-top)); position: relative; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand svg { width: 42px; height: 42px; transition: transform .6s var(--spring); }
.brand:active svg { transform: rotate(180deg) scale(.92); }
.brand b { font-weight: 900; font-size: 1.05rem; line-height: .95; letter-spacing: -.02em; text-transform: uppercase; font-style: italic; }
.menu { position: relative; }
.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
    font-size: 1.5rem; color: #c9c9dd; transition: background .2s, transform .2s var(--spring); }
.menu summary:active { transform: scale(.9); }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] summary { background: var(--card); color: var(--ink); }
.menu nav { position: absolute; right: 0; top: 50px; z-index: 20; min-width: 220px; background: var(--card);
    border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,.6);
    transform-origin: top right; animation: menu-in .22s var(--spring) both; }
@keyframes menu-in { from { opacity: 0; transform: scale(.85) translateY(-6px); } }
.menu nav a, .menu nav button { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 10px;
    background: none; border: 0; color: var(--ink); font: inherit; font-weight: 700; cursor: pointer; }
.menu nav .ic { color: var(--purple); }
.menu nav a:hover, .menu nav button:hover, .menu nav a:active, .menu nav button:active { background: var(--line); }

/* Racing-flag accents from the mockups. */
.stripes { display: inline-block; flex: none; width: 88px; height: 22px; color: var(--purple); transform: skewX(-24deg);
    background: repeating-conic-gradient(currentColor 0 25%, transparent 0 50%) 0 0 / 22px 22px;
    animation: stripes 1.6s linear infinite; }
.stripes.lime { color: var(--lime); }
.stripes.slash { color: #55556f; height: 14px; background: repeating-linear-gradient(90deg, currentColor 0 7px, transparent 7px 14px); animation-name: slashes; }
@keyframes stripes { to { background-position: 22px 0; } }
@keyframes slashes { to { background-position: 14px 0; } }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.title-row h1 { flex: 1; min-width: 0; }
.title-row .stripes { margin-bottom: 20px; }
.title-row .eyebrow + .stripes { margin-bottom: 2px; }

/* ----- type ----- */
.eyebrow { display: inline-block; color: var(--purple); font-weight: 800; font-size: 1rem; margin: 6px 0 0; }
.eyebrow.tag { background: var(--purple); color: #1a1033; padding: 3px 12px; border-radius: 6px; font-weight: 800; font-family: var(--mono); }
h1 { font-size: 2.4rem; line-height: 1.02; margin: 4px 0 14px; font-weight: 900; letter-spacing: -.035em; overflow-wrap: anywhere; }
h1.pop { animation: pop .5s var(--spring) both; transform-origin: left center; }
h1.swoosh { display: inline-block; position: relative; padding-bottom: 14px; margin-bottom: 16px; }
h1.swoosh::after { content: ""; position: absolute; left: 4px; bottom: 0; width: 58%; height: 8px; border-radius: 99px 99px 99px 4px;
    background: var(--lime); transform: rotate(-2.5deg); transform-origin: left; animation: swoosh .7s .25s var(--out) both; }
@keyframes swoosh { from { transform: rotate(-2.5deg) scaleX(0); } }
h2 { font-size: 1.5rem; margin: 26px 0 12px; font-weight: 900; letter-spacing: -.02em; }
.muted { color: var(--muted); font-size: .92rem; }
.mono { font-family: var(--mono); color: #d7d7ea; letter-spacing: .02em; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; gap: 10px; }
.row > .grow, .grow { flex: 1; min-width: 0; }
.gap-top { margin-top: 10px; }
.gap-bottom { margin-bottom: 10px; }

/* ----- cards, chips, buttons ----- */
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.tap { transition: transform .18s var(--spring), border-color .2s, background .2s; }
.tap:active { transform: scale(.975); border-color: #45456a; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 10px; font-weight: 700; font-size: .85rem; border: 2px solid var(--line); white-space: nowrap; }
.chip.cyan { border-color: var(--cyan); color: var(--cyan); background: rgba(92,200,255,.08); }
.chip.purple { border-color: var(--purple); color: var(--purple); background: rgba(167,139,250,.12); }
.chip.lime { border-color: var(--lime); color: var(--lime); background: rgba(210,255,60,.08); }
.chip.solid { border-radius: 8px; padding: 4px 10px; font-weight: 800; }
.chip.solid.lime { background: var(--lime); color: #101300; border-color: var(--lime); }
.chip.solid.purple { background: var(--purple); color: #160d33; }
.chip.solid.cyan { background: var(--cyan); color: #04202d; }
.chip.xp { font-size: 1.05rem; font-weight: 900; padding: 6px 12px; border-radius: 12px; animation: pop .5s .25s var(--spring) both; }
.chip.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: live 1.4s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(92,200,255,.7); } 100% { box-shadow: 0 0 0 9px rgba(92,200,255,0); } }

.btn { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
    border: 2px solid transparent; border-radius: 16px; padding: 16px 18px; font: inherit; font-weight: 900; font-size: 1.2rem; letter-spacing: -.01em;
    text-align: center; cursor: pointer; background: var(--lime); color: #101300; margin-top: 12px; user-select: none;
    transition: transform .16s var(--spring), background .25s, color .25s, border-color .25s, box-shadow .25s; }
.btn:active { transform: scale(.965); }
.btn .ic { width: 1.4em; height: 1.4em; }
.btn.glow { animation: glow 2.4s ease-in-out infinite; }
.btn.glow::after { content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.55), transparent); animation: shine 3.2s ease-in-out infinite; }
@keyframes glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(210,255,60,0); } 50% { box-shadow: 0 0 26px 2px rgba(210,255,60,.38); } }
@keyframes shine { 0%, 55% { left: -60%; } 100% { left: 130%; } }
.btn.outline { background: rgba(92,200,255,.07); border-color: var(--cyan); color: var(--ink); }
.btn.outline .ic { color: var(--cyan); }
.btn.outline[data-picked] { background: transparent; font-size: 1rem; padding: 10px 14px; width: fit-content; margin-left: auto; border-radius: 12px; }
.btn.small { display: inline-flex; width: auto; padding: 9px 14px; font-size: .95rem; margin: 0; gap: 6px; border-radius: 12px; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); font-weight: 700; font-size: 1.05rem; }
.btn[disabled], .btn.disabled { background: #1c1c2a; color: #6c6c85; cursor: not-allowed; border-color: #30304a; }
.btn.ready { animation: pop .45s var(--spring) both, glow 2.4s .45s ease-in-out infinite; }
.filebtn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; font-size: 0; }
.alert { background: rgba(255,107,129,.12); border: 1px solid var(--danger); border-radius: 14px; padding: 12px; margin: 8px 0; animation: shake .4s both !important; }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(3px); } }
.toast { background: rgba(210,255,60,.12); border: 1px solid var(--lime); border-radius: 14px; padding: 12px; margin: 8px 0; font-weight: 800;
    animation: drop .5s var(--spring) both !important; }
.field-error, .text-danger { color: var(--danger); font-size: .9rem; }

/* ----- forms ----- */
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type=text], input[type=email], input[type=number], select, textarea {
    width: 100%; padding: 13px; border: 2px solid var(--line); border-radius: 14px; font: inherit;
    background: var(--panel); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
textarea { min-height: 130px; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(92,200,255,.15); }
input[type=checkbox] { accent-color: var(--lime); width: 18px; height: 18px; vertical-align: -3px; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* ----- progress ----- */
progress { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border: 0; border-radius: 99px; background: var(--line); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--line); border-radius: 99px; }
progress::-webkit-progress-value { background: var(--lime); border-radius: 99px; }
progress::-moz-progress-bar { background: var(--lime); border-radius: 99px; }
.segbar { display: flex; gap: 6px; margin: 10px 0 8px; }
.segbar i { flex: 1; height: 16px; border-radius: 99px; background: var(--line); position: relative; overflow: hidden; }
.segbar i.on::after { content: ""; position: absolute; inset: 0; border-radius: 99px; background: var(--lime); transform-origin: left; animation: fill .45s var(--out) both; }
.segbar i:nth-child(2)::after { animation-delay: .12s; } .segbar i:nth-child(3)::after { animation-delay: .24s; }
.segbar i:nth-child(4)::after { animation-delay: .36s; } .segbar i:nth-child(5)::after { animation-delay: .48s; }
.segbar i:nth-child(n+6)::after { animation-delay: .6s; }
@keyframes fill { from { transform: scaleX(0); } }
.progress-row { display: flex; align-items: center; gap: 12px; }
.progress-row progress { flex: 1; }
.progress-row .muted { color: var(--purple); white-space: nowrap; font-weight: 700; }

/* ----- avatars ----- */
.avatar { display: grid; place-items: center; font-weight: 900; color: #0b0b14; border-radius: 14px; width: 56px; height: 56px; font-size: 1.7rem; flex: none;
    background-image: linear-gradient(140deg, rgba(255,255,255,.42), rgba(255,255,255,0) 48%, rgba(0,0,0,.2)); text-shadow: 0 1px 0 rgba(255,255,255,.35); }
.avatar.lg { width: 96px; height: 96px; font-size: 3rem; border-radius: 22px; }
.avatar.xl { width: 128px; height: 128px; font-size: 4rem; border-radius: 28px; }
.avatar.sm { width: 40px; height: 40px; font-size: 1.2rem; border-radius: 12px; }
.avatar.slant { width: 76px; height: 60px; border-radius: 0; clip-path: polygon(22% 0, 100% 0, 78% 100%, 0 100%); margin: -8px 0; }
.avatar.burst { transform: rotate(-5deg); box-shadow: 10px 10px 0 rgba(167,139,250,.28), -6px -6px 0 rgba(210,255,60,.12); animation: burst .7s var(--spring) both; }
@keyframes burst { from { transform: rotate(-22deg) scale(.5); opacity: 0; } }
.avatar { position: relative; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-edit { position: relative; flex: none; }
.avatar-edit form { position: absolute; right: -6px; bottom: -6px; }
.camera-badge { display: grid; place-items: center; width: 44px; height: 44px; margin: 0; border-radius: 50%; cursor: pointer;
    background: var(--lime); color: #101300; border: 3px solid var(--bg); position: relative; overflow: hidden;
    transition: transform .2s var(--spring); }
.camera-badge:active { transform: scale(.88); }
.camera-badge input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.member { padding: 12px 14px; }
.linkform { display: flex; gap: 8px; margin-top: 10px; }
.linkform input { padding: 9px 12px; font-size: .9rem; }
.av-purple { background-color: var(--purple); } .av-cyan { background-color: var(--cyan); }
.av-lime { background-color: var(--lime); } .av-orange { background-color: var(--orange); }

.pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pick.three { grid-template-columns: repeat(auto-fit, minmax(74px, 1fr)); gap: 8px; }
.pick.three .tile { padding: 12px 4px; font-size: .9rem; }
.pick .tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 8px; background: var(--card);
    border: 2px solid var(--line); border-radius: var(--radius); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; width: 100%;
    transition: transform .2s var(--spring), border-color .2s, background .2s, box-shadow .2s; }
.pick .tile:active { transform: scale(.94); }
.pick .tile .avatar { transition: transform .3s var(--spring); }
.pick .tile:hover, .pick input:checked + .tile { border-color: var(--cyan); background: rgba(167,139,250,.24); }
.pick input:checked + .tile { box-shadow: 0 0 0 4px rgba(92,200,255,.15), 0 8px 24px rgba(167,139,250,.25); transform: translateY(-3px); }
.pick input:checked + .tile .avatar { transform: scale(1.08) rotate(-4deg); }
.pick input:focus-visible + .tile { outline: 3px solid var(--cyan); outline-offset: 2px; }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick label { margin: 0; }

/* ----- wheel ----- */
.wheelbox { position: relative; width: min(100%, 360px); margin: 14px auto 0; aspect-ratio: 1; }
.wheelbox::before { content: ""; position: absolute; inset: 4%; border-radius: 50%; z-index: -1;
    box-shadow: 0 0 60px 6px rgba(167,139,250,.35); animation: halo 3.6s ease-in-out infinite; }
@keyframes halo { 50% { box-shadow: 0 0 80px 14px rgba(210,255,60,.22); } }
.wheelbox svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wheelbox .pointer { position: absolute; left: 50%; top: -6px; margin-left: -17px; width: 0; height: 0; transform-origin: 50% 0;
    border-left: 17px solid transparent; border-right: 17px solid transparent; border-top: 34px solid var(--lime); z-index: 2;
    filter: drop-shadow(0 0 0 #0b0b14) drop-shadow(0 3px 5px rgba(0,0,0,.7)); }
.wheelbox .pointer.tick { animation: tick .11s ease-out; }
@keyframes tick { 40% { transform: rotate(-16deg); } }
#wheel-rotor { transform-origin: 50% 50%; transition: transform 4.6s cubic-bezier(.1, .72, .08, 1); will-change: transform; }
#wheel-rotor path { transition: opacity .4s; }
.wheelbox.landed #wheel-rotor path:not(.win) { opacity: .38; }
.wheelbox.landed #wheel-rotor path.win { animation: win .5s ease-in-out 3; }
.wheelbox.landed .pointer { animation: pointer-win .5s var(--spring) 2; }
@keyframes win { 50% { opacity: .55; } }
@keyframes pointer-win { 50% { transform: translateY(8px) scale(1.15); } }
.wheel-result { text-align: center; font-weight: 900; font-size: 1.7rem; letter-spacing: -.02em; margin: 12px 0 0; min-height: 1.6em; color: var(--lime); }
.wheel-result.show { animation: pop .55s var(--spring) both !important; text-shadow: 0 0 24px rgba(210,255,60,.5); }

/* ----- zone cards ----- */
.zone { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; border-left: 5px solid var(--purple); }
.zone.cyan { border-left-color: var(--cyan); } .zone.lime { border-left-color: var(--lime); }
.zone .ico { width: 60px; height: 60px; border-radius: 14px; background: #24243a; display: grid; place-items: center; font-size: 1.9rem; flex: none; }
.zone strong { font-size: 1.2rem; font-weight: 800; }
.zone .room { font-weight: 700; color: var(--purple); }
.zone .when { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; }
.zone .when .ic { color: var(--cyan); }
.zone .row { gap: 8px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 4px; margin: 6px 0 14px; gap: 4px; }
.seg a { text-align: center; padding: 11px; border-radius: 10px; font-weight: 800; color: var(--ink); transition: background .25s, color .25s, transform .18s var(--spring); }
.seg a:active { transform: scale(.96); }
.seg a.on { background: var(--lime); color: #101300; }
.seg.cyan a.on { background: var(--cyan); color: #04202d; }

/* ----- photos / checklist ----- */
.photo { width: 100%; border-radius: var(--radius); display: block; background: var(--card); aspect-ratio: 4/3; object-fit: cover; }
.photowrap { position: relative; margin: 12px 0; border-radius: var(--radius); overflow: hidden; }
.photowrap:not([hidden]) { animation: zoom .45s var(--out) both; }
@keyframes zoom { from { opacity: 0; transform: scale(.94); } }
.photowrap .tagpill, .ba .lab { background: rgba(11,11,20,.82); padding: 5px 12px; border-radius: 8px; font-weight: 800; font-size: .85rem;
    letter-spacing: .06em; font-family: var(--mono); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.photowrap .tagpill { position: absolute; left: 12px; top: 12px; z-index: 1; }
.checks { list-style: none; padding: 0; margin: 0; }
.checks li { margin-bottom: 8px; }
.checks .item { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--panel); border: 1px solid var(--line);
    border-radius: 14px; padding: 14px; color: var(--ink); font: inherit; font-weight: 700; font-size: 1.05rem; text-align: left;
    transition: transform .16s var(--spring), border-color .2s, background .2s; }
.checks button.item { cursor: pointer; }
.checks button.item:active { transform: scale(.975); }
.box { width: 30px; height: 30px; border-radius: 8px; border: 2px solid #6f6f8c; flex: none; display: grid; place-items: center; color: #101300; transition: background .2s, border-color .2s; }
.box .ic { width: 22px; height: 22px; stroke-width: 3; opacity: 0; transform: scale(.3); transition: opacity .15s, transform .25s var(--spring); }
.done .box { background: var(--lime); border-color: var(--lime); }
.done .box .ic { opacity: 1; transform: none; }
.done .item { border-color: rgba(210,255,60,.35); }
.checks li.just .box { animation: check 0.5s var(--spring) both; }
@keyframes check { 0% { transform: scale(.4) rotate(-20deg); } 60% { transform: scale(1.3) rotate(6deg); } }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }
.section-head span { color: var(--purple); font-weight: 800; font-size: 1.1rem; }

/* ----- praise slider ----- */
.ba { position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; background: var(--card); user-select: none; touch-action: pan-y;
    border: 1px solid var(--line); cursor: ew-resize; }
[data-slide]:not([hidden]) .ba { animation: slide-in .5s var(--out) both; }
@keyframes slide-in { from { opacity: 0; transform: translateX(36px) scale(.96); } }
.ba img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.ba .after { clip-path: inset(0 0 0 50%); }
.ba .divider { position: absolute; top: 0; bottom: 0; left: 50%; width: 4px; margin-left: -2px; background: #fff; z-index: 2; box-shadow: 0 0 14px rgba(255,255,255,.7); }
.ba .play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3; width: 58px; height: 58px; border-radius: 50%;
    background: rgba(11,11,20,.85); border: 2px solid #fff; color: #fff; font-size: 1.3rem; cursor: pointer; display: grid; place-items: center;
    transition: transform .2s var(--spring), opacity .3s; }
.ba .play .ic { fill: currentColor; margin-left: 3px; }
.ba .play:active { transform: translate(-50%, -50%) scale(.88); }
.ba.playing .play { opacity: 0; pointer-events: none; }
.ba .lab { position: absolute; top: 12px; z-index: 3; }
.ba .lab.l { left: 12px; } .ba .lab.r { right: 12px; }
.ba .bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 12px; background: linear-gradient(transparent, rgba(11,11,20,.85)); }
.ba .bar progress { height: 8px; background: rgba(255,255,255,.25); }
.ba .bar progress::-webkit-progress-bar { background: rgba(255,255,255,.25); }
.reel-seg { display: flex; gap: 6px; margin: 10px 0 0; }
.reel-seg i { flex: 1; height: 6px; border-radius: 99px; background: var(--line); overflow: hidden; }
.reel-seg b { display: block; height: 100%; background: var(--lime); transform: scaleX(0); transform-origin: left; }
.slide-meta strong { font-size: 1.35rem; font-weight: 900; letter-spacing: -.02em; }
.slide-meta .count { color: var(--purple); font-weight: 800; font-size: 1.1rem; }
.btn.cheer { font-size: 1.5rem; padding: 18px; }
.btn.cheer.bump .ic { animation: thumb .6s var(--spring); }
@keyframes thumb { 30% { transform: rotate(-24deg) scale(1.45); } 60% { transform: rotate(8deg) scale(1.1); } }

/* ----- leaderboard / profile ----- */
.rank { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 8px 12px 8px 16px; margin-bottom: 10px; overflow: hidden; }
.rank .n { font-weight: 900; font-size: 1.5rem; color: var(--purple); width: 20px; }
.rank.r1 .n { color: var(--lime); } .rank.r2 .n { color: var(--cyan); }
.rank.r1 { border-color: rgba(210,255,60,.45); box-shadow: 0 0 22px rgba(210,255,60,.1); }
.rank .name { flex: 1; font-weight: 900; font-size: 1.35rem; letter-spacing: -.02em; }
.rank.flush { padding: 0 16px 0 0; gap: 16px; }
.rank.flush .avatar { width: 84px; height: 64px; border-radius: 0; }
.rank .zones { font-family: var(--mono); color: var(--purple); font-weight: 700; border-left: 2px solid var(--line); padding: 8px 0 8px 16px; }
.xpbadge { border: 2px solid var(--cyan); color: var(--cyan); background: rgba(92,200,255,.08); padding: 4px 12px; border-radius: 10px; font-weight: 800; font-family: var(--mono); white-space: nowrap; }
.bonus { display: flex; align-items: center; gap: 12px; background: rgba(167,139,250,.14); border: 1px solid var(--purple); border-radius: 14px; padding: 12px 14px; font-weight: 800; }
.bonus .ic { color: var(--purple); width: 1.6em; height: 1.6em; }
.bonus > span:last-child { margin-left: auto; color: var(--purple); }
.bonus.big { position: relative; overflow: hidden; gap: 16px; padding: 16px 18px; border-radius: var(--radius);
    background: linear-gradient(120deg, #4c3a9c, #7b5fe0 70%, #a78bfa); border-color: #b9a4ff; }
.bonus.big::after { content: ""; position: absolute; right: -30px; top: 0; bottom: 0; width: 130px; transform: skewX(-28deg);
    background: repeating-linear-gradient(90deg, rgba(255,255,255,.16) 0 10px, transparent 10px 26px); }
.bonus.big .ic { color: #fff; fill: #fff; width: 2.4em; height: 2.4em; animation: zap 1.8s ease-in-out infinite; }
@keyframes zap { 0%, 100% { transform: none; filter: none; } 8% { transform: scale(1.18) rotate(-8deg); filter: drop-shadow(0 0 10px #fff); } 16% { transform: none; } }
.bonus.big div { border-left: 2px solid rgba(255,255,255,.4); padding-left: 16px; display: flex; flex-direction: column; }
.bonus.big strong { font-size: 1.3rem; font-weight: 900; }
.bonus.big .mono { color: #efeaff; }

.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 6px 2px 0; }
.badge { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; gap: 4px; background: var(--card); border: 3px solid var(--line);
    border-radius: 16px; padding: 14px 6px 12px; text-align: center; font-weight: 900; font-style: italic; text-transform: uppercase;
    font-size: .82rem; line-height: 1.05; letter-spacing: -.01em; transform: rotate(-5deg); }
.badge:nth-child(2) { transform: rotate(3deg); } .badge:nth-child(3) { transform: rotate(-2deg); }
.badge .ic { width: 2.6rem; height: 2.6rem; }
.badge.lime { border-color: var(--lime); color: var(--lime); box-shadow: 4px 4px 0 rgba(210,255,60,.25); }
.badge.cyan { border-color: var(--cyan); color: var(--cyan); box-shadow: 4px 4px 0 rgba(92,200,255,.25); }
.badge.white { border-color: #fff; box-shadow: 4px 4px 0 rgba(255,255,255,.2); }
.badge:not(.locked) .ic { animation: bob 2.6s ease-in-out infinite; }
.badge:nth-child(2):not(.locked) .ic { animation-delay: .4s; } .badge:nth-child(3):not(.locked) .ic { animation-delay: .8s; }
.badge:not(.locked)::after, .ach:not(.locked)::after { content: ""; position: absolute; top: 0; bottom: 0; left: -80%; width: 50%; transform: skewX(-20deg);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); animation: shine 4s 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-4px) rotate(-6deg); } }
.badge.locked { opacity: .45; border-color: var(--line); color: var(--muted); border-style: dashed; }

.ach { position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px; padding: 12px 18px; margin: 0 6px 12px; font-weight: 900; font-style: italic;
    font-size: 1.45rem; letter-spacing: -.02em; border: 3px solid var(--line); border-radius: 6px 18px 6px 18px; transform: skewX(-7deg); }
.ach > * { transform: skewX(7deg); }
.ach .ic { width: 2.4rem; height: 2.4rem; }
.ach.lime { border-color: var(--lime); background: linear-gradient(100deg, rgba(210,255,60,.3), rgba(210,255,60,.04) 45%); }
.ach.lime .ic { color: var(--lime); }
.ach.cyan { border-color: var(--cyan); background: linear-gradient(100deg, rgba(92,200,255,.3), rgba(92,200,255,.04) 45%); }
.ach.cyan .ic { color: var(--cyan); }
.ach.white { border-color: #fff; background: linear-gradient(100deg, rgba(255,255,255,.22), rgba(255,255,255,.03) 45%); }
.ach.locked { color: #8a8aa3; border-color: #4a4a62; background: #1c1c28; }
.ach.locked .ic { color: #8a8aa3; }
.ach small { display: block; font-style: normal; font-weight: 500; font-size: .8rem; letter-spacing: 0; color: var(--muted); }

.profile-head { display: flex; gap: 22px; align-items: center; padding: 6px 0 4px 6px; }
.profile-head h1 { margin: 0 0 6px; font-size: 2.6rem; }
.streak { display: flex; align-items: center; gap: 12px; margin: 18px 0 0; padding: 12px 2px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.streak .ic { width: 2rem; height: 2rem; color: var(--muted); }
.streak .mono { color: var(--purple); font-weight: 700; border-left: 2px solid var(--line); padding-left: 12px; }
.streak.hot .ic { color: var(--purple); fill: rgba(167,139,250,.35); transform-origin: 50% 90%; animation: flame 1.1s ease-in-out infinite; }
@keyframes flame { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.14, 1.2) rotate(3deg); filter: drop-shadow(0 0 8px rgba(167,139,250,.8)); } }
.crown { width: 3.2rem; height: 3.2rem; color: var(--lime); margin-bottom: 18px; transform-origin: 50% 90%; animation: crown 2.4s ease-in-out infinite; }
@keyframes crown { 0%, 100% { transform: rotate(8deg); } 50% { transform: rotate(16deg) translateY(-3px); filter: drop-shadow(0 0 10px rgba(210,255,60,.6)); } }

/* ----- bottom nav ----- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--bg) 70%, transparent); }
.tabbar > div { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
    background: rgba(20,20,31,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 20px; padding: 6px; }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px; border-radius: 14px; font-weight: 700; font-size: .82rem; color: var(--ink);
    transition: background .25s, color .25s, transform .18s var(--spring); }
.tabbar a .ic { width: 1.6rem; height: 1.6rem; }
.tabbar a:active { transform: scale(.92); }
.tabbar a.on { background: var(--lime); color: #101300; font-weight: 800; }
.tabbar a.on .ic { animation: bump .5s var(--spring); }
@keyframes bump { 0% { transform: scale(.6) translateY(4px); } }

/* ----- login ----- */
.login-hero { text-align: center; }
.login-hero h1 { font-size: 3rem; margin-top: 0; }
.hero-wheel { width: min(88%, 340px); height: auto; display: block; margin: 0 auto -4px; overflow: visible; filter: drop-shadow(0 0 30px rgba(210,255,60,.18)); }
.hero-rotor { transform-box: fill-box; transform-origin: center; animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hero-flag { transform-box: fill-box; transform-origin: center; animation: wave 2.2s ease-in-out infinite; opacity: .92; }
.hero-flag.f2 { animation-delay: -1.1s; }
@keyframes wave { 50% { transform: translateY(-5px) rotate(-3deg); } }
.hero-lines path { stroke-dasharray: 90; animation: dash 1.8s ease-in-out infinite; }
.hero-lines path:nth-child(even) { animation-delay: .3s; }
@keyframes dash { 0% { stroke-dashoffset: 90; opacity: 0; } 40% { opacity: 1; } 100% { stroke-dashoffset: -90; opacity: 0; } }
.login-hero .stagger > * { animation-name: pop; animation-duration: .55s; animation-timing-function: var(--spring); animation-delay: .25s; }
.login-hero .stagger > :nth-child(2) { animation-delay: .33s; } .login-hero .stagger > :nth-child(3) { animation-delay: .41s; }
.login-hero .stagger > :nth-child(4) { animation-delay: .49s; }

/* ----- confetti ----- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; opacity: 0;
    animation: fall var(--t, 2s) cubic-bezier(.25, .6, .5, 1) var(--d, 0s) forwards; }
@keyframes fall { 0% { opacity: 1; transform: translate3d(0, 0, 0) rotate(0); } 85% { opacity: 1; }
    100% { opacity: 0; transform: translate3d(var(--dx, 0), 108vh, 0) rotate(var(--rot, 540deg)); } }

/* ----- activities ----- */
.actions-row { display: flex; gap: 10px; margin: 4px 0 8px; flex-wrap: wrap; }
.actions-row .btn { margin: 0; }
.section-head .link { font-weight: 800; color: var(--cyan); }
.task { align-items: center; gap: 14px; }
.task .ico { width: 52px; height: 52px; border-radius: 14px; background: #24243a; display: grid; place-items: center; flex: none; color: var(--purple); }
.task .ico .ic { width: 1.8rem; height: 1.8rem; }
.task strong { font-size: 1.15rem; font-weight: 800; }
.task .meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.task.fresh { border-color: rgba(210,255,60,.5); box-shadow: 0 0 22px rgba(210,255,60,.08); }
.empty { text-align: center; padding: 26px 16px; }
.empty .ico-big { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 20px; background: #24243a; display: grid; place-items: center; color: var(--lime); }
.empty .ico-big .ic { width: 2.2rem; height: 2.2rem; }
.zone-actions { flex-basis: 100%; display: flex; gap: 8px; margin-top: 4px; }
.zone-actions .btn { margin: 0; }
.zone-pick { width: 100%; }

/* ----- personal routine ----- */
.cap { margin: -6px 0 12px; text-transform: capitalize; }
.who { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.who::-webkit-scrollbar { display: none; }
.who a { display: flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 2px solid var(--line); border-radius: 14px; font-weight: 800; white-space: nowrap; background: var(--card); }
.who a.on { border-color: var(--lime); background: rgba(210,255,60,.08); }
.routine { display: flex; flex-direction: column; gap: 10px; margin: 14px 0; }
.routine form { margin: 0; }
.occ { display: flex; align-items: center; gap: 14px; width: 100%; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 14px;
    color: var(--ink); font: inherit; text-align: left; cursor: pointer; transition: transform .18s var(--spring), border-color .2s, background .25s; }
.occ:active { transform: scale(.97); }
.occ .ico, .routine-row .ico { width: 48px; height: 48px; border-radius: 14px; background: #24243a; display: grid; place-items: center; flex: none; color: var(--purple); }
.occ .ico .ic, .routine-row .ico .ic { width: 1.7rem; height: 1.7rem; }
.occ strong { display: block; font-size: 1.15rem; font-weight: 800; }
.occ small { color: var(--muted); font-family: var(--mono); font-weight: 700; }
.occ .box { width: 36px; height: 36px; border-radius: 12px; }
.occ.done { border-color: rgba(210,255,60,.5); background: rgba(210,255,60,.07); }
.occ.done strong { text-decoration: line-through; text-decoration-thickness: 2px; opacity: .6; }
.occ.done .ico { background: var(--lime); color: #101300; }
.occ.done .box { background: var(--lime); border-color: var(--lime); }
.occ.done .box .ic { opacity: 1; transform: none; }
.routine-row { padding: 10px 12px; gap: 12px; }
.routine-row form { margin: 0; }
.routine-row.paused { opacity: .5; }
.routine-row .btn.small { margin: 0; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 10px 0; }
.iconpick, .daypick { display: flex; flex-wrap: wrap; gap: 8px; }
.ip, .dp { margin: 0; cursor: pointer; position: relative; }
.ip input, .dp input, .segopt input { position: absolute; opacity: 0; pointer-events: none; }
.ip span { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; border: 2px solid var(--line); background: var(--panel); color: var(--muted);
    transition: transform .18s var(--spring), border-color .2s, color .2s, background .2s; }
.ip span .ic { width: 1.6rem; height: 1.6rem; }
.ip input:checked + span { border-color: var(--lime); color: var(--lime); background: rgba(210,255,60,.08); transform: scale(1.08); }
.dp span { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; border: 2px solid var(--line); font-weight: 800; background: var(--panel);
    transition: background .2s, color .2s, border-color .2s, transform .18s var(--spring); }
.dp input:checked + span { background: var(--lime); color: #101300; border-color: var(--lime); }
.dp input:focus-visible + span, .ip input:focus-visible + span, .segopt input:focus-visible + span { outline: 3px solid var(--cyan); outline-offset: 2px; }
.seg:has(.segopt) { grid-template-columns: 1fr 1fr; }
.segopt { margin: 0; cursor: pointer; position: relative; }
.segopt span { display: block; text-align: center; padding: 11px; border-radius: 10px; font-weight: 800; transition: background .25s, color .25s; }
.segopt input:checked + span { background: var(--lime); color: #101300; }
.notif-card { display: flex; flex-direction: column; gap: 8px; }
.notif-card form { margin: 0; }

.right { margin-left: auto; }
.mt-s { margin-top: 6px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important;
        transition-duration: .01ms !important; }
    ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
    .confetti { display: none; }
}
