:root {
  --bg: #060a18; --sf: #151d3b; --sf2: #1d2750; --tx: #eef1ff; --mu: #8e98c4;
  --ac: #4f7dff; --ok: #35dfa3; --no: #ff5a78; --gold: #ffd98a;
  color-scheme: dark; box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); }
html, body { color: var(--tx); font-family: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif; min-height: 100%; }
body {
  background:
    radial-gradient(900px 520px at 90% -8%, rgba(79, 125, 255, .38), transparent 62%),
    radial-gradient(700px 520px at -15% 35%, rgba(139, 92, 255, .26), transparent 62%),
    radial-gradient(600px 400px at 60% 110%, rgba(255, 196, 102, .12), transparent 60%),
    var(--bg);
  background-attachment: fixed; transition: background .4s ease;
}
body.boss {
  background:
    radial-gradient(900px 520px at 85% -5%, rgba(168, 85, 247, .45), transparent 60%),
    radial-gradient(700px 520px at -10% 35%, rgba(245, 158, 11, .28), transparent 62%),
    radial-gradient(600px 400px at 50% 110%, rgba(255, 90, 120, .18), transparent 60%),
    var(--bg);
}
#app { max-width: 480px; margin: 0 auto; padding: 20px 18px 40px; }
h1 {
  font-size: 3.4rem; font-weight: 800; line-height: 1; letter-spacing: -.055em;
  background: linear-gradient(120deg, #fff 15%, #a9c0ff 55%, #caa8ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 6px 30px rgba(110, 140, 255, .45));
}
h2 { font-size: 1.5rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
p { line-height: 1.5; }
.mu { color: var(--mu); }
.row { display: flex; gap: 10px; }
.sp { justify-content: space-between; align-items: center; }
.stat, .res, pre, .card {
  background: linear-gradient(160deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .025));
  border: 1px solid rgba(255, 255, 255, .11);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-radius: 18px;
}
.stat { flex: 1; padding: 14px; }
.stat b { display: block; font-size: 1.5rem; background: linear-gradient(180deg, #fff, var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card { padding: 14px 16px; margin-top: 10px; }
.urgent { border-color: rgba(255, 180, 70, .65); box-shadow: 0 0 24px rgba(255, 170, 60, .25), inset 0 1px 0 rgba(255, 217, 138, .25); animation: pulse 2.2s infinite; }
.urgent-txt { color: var(--gold); font-size: .85rem; font-weight: 600; margin-top: 6px; }
.dots { display: flex; gap: 6px; margin-top: 10px; }
.dot { flex: 1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .1); }
.dot.on { background: linear-gradient(90deg, #ff9a5a, #ffd98a); box-shadow: 0 0 10px rgba(255, 180, 90, .6); }
.teaser { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-style: dashed; border-color: rgba(169, 192, 255, .3); }
.teaser b { color: #eef1ff; font-size: 1rem; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 99px; font-size: .8rem; font-weight: 700; background: rgba(255, 255, 255, .09); border: 1px solid rgba(255, 255, 255, .14); }
.pill.gold { background: rgba(255, 217, 138, .16); border-color: rgba(255, 217, 138, .45); color: var(--gold); }
.pill.boss { background: linear-gradient(135deg, rgba(168, 85, 247, .35), rgba(245, 158, 11, .3)); border-color: rgba(255, 217, 138, .5); color: #fff; letter-spacing: .04em; text-transform: uppercase; font-size: .72rem; }
.m-row { margin-top: 8px; }
.m-top { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: 4px; }
.m-bar { height: 6px; border-radius: 99px; background: rgba(255, 255, 255, .09); overflow: hidden; }
.m-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #5b86ff, #35dfa3); }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--ac); outline-offset: 2px; }
.icon-btn { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); border-radius: 12px; padding: 8px 12px; font-size: .85rem; color: var(--mu); }
.cta { width: 100%; background: linear-gradient(135deg, #5b86ff, #8a5bff); color: #fff; font-weight: 700; font-size: 1.1rem; padding: 18px; border-radius: 18px; margin-top: 18px; letter-spacing: .01em; box-shadow: 0 12px 34px rgba(100, 110, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .3); }
.cta:active { transform: scale(.985); }
.ghost { background: none; color: #7d88b8; text-decoration: underline; font-size: .85rem; margin-top: 14px; }
.ghost.warn { color: var(--no); font-weight: 700; }
.ringw { position: relative; width: 176px; height: 176px; margin: 14px auto 6px; }
.ringw svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.rt { fill: none; stroke: rgba(255, 255, 255, .09); stroke-width: 7; }
.rf { fill: none; stroke: #7f9cff; stroke-width: 7; stroke-linecap: round; stroke-dasharray: 339.292; stroke-dashoffset: 0; filter: drop-shadow(0 0 7px rgba(120, 150, 255, .95)); }
.rf.hot { stroke: #ffd98a; filter: drop-shadow(0 0 9px rgba(255, 200, 90, .95)); }
.rf.low { stroke: #ff6a73; filter: drop-shadow(0 0 7px rgba(255, 90, 110, .95)); }
.clock { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 4.8rem; font-weight: 800; letter-spacing: -.05em; line-height: 1; font-variant-numeric: tabular-nums; text-shadow: 0 0 44px rgba(90, 130, 255, .65); }
.opt { position: relative; display: block; width: 100%; text-align: left; background: linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03)); border: 1px solid rgba(255, 255, 255, .13); border-radius: 16px; padding: 18px; font-size: 1.05rem; font-weight: 500; margin-top: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.opt:not(:disabled):active { transform: scale(.985); border-color: #7f9cff; box-shadow: 0 0 0 3px rgba(100, 130, 255, .3); }
.opt.ok { background: linear-gradient(160deg, rgba(53, 223, 163, .3), rgba(53, 223, 163, .1)); border-color: var(--ok); box-shadow: 0 0 26px rgba(53, 223, 163, .5); animation: pop .35s ease-out; }
.opt.no { background: linear-gradient(160deg, rgba(255, 90, 120, .3), rgba(255, 90, 120, .1)); border-color: var(--no); box-shadow: 0 0 26px rgba(255, 90, 120, .45); }
.opt.dim { opacity: .45; }
.opt.picked { border-color: #7f9cff; box-shadow: 0 0 0 3px rgba(100, 130, 255, .3); }
.cta:disabled { opacity: .55; }
.float-pts { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-weight: 800; font-size: .95rem; color: var(--ok); pointer-events: none; animation: rise 1.1s ease-out forwards; }
.float-pts span { color: var(--gold); font-weight: 700; margin-left: 4px; font-size: .82rem; }
.big { font-size: 5.4rem; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; background: linear-gradient(180deg, #fff 10%, var(--gold) 60%, #f0a63a); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 8px 34px rgba(255, 190, 90, .45)); }
.tier-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.near-miss { margin-top: 8px; font-size: .9rem; color: var(--gold); }
.res { padding: 14px; margin-top: 10px; }
.res b.ok { color: var(--ok); }
.res b.no { color: var(--no); }
.res small { display: block; color: var(--mu); margin-top: 6px; line-height: 1.45; }
pre { white-space: pre-wrap; padding: 12px; margin-top: 10px; font: inherit; font-size: .95rem; }
.wa { width: 100%; background: linear-gradient(135deg, #25d366, #128c7e); color: #06210f; font-weight: 700; font-size: 1.05rem; padding: 16px; border-radius: 18px; box-shadow: 0 12px 30px rgba(37, 211, 102, .35), inset 0 1px 0 rgba(255, 255, 255, .35); }
.wa:active, .more:active { transform: scale(.985); }
.more { width: 100%; margin-top: 10px; padding: 14px; border-radius: 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .13); font-weight: 500; }
.inv { margin-top: 12px; }
.rival { display: block; width: 100%; text-align: left; border-color: rgba(255, 217, 138, .35); }
.rival b { display: block; margin: 3px 0; font-size: 1rem; }
.join { border-color: rgba(53, 223, 163, .45); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.fld { display: block; margin-top: 10px; }
.fld span { display: block; font-size: .78rem; margin-bottom: 4px; }
.fld input { width: 100%; background: rgba(255, 255, 255, .06); color: var(--tx); border: 1px solid rgba(255, 255, 255, .16); border-radius: 12px; padding: 12px; font: inherit; font-size: 1rem; }
.fld input:focus { outline: 2px solid var(--ac); border-color: transparent; }
.more.sm, .ghost.sm { width: auto; flex: 1; margin-top: 0; }
.more.sm:disabled { opacity: .55; }
.err { color: var(--no); font-size: .85rem; margin-top: 6px; }
.err:empty { display: none; }
.tabs { display: flex; gap: 6px; margin-top: 14px; padding: 4px; border-radius: 14px; background: rgba(255, 255, 255, .06); }
.tabs button { flex: 1; padding: 10px; border-radius: 10px; background: none; color: var(--mu); font-weight: 700; font-size: .9rem; }
.tabs button.on { background: var(--sf2); color: var(--tx); box-shadow: 0 4px 14px rgba(0, 0, 0, .3); }
.lb { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.lb:last-of-type { border-bottom: 0; }
.lb.me { color: var(--gold); }
.lb .rk { width: 2.2rem; text-align: center; font-weight: 800; }
.lb .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; font-weight: 600; }
.lb .nm i { font-style: normal; color: var(--mu); font-weight: 500; }
.lb small { display: block; color: var(--mu); font-size: .78rem; font-weight: 500; letter-spacing: .05em; margin-top: 2px; }
.lb b { font-variant-numeric: tabular-nums; white-space: nowrap; }
#sheet { position: fixed; inset: 0; z-index: 20; background: rgba(4, 7, 18, .72); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); display: flex; align-items: flex-end; justify-content: center; }
.sc { width: 100%; max-width: 480px; background: #121a38; border: 1px solid rgba(255, 255, 255, .12); border-radius: 24px 24px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom, 0px)); }
.sc textarea { width: 100%; margin: 12px 0; background: rgba(255, 255, 255, .06); color: var(--tx); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 12px; font: inherit; font-size: .95rem; resize: none; }
.lk { display: block; text-align: center; text-decoration: none; }
@keyframes pop { 0% { transform: scale(.97); } 60% { transform: scale(1.025); } 100% { transform: scale(1); } }
@keyframes rise { 0% { opacity: 0; transform: translateY(-20%); } 25% { opacity: 1; transform: translateY(-70%); } 100% { opacity: 0; transform: translateY(-160%); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 18px rgba(255, 170, 60, .2); } 50% { box-shadow: 0 0 30px rgba(255, 170, 60, .48); } }
@media (prefers-reduced-motion: no-preference) { .rf { transition: stroke-dashoffset .1s linear; } }
@media (prefers-reduced-motion: reduce) { .opt.ok, .urgent, .float-pts { animation: none; } }
