* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root { --blue:#2563eb; --pink:#ec4899; --green:#16a34a; --red:#dc2626; }
html, body {
  height: 100%; width: 100%; overflow: hidden;
  font-family: 'Baloo 2', 'Trebuchet MS', system-ui, sans-serif;
  background: #0b1026; color: #fff; touch-action: manipulation; user-select: none;
}
body { position: fixed; inset: 0; }

.screen {
  display: none; position: absolute; inset: 0;
  flex-direction: column; align-items: center; justify-content: flex-start;
  padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
  text-align: center; gap: 14px;
}
.screen.active { display: flex; }

.title { font-size: clamp(26px, 8vw, 44px); font-weight: 900; letter-spacing: .5px;
  text-shadow: 0 3px 0 rgba(0,0,0,.25); margin-top: 6px; }
.subtitle { font-size: clamp(15px, 4.5vw, 20px); opacity: .85; }

/* ---- Cartoes de login ---- */
.cards { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 460px; margin-top: 8px; }
.card {
  display: flex; align-items: center; gap: 16px; padding: 14px 18px;
  border-radius: 26px; border: none; cursor: pointer; width: 100%;
  background: rgba(255,255,255,.10); box-shadow: 0 8px 24px rgba(0,0,0,.35);
  transition: transform .08s; position: relative;
}
.card:active { transform: scale(.97); }
.card .pic { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; object-position: 50% 22%;
  border: 4px solid #fff; flex-shrink: 0; background: #222; }
.card .pname { font-size: clamp(24px, 7vw, 34px); font-weight: 900; color: #fff; flex: 1; text-align: left; }
.card .go { font-size: 30px; }
.card .photo-btn {
  position: absolute; top: 8px; right: 10px; font-size: 12px; font-weight: 800;
  background: rgba(0,0,0,.35); color: #fff; border: none; border-radius: 999px;
  padding: 5px 10px; cursor: pointer;
}

/* ---- Lobby ---- */
.me-badge { font-size: 22px; font-weight: 900; padding: 8px 20px; border-radius: 999px; background: rgba(255,255,255,.12); }
.lobby-list { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; }
.lobby-row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; border-radius: 20px; background: rgba(255,255,255,.08); }
.lobby-row.on { background: rgba(34,197,94,.22); }
.lobby-row .pic { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; border: 3px solid #fff; }
.lobby-row .pname { font-size: 22px; font-weight: 800; flex: 1; text-align: left; }
.lobby-row .dot { font-size: 16px; font-weight: 800; opacity: .85; }

.big-btn {
  margin-top: auto; width: 100%; max-width: 460px; border: none; cursor: pointer;
  font-size: clamp(26px, 8vw, 40px); font-weight: 900; color: #fff;
  padding: 22px; border-radius: 28px; box-shadow: 0 10px 0 rgba(0,0,0,.25);
}
.big-btn:active { transform: translateY(4px); box-shadow: 0 6px 0 rgba(0,0,0,.25); }
.big-btn.green { background: linear-gradient(#22c55e, #16a34a); }
.link-btn { background: none; border: none; color: #fff; opacity: .7; font-size: 16px; text-decoration: underline; cursor: pointer; padding: 6px; }

/* ---- Corrida ---- */
#screen-race { padding: 0; gap: 0; justify-content: flex-start; }
.zone-banner {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  z-index: 5; font-size: 20px; font-weight: 900; padding: 8px 22px; border-radius: 999px;
  background: rgba(0,0,0,.45); white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .3s;
}
.zone-banner.show { opacity: 1; }
#track { display: block; width: 100%; flex: 1; }
.countdown {
  position: absolute; inset: 0; z-index: 8; display: none;
  align-items: center; justify-content: center;
  font-size: 38vw; font-weight: 900; color: #fff;
  text-shadow: 0 6px 0 rgba(0,0,0,.35); background: rgba(0,0,0,.25);
}
.countdown.show { display: flex; }
.controls { display: flex; width: 100%; height: 30vh; min-height: 160px; gap: 0; }
.ctrl { border: none; cursor: pointer; font-weight: 900; color: #fff; touch-action: none; }
.ctrl:active { filter: brightness(1.2); }
.ctrl.dodge { flex: 0 0 22%; font-size: clamp(30px, 11vw, 56px); background: linear-gradient(#f59e0b, #d97706); }
#btn-right.dodge { background: linear-gradient(#fb923c, #ea580c); border-left: 2px solid rgba(0,0,0,.2); }
.ctrl.green { flex: 1; font-size: clamp(22px, 7vw, 40px); background: linear-gradient(#22c55e, #15803d); border-left: 3px solid rgba(0,0,0,.18); }

/* ---- Vencedor ---- */
#screen-win { justify-content: center; gap: 10px; }
.confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.trophy { font-size: 72px; }
.win-name { font-size: clamp(32px, 11vw, 60px); font-weight: 900; text-shadow: 0 3px 0 rgba(0,0,0,.25); }
.win-photo { width: 150px; height: 150px; border-radius: 50%; object-fit: cover; object-position: 50% 22%; border: 6px solid #ffd700; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.podium { display: flex; flex-direction: column; gap: 6px; font-size: 18px; opacity: .9; margin: 6px 0; }
