:root {
  --red: #DA291C;
  --red-dark: #A91F14;
  --red-soft: #FDECEA;
  --ink: #16162B;
  --text: #2B2B3A;
  --muted: #6D6D7C;
  --line: #ECE7E4;
  --bg: #F6F4F2;
  --card: #FFFFFF;
  --green: #23945A;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(22,22,43,.06), 0 8px 24px rgba(22,22,43,.07);
  --tabbar-h: 68px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 500;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  overflow-x: hidden;
}
img { max-width: 100%; }
a { color: var(--red); }
h1, h2, h3 { color: var(--ink); font-weight: 800; letter-spacing: -0.02em; line-height: 1.12; margin: 0 0 .4em; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4.6vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h3 { font-size: 1.1rem; }
.red { color: var(--red); }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .72rem; font-weight: 700; color: var(--red); margin: 0 0 .5rem; }
.lead { color: var(--muted); font-size: 1rem; margin: 0 0 1.2rem; max-width: 60ch; }
.note { color: var(--muted); font-size: .85rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: rgba(255,255,255,.92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); margin-right: auto; min-width: 0; }
.brand img { height: 34px; width: auto; display: block; }
.brand-text { font-size: .7rem; line-height: 1.15; border-left: 2px solid var(--line); padding-left: 10px; color: var(--muted); }
.brand-text b { color: var(--ink); font-weight: 800; }
.points-chip { background: var(--red-soft); color: var(--red); font-weight: 800; border-radius: 999px; padding: 6px 12px; text-decoration: none; font-size: .85rem; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 13px 22px; min-height: 46px;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none;
  transition: transform .12s ease, background .15s ease, box-shadow .15s ease;
}
.btn:active { transform: scale(.97); }
.btn:focus-visible, .pedal:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid rgba(218,41,28,.35); outline-offset: 2px; }
.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 16px rgba(218,41,28,.28); }
.btn-red:hover { background: var(--red-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { padding: 8px 16px; min-height: 36px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.link { background: none; border: 0; color: var(--muted); text-decoration: underline; font: inherit; cursor: pointer; }

/* ---------- views ---------- */
main { min-height: 70vh; }
.view { padding: 22px 16px 32px; animation: viewIn .35s ease; }
.narrow { max-width: 600px; margin: 0 auto; }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.section-title { margin-top: 28px; }

/* ---------- game ---------- */
.view-game { max-width: 1120px; margin: 0 auto; padding-top: 14px; }
.view-game h1 { margin-bottom: .25em; }
.view-game .lead { margin-bottom: 0; }
@media (max-height: 760px), (max-width: 600px) { .view-game .eyebrow, .view-game .lead { display: none; } }
@media (max-width: 600px) { .view-game h1 { font-size: 1.45rem; } .view-game { padding-top: 10px; } .pedals { margin-top: 12px; } }
.game-head { text-align: center; margin-bottom: 14px; }
.game-head .lead { margin: 0 auto; }
.stage {
  position: relative; width: 100%; height: clamp(250px, calc(100svh - 370px), 480px);
  border-radius: 24px; overflow: hidden; background: #dfe3e6;
  box-shadow: var(--shadow); touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hud { position: absolute; left: 0; right: 0; top: 0; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.hud-days { list-style: none; margin: 0; padding: 6px 8px; display: flex; gap: 4px; background: rgba(255,255,255,.88); border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.hud-days li { font-size: .62rem; font-weight: 800; color: var(--muted); padding: 4px 7px; border-radius: 999px; white-space: nowrap; transition: all .25s; }
.hud-days li.done { background: var(--green); color: #fff; }
.hud-days li.now { background: var(--red); color: #fff; }
.hud-stats { font-size: .72rem; font-weight: 700; color: var(--ink); background: rgba(255,255,255,.8); padding: 4px 12px; border-radius: 999px; }
.hud-stats .dot { margin: 0 6px; color: var(--muted); }
.hint {
  position: absolute; left: 50%; top: 32%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: .85rem; text-align: center; padding: 10px 16px; border-radius: 14px;
  animation: pulse 1.6s ease-in-out infinite; pointer-events: none; transition: opacity .4s;
}
.hint.gone { opacity: 0; }
@keyframes pulse { 50% { transform: translateX(-50%) scale(1.05); } }
.pedals { display: grid; grid-template-columns: 1fr minmax(90px, 220px) 1fr; gap: 12px; align-items: center; margin: 16px auto 8px; max-width: 640px; }
.pedal {
  height: 84px; border-radius: 22px; border: 0; cursor: pointer;
  background: var(--red); color: #fff; font: inherit; font-weight: 900; font-size: 1.15rem; letter-spacing: .06em;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  box-shadow: 0 7px 0 var(--red-dark), 0 12px 22px rgba(218,41,28,.25);
  transition: transform .06s, box-shadow .06s; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.pedal svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pedal.press, .pedal:active { transform: translateY(6px); box-shadow: 0 1px 0 var(--red-dark), 0 4px 10px rgba(218,41,28,.2); }
.pedal.wrong { animation: shake .25s; }
@keyframes shake { 25% { translate: -4px 0; } 75% { translate: 4px 0; } }
.pedal-mid { text-align: center; }
.pedal-mid small { font-size: .68rem; color: var(--muted); }
@media (hover: none) { .pedal-mid small { display: none; } }
.speed { height: 10px; background: #e6e1de; border-radius: 99px; overflow: hidden; margin-bottom: 6px; }
.speed-bar { height: 100%; width: 0; background: linear-gradient(90deg, #f5a623, var(--red)); border-radius: 99px; transition: width .1s linear; }
.game-links { text-align: center; font-size: .9rem; color: var(--muted); margin-top: 10px; }
.game-links a { font-weight: 700; }
.game-links span { margin: 0 6px; }

/* ---------- sheet (station card) ---------- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(22,22,43,.45); z-index: 40; animation: fade .25s; }
.sheet {
  position: fixed; z-index: 41; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(620px, 100%); max-height: 88vh; overflow: auto;
  background: #fff; border-radius: 26px 26px 0 0; box-shadow: 0 -10px 40px rgba(0,0,0,.2);
  animation: up .35s cubic-bezier(.2,.9,.3,1.2);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 700px) { .sheet { bottom: 50%; transform: translate(-50%, 50%); border-radius: 26px; animation: pop .3s ease; } }
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, 54%) scale(.96); } }
@keyframes fade { from { opacity: 0; } }
.sheet-body { padding: 22px 20px 20px; }
.day-pill { display: inline-flex; align-items: center; gap: 8px; background: var(--red); color: #fff; font-weight: 800; border-radius: 999px; padding: 6px 14px; font-size: .9rem; margin-bottom: 12px; }
.sheet h3.theme { font-size: 1.5rem; text-transform: uppercase; margin-bottom: 14px; }
.ev { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.ev h4 { margin: 0 0 4px; color: var(--red); font-size: 1rem; font-weight: 800; }
.ev p { margin: 0 0 8px; font-size: .88rem; color: var(--text); }
.meta { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--ink); font-weight: 600; }
.meta span { display: flex; gap: 8px; align-items: flex-start; }
.meta svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; fill: none; stroke: var(--red); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.chip-teams { display: inline-block; background: var(--red-soft); color: var(--red); font-weight: 700; font-size: .72rem; border-radius: 999px; padding: 3px 10px; margin-top: 6px; }
.pts-note { display: flex; align-items: center; gap: 10px; background: #F1FAF4; color: #17603b; border-radius: 14px; padding: 10px 14px; font-size: .85rem; font-weight: 600; margin: 12px 0 16px; }
.pts-note b { font-size: 1.1rem; }
.sheet .btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet .btn-row .btn { flex: 1 1 180px; }
.finish-art { display: flex; gap: 12px; margin: 12px 0; }
.finish-art .ev { flex: 1; margin: 0; }

/* ---------- agenda ---------- */
.agenda { display: flex; flex-direction: column; gap: 16px; }
.day-block { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.day-block h3 { text-transform: uppercase; font-size: 1.05rem; margin: 6px 0 12px; }
.day-block .ev:last-child { margin-bottom: 0; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; font-weight: 700; color: var(--ink); }
.form input[type=text], .form input:not([type]), .form input[type=email] {
  font: inherit; font-weight: 500; font-size: 1rem; padding: 13px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; color: var(--ink); width: 100%;
}
.form input:focus { border-color: var(--red); outline: none; }
.form .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; color: var(--text); }
.form .check input { width: 20px; height: 20px; accent-color: var(--red); flex: 0 0 20px; margin-top: 1px; }
.form-error { color: var(--red); font-size: .85rem; font-weight: 600; margin: 0; min-height: 0; }
.form-error:empty { display: none; }
.subtle { background: #fff; box-shadow: none; border: 1.5px dashed var(--line); }
.subtle p { margin: 0; font-size: .9rem; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; min-width: 0; }
.otp { font: inherit; font-size: 2rem; font-weight: 800; letter-spacing: .5em; text-align: center; padding: 14px 8px 14px calc(8px + .5em); border-radius: 14px; border: 2px solid var(--line); width: 100%; color: var(--ink); }
.otp:focus { border-color: var(--red); outline: none; }

/* ---------- badge ---------- */
.badge {
  position: relative; width: min(360px, 100%); margin: 26px auto 18px; background: #fff; border-radius: 22px; overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 24px 50px rgba(22,22,43,.16);
  animation: swing 1.2s ease;
  transform-origin: top center;
}
@keyframes swing { 0% { transform: rotate(-6deg); } 40% { transform: rotate(4deg); } 70% { transform: rotate(-2deg); } 100% { transform: none; } }
.badge::before { content: ""; position: absolute; top: 12px; left: 50%; width: 54px; height: 10px; margin-left: -27px; border-radius: 99px; background: var(--bg); box-shadow: inset 0 1px 3px rgba(0,0,0,.18); }
.badge-top { padding: 34px 22px 14px; text-align: center; }
.badge-top img { height: 40px; width: auto; }
.badge-event { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-top: 6px; }
.badge-band { background: var(--red); color: #fff; text-align: center; padding: 18px 18px 16px; position: relative; overflow: hidden; }
.badge-band::after { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.1); }
.badge-name { font-size: 1.55rem; font-weight: 900; line-height: 1.1; margin: 0; color: #fff; letter-spacing: -0.02em; }
.badge-pos { font-size: .92rem; font-weight: 600; opacity: .95; margin-top: 6px; }
.badge-role { display: inline-block; margin-top: 10px; background: #fff; color: var(--red); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; padding: 4px 12px; border-radius: 999px; }
.badge-bottom { display: flex; align-items: center; gap: 14px; padding: 16px 20px 20px; }
.badge-qr { width: 112px; height: 112px; flex: 0 0 112px; border: 1.5px solid var(--line); border-radius: 12px; padding: 6px; }
.badge-qr svg, .badge-qr img { width: 100%; height: 100%; display: block; }
.badge-meta { font-size: .78rem; color: var(--muted); }
.badge-code { font-size: 1.15rem; font-weight: 900; color: var(--ink); letter-spacing: .04em; }
.badge-company { font-weight: 700; color: var(--ink); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border-radius: 16px; padding: 14px 10px; text-align: center; box-shadow: var(--shadow); }
.stat b { display: block; font-size: 1.5rem; font-weight: 900; color: var(--ink); }
.stat span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 8px 0 16px; }
.history { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.history li { background: #fff; border-radius: 14px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; box-shadow: var(--shadow); }
.history li b { color: var(--green); white-space: nowrap; }
.history .empty { color: var(--muted); justify-content: center; text-align: center; }

/* ---------- scanner ---------- */
.scanner { position: relative; padding: 0; overflow: hidden; aspect-ratio: 1 / 1; background: #111; max-width: 420px; margin: 0 auto 10px; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 18%; border: 3px solid rgba(255,255,255,.9); border-radius: 22px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scan-msg { position: absolute; left: 0; right: 0; bottom: 14px; text-align: center; color: #fff; font-weight: 700; font-size: .9rem; padding: 0 16px; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.result { text-align: center; }
.result.ok { border-top: 6px solid var(--green); }
.result.bad { border-top: 6px solid var(--red); }
.result .big { font-size: 2.6rem; font-weight: 900; color: var(--green); margin: 0; }

/* ---------- ranking ---------- */
.podium { display: grid; grid-template-columns: 1fr 1.1fr 1fr; align-items: end; gap: 8px; margin: 14px 0 16px; }
.pod { text-align: center; }
.pod .av { width: 52px; height: 52px; margin: 0 auto 6px; border-radius: 50%; background: var(--red-soft); color: var(--red); display: grid; place-items: center; font-weight: 900; font-size: 1.1rem; border: 3px solid #fff; box-shadow: var(--shadow); }
.pod .nm { font-size: .78rem; font-weight: 700; color: var(--ink); line-height: 1.2; min-height: 2.4em; overflow: hidden; }
.pod .bar { margin-top: 6px; border-radius: 14px 14px 0 0; background: var(--red); color: #fff; font-weight: 900; padding: 10px 4px; }
.pod.p1 .bar { height: 120px; background: linear-gradient(180deg, #F2B705, #D99A00); }
.pod.p2 .bar { height: 90px; background: linear-gradient(180deg, #B9BEC6, #8E949E); }
.pod.p3 .bar { height: 70px; background: linear-gradient(180deg, #D98D4E, #B36A2E); }
.pod .bar small { display: block; font-size: .65rem; opacity: .9; }
.ranklist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ranklist li, .rank-me { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; background: #fff; border-radius: 14px; padding: 10px 14px; box-shadow: var(--shadow); font-size: .9rem; }
.ranklist .pos { font-weight: 900; color: var(--muted); }
.ranklist .who b { display: block; color: var(--ink); font-weight: 700; }
.ranklist .who small { color: var(--muted); font-size: .75rem; }
.ranklist .pts { font-weight: 900; color: var(--red); }
.ranklist li.me, .rank-me { outline: 2px solid var(--red); }
.rank-me { margin-top: 12px; }
.empty-state { text-align: center; color: var(--muted); padding: 24px; background: #fff; border-radius: 16px; }

/* ---------- prizes ---------- */
.ribbon { background: #FFF7E0; color: #8a5a00; font-weight: 600; border-radius: 12px; padding: 10px 14px; font-size: .85rem; }
.prizes { display: grid; gap: 12px; }
.prize { display: flex; gap: 14px; align-items: center; background: #fff; border-radius: 18px; padding: 16px; box-shadow: var(--shadow); }
.prize .medal { width: 56px; height: 56px; flex: 0 0 56px; border-radius: 16px; background: var(--red-soft); display: grid; place-items: center; }
.prize .medal svg { width: 30px; height: 30px; fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.prize small { color: var(--red); font-weight: 800; text-transform: uppercase; font-size: .7rem; letter-spacing: .08em; }
.prize h4 { margin: 2px 0; color: var(--ink); font-size: 1.05rem; }
.prize p { margin: 0; color: var(--muted); font-size: .85rem; }

/* ---------- prose ---------- */
.prose h3 { margin-top: 1.4em; }
.prose p, .prose li { font-size: .92rem; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--muted); font-size: .66rem; font-weight: 700; }
.tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.active { color: var(--red); }
.tabbar .tab-scan svg { width: 50px; height: 50px; padding: 12px; margin-top: -24px; border-radius: 50%; background: var(--red); color: #fff; stroke: #fff; box-shadow: 0 6px 16px rgba(218,41,28,.35); border: 4px solid #fff; }
.tabbar .tab-scan { color: var(--ink); }

/* ---------- toast & confetti ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: .9rem; font-weight: 600; opacity: 0; pointer-events: none; transition: all .3s; z-index: 60; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }

@media (max-width: 420px) {
  .brand-text { display: none; }
  .pedal { height: 76px; }
  .hud-days li { padding: 3px 5px; font-size: .56rem; }
}
@media (min-width: 900px) {
  .stage { height: clamp(240px, calc(100svh - 480px), 480px); }
  .tabbar { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 520px; border-radius: 22px; border: 1px solid var(--line); box-shadow: var(--shadow); height: 64px; padding-bottom: 0; }
  body { padding-bottom: 100px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- avatar animado ---------- */
.badge.has-avatar .badge-top { padding-bottom: 8px; }
.badge.has-avatar .badge-band { padding-top: 66px; margin-top: -56px; }
.badge-avatar {
  position: relative; z-index: 2; width: 112px; height: 112px; margin: 0 auto; border-radius: 50%;
  border: 5px solid #fff; background: var(--red-soft); box-shadow: 0 6px 18px rgba(22,22,43,.22);
  display: grid; place-items: center; isolation: isolate;
  animation: avatarFloat 3.2s ease-in-out infinite;
}
.badge-avatar::before {
  content: ""; position: absolute; inset: -11px; border-radius: 50%; z-index: -1;
  background: conic-gradient(var(--red), #F5B700, var(--green), var(--red));
  -webkit-mask: radial-gradient(circle, transparent 60px, #000 61px); mask: radial-gradient(circle, transparent 60px, #000 61px);
  animation: avatarSpin 6s linear infinite;
}
.badge-avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; display: block; }
.badge-avatar span { font-weight: 900; font-size: 2rem; color: var(--red); }
.badge-avatar.empty::before { opacity: .35; }
.badge-avatar.working img { filter: grayscale(1) blur(1px); animation: avatarScan 0.9s ease-in-out infinite; }
.badge-avatar.working::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(218,41,28,.55) 48%, transparent 52%);
  background-size: 100% 220%; animation: avatarSweep .9s linear infinite;
}
.badge-avatar.reveal img { animation: avatarReveal 1s cubic-bezier(.2,.9,.3,1.3); }
@keyframes avatarFloat { 50% { transform: translateY(-4px) rotate(-1.5deg); } }
@keyframes avatarSpin { to { transform: rotate(360deg); } }
@keyframes avatarSweep { from { background-position: 0 120%; } to { background-position: 0 -120%; } }
@keyframes avatarScan { 50% { opacity: .7; } }
@keyframes avatarReveal {
  0% { clip-path: circle(0% at 50% 50%); transform: scale(.6) rotate(-20deg); filter: saturate(3) brightness(1.4); }
  60% { clip-path: circle(60% at 50% 50%); transform: scale(1.08) rotate(4deg); }
  100% { clip-path: circle(75% at 50% 50%); transform: none; filter: none; }
}
.avatar-tools { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; text-align: center; align-items: center; }
.avatar-tools b { color: var(--ink); }
.avatar-tools .note { margin: 4px 0 0; }
.avatar-styles { display: inline-flex; background: var(--bg); border-radius: 999px; padding: 4px; gap: 4px; }
.avatar-styles button { border: 0; background: transparent; font: inherit; font-weight: 700; font-size: .82rem; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--muted); }
.avatar-styles button[aria-checked="true"] { background: #fff; color: var(--red); box-shadow: 0 1px 4px rgba(0,0,0,.1); }
.avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.avatar-actions label { cursor: pointer; }
.avatar-status:empty { display: none; }

/* ---------- Teams y calendario ---------- */
.ev-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn-teams, .ev-cal { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 7px 13px; font-size: .8rem; font-weight: 700; text-decoration: none; }
.btn-teams { background: #5B5FC7; color: #fff; }
.btn-teams svg { width: 16px; height: 16px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }
.ev-cal { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.ev-cal svg { width: 16px; height: 16px; fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ev-cal:hover { border-color: var(--ink); }
.cal-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-top: 8px; }
.cal-card > div { flex: 1 1 240px; }
.cal-card .note { margin: 4px 0 0; }

/* ---------- crédito Startin ---------- */
.startin-credit {
  position: fixed; z-index: 34; right: 12px; bottom: calc(var(--tabbar-h) + 10px + env(safe-area-inset-bottom));
  font-size: .68rem; font-weight: 600; color: var(--muted); text-decoration: none;
  background: rgba(255,255,255,.88); backdrop-filter: blur(6px);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; line-height: 1.2;
  opacity: .85; transition: opacity .2s, color .2s;
}
.startin-credit b { color: var(--ink); font-weight: 800; letter-spacing: -.01em; }
.startin-credit:hover { opacity: 1; color: var(--ink); }
@media (min-width: 900px) { .startin-credit { bottom: 16px; right: 16px; } }
body:not(:has(.tabbar)) .startin-credit { bottom: 16px; }

/* ---------- tarjeta de estación compacta en celular (sin scroll) ---------- */
@media (max-width: 600px) {
  .sheet { max-height: 92svh; }
  .sheet-body { padding: 14px 14px 12px; }
  .sheet .day-pill { font-size: .72rem; padding: 4px 11px; margin-bottom: 6px; }
  .sheet h3.theme { font-size: 1.12rem; margin-bottom: 10px; }
  .sheet .ev { padding: 9px 12px; margin-bottom: 7px; border-radius: 14px; }
  .sheet .ev h4 { font-size: .9rem; margin-bottom: 2px; }
  .sheet .ev p { font-size: .78rem; line-height: 1.35; margin-bottom: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .sheet .meta { flex-direction: row; flex-wrap: wrap; gap: 2px 10px; font-size: .72rem; }
  .sheet .meta svg { width: 13px; height: 13px; flex-basis: 13px; margin-top: 1px; }
  .sheet .chip-teams { font-size: .66rem; padding: 2px 8px; margin-top: 4px; }
  .sheet .ev-links { margin-top: 6px; }
  .sheet .ev-cal { display: none; }
  .sheet .btn-teams { font-size: .72rem; padding: 5px 10px; }
  .sheet .pts-note { font-size: .74rem; padding: 7px 10px; margin: 8px 0 10px; border-radius: 12px; }
  .sheet .pts-note svg { width: 18px; height: 18px; flex: 0 0 18px; }
  .sheet .btn { min-height: 44px; padding: 10px 16px; font-size: .9rem; }
  .sheet .btn-row { gap: 8px; }
  .sheet .btn-row .btn { flex-basis: 140px; }
  .sheet .finish-art { margin: 6px 0; gap: 0; display: block; }
  .sheet .finish-art .ev { margin-bottom: 7px; }
  .sheet p.center.note { margin: 6px 0 0; }
}
