/* Fonte do jogo (Baloo 2, licenca OFL em assets/fonts): fica no pacote, sem chamada ao Google Fonts. */
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 700; font-display: swap; src: url(./assets/fonts/baloo-2-latin-ext-700.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 700; font-display: swap; src: url(./assets/fonts/baloo-2-latin-700.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 800; font-display: swap; src: url(./assets/fonts/baloo-2-latin-ext-800.woff2) format('woff2'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 800; font-display: swap; src: url(./assets/fonts/baloo-2-latin-800.woff2) format('woff2'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }

:root {
  --bg: #0a0e2c;
  --panel: rgba(18, 22, 66, 0.92);
  --edge: rgba(255, 255, 255, 0.14);
  --text: #ffffff;
  --dim: #9aa3d8;
  --gold: #ffd84a;
  --spark: #fff36b;
  --primary-top: #6dff8e;
  --primary-bot: #18b85a;
  --primary-edge: #0c7a3a;
  --font: 'Baloo 2', 'Nunito', 'Fredoka', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  overscroll-behavior: none;
}

canvas#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s;
  background: radial-gradient(ellipse at center, rgba(10, 12, 44, 0.55), rgba(4, 4, 20, 0.85));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 10;
}

.overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

#title { background: radial-gradient(ellipse at center 40%, rgba(10, 12, 44, 0.35), rgba(4, 4, 20, 0.88)); }
#adcover { z-index: 30; background: rgba(0, 0, 0, 0.92); }

.title-wrap, .panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(380px, 100%);
}

.panel {
  padding: 26px 22px 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(36, 42, 110, 0.96), var(--panel));
  border: 2px solid var(--edge);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55), inset 0 2px 0 rgba(255, 255, 255, 0.12);
  transform: translateY(30px) scale(0.92);
  transition: transform 0.45s cubic-bezier(0.2, 1.6, 0.4, 1);
  position: relative;
}

.overlay.show .panel { transform: none; }

h2 {
  margin: 0 0 4px;
  font-size: clamp(26px, 8vw, 34px);
  text-align: center;
  text-wrap: balance;
  font-weight: 900;
  letter-spacing: 0.5px;
  text-shadow: 0 3px 0 rgba(0, 0, 0, 0.35);
}

.logo {
  margin: 0 0 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 0.88;
  font-weight: 900;
  font-size: clamp(56px, 17vw, 96px);
  letter-spacing: 2px;
}

.jelly-logo { display: block; max-width: 100%; cursor: pointer; touch-action: manipulation; }

@keyframes drop {
  to { opacity: 1; transform: none; }
}
@keyframes bob {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -5px; }
}
@keyframes zapIn {
  from { opacity: 0; transform: scale(0) rotate(-40deg); }
  to { opacity: 1; transform: none; }
}
@keyframes flicker {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: 0.3; }
  96% { opacity: 1; }
  97% { opacity: 0.5; }
}

.tagline {
  margin: 4px 0 14px;
  color: var(--dim);
  font-weight: 700;
  font-size: 18px;
  text-align: center;
}

.btn {
  font-family: var(--font);
  font-weight: 900;
  font-size: 20px;
  color: #fff;
  border: 0;
  border-radius: 18px;
  padding: 12px 22px;
  min-width: 220px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  background: linear-gradient(180deg, #4b56b8, #2d3584);
  box-shadow: 0 6px 0 #1a1f5a, 0 10px 20px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.08s ease, box-shadow 0.08s ease, filter 0.15s;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  max-width: 100%;
}

.btn svg { width: 22px; height: 22px; }

.btn:hover { filter: brightness(1.08); }

.btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #1a1f5a, 0 3px 8px rgba(0, 0, 0, 0.35), inset 0 2px 0 rgba(255, 255, 255, 0.25);
}

.btn.big {
  font-size: clamp(22px, 7vw, 30px);
  padding: 16px 30px;
  min-width: 250px;
  border-radius: 22px;
}

.btn.big svg { width: 30px; height: 30px; }

.btn.primary {
  background: linear-gradient(180deg, var(--primary-top), var(--primary-bot));
  box-shadow: 0 7px 0 var(--primary-edge), 0 14px 28px rgba(0, 200, 90, 0.3), inset 0 3px 0 rgba(255, 255, 255, 0.45);
}

.btn.primary:active {
  box-shadow: 0 2px 0 var(--primary-edge), 0 4px 10px rgba(0, 200, 90, 0.3), inset 0 3px 0 rgba(255, 255, 255, 0.45);
}

#title .btn.primary { animation: breathe 1.6s ease-in-out infinite; }

@keyframes breathe {
  0%, 100% { scale: 1; }
  50% { scale: 1.05; }
}

.btn.ad {
  background: linear-gradient(180deg, #ffe45c, #ff9a2e);
  color: #3a1d00;
  text-shadow: none;
  box-shadow: 0 6px 0 #b45c00, 0 10px 20px rgba(255, 160, 0, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.5);
  font-size: 17px;
  /* "play" do icone de anuncio: o retangulo usa a cor do texto (marrom); o triangulo precisa contrastar com ele */
  --ad-glyph: #ffe45c;
}

.btn.link {
  background: none;
  box-shadow: none;
  color: #ffffff;
  font-size: 17px;
  min-width: 0;
  padding: 6px 12px;
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.45);
  text-underline-offset: 4px;
}

.btn.link:active { transform: translateY(2px); box-shadow: none; }

.btn[hidden] { display: none; }

.best-line {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-weight: 800;
  font-size: 22px;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4);
}

.best-line svg { width: 24px; height: 24px; filter: drop-shadow(0 0 6px #ff9a00); }

.toggles {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.icon-btn {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 2px solid var(--edge);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.08s, background 0.15s;
}

.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 26px; height: 26px; }
.icon-btn .off { display: none; }
.icon-btn.is-off { color: var(--dim); background: rgba(0, 0, 0, 0.2); }
.icon-btn.is-off .off { display: inline; }
.icon-btn.is-off .on { display: none; }

.label {
  color: var(--dim);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 15px;
}

.big-score {
  font-size: 64px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.35), 0 0 30px rgba(140, 170, 255, 0.5);
  margin-bottom: 4px;
}

.ribbon {
  position: absolute;
  top: -22px;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe45c, #ff9a2e);
  color: #3a1d00;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 5px 0 #b45c00, 0 0 30px rgba(255, 200, 0, 0.6);
}

.ribbon svg { width: 22px; height: 22px; }
.ribbon.show { display: flex; animation: ribbonPop 0.7s 0.5s cubic-bezier(0.2, 1.8, 0.4, 1) both, glowPulse 1.4s 1.2s ease-in-out infinite; }

@keyframes ribbonPop {
  from { transform: scale(0) rotate(-12deg); }
  to { transform: none; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 5px 0 #b45c00, 0 0 20px rgba(255, 200, 0, 0.5); }
  50% { box-shadow: 0 5px 0 #b45c00, 0 0 44px rgba(255, 220, 0, 0.9); }
}

.spinner {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--spark);
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-height: 560px) {
  .logo { font-size: clamp(40px, 12vh, 70px); }
  .btn.big { font-size: 24px; padding: 12px 24px; }
  .panel { gap: 8px; padding: 20px 18px 14px; }
  .big-score { font-size: 48px; }
  h2 { font-size: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  #title .btn.primary { animation: none; }
}

.near {
  font-weight: 800;
  font-size: 18px;
  color: var(--gold);
  text-align: center;
  min-height: 1.2em;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s, transform 0.3s;
}
.near.show { opacity: 1; transform: none; }
.near-bar {
  position: relative;
  width: min(260px, 80%);
  height: 12px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 216, 74, 0.35);
  overflow: hidden;
}
.near-bar[hidden] { display: none; }
.near-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #ffb02e, var(--gold));
  border-radius: 99px;
  transition: width 1.1s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.near-bar b {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  transform: translateX(-100%);
  animation: sweep 1.6s 1.3s ease-in-out infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }

.lang-pick {
  position: relative;
  height: 52px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border-radius: 16px;
  border: 2px solid var(--edge);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  cursor: pointer;
}
.lang-pick svg { width: 22px; height: 22px; flex: none; }
.lang-pick select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  color: #fff;
  font-family: var(--font);
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  outline: none;
  max-width: 120px;
}
.lang-pick select option { color: #111; }
.lang-pick:focus-within { border-color: var(--spark); }
.toggles { flex-wrap: wrap; justify-content: center; }

.sound-panel { gap: 16px; }
.vol-row {
  display: grid;
  grid-template-columns: 28px 1fr 52px;
  grid-template-areas: 'icon label out' 'range range range';
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
  width: 100%;
}
.vol-icon { grid-area: icon; width: 24px; height: 24px; color: var(--spark); }
.vol-row label { grid-area: label; font-weight: 800; font-size: 19px; }
.vol-row output { grid-area: out; text-align: right; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.vol-row input[type=range] {
  grid-area: range;
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 16px;
  border-radius: 99px;
  background: linear-gradient(90deg, #ffb02e var(--p, 50%), rgba(0, 0, 0, 0.4) var(--p, 50%));
  border: 2px solid rgba(255, 255, 255, 0.15);
  outline: none;
  cursor: pointer;
}
.vol-row input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fffbd0, var(--spark) 50%, #ff9a2e);
  border: 3px solid #fff;
  box-shadow: 0 3px 0 #b45c00, 0 0 16px rgba(255, 200, 0, 0.6);
  transition: transform 0.1s;
}
.vol-row input[type=range]:active::-webkit-slider-thumb { transform: scale(1.18); }
.vol-row input[type=range]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--spark);
  border: 3px solid #fff;
}
.vol-row input[type=range]:focus-visible { border-color: var(--spark); }

.revive-panel { gap: 14px; }
.revive-text { margin: 0; color: var(--dim); font-weight: 700; font-size: 17px; text-align: center; max-width: 30ch; }
.revive-timer { position: relative; width: 110px; height: 110px; display: grid; place-items: center; }
.revive-timer svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.revive-timer circle { fill: none; stroke-width: 9; }
.revive-timer .track { stroke: rgba(255, 255, 255, 0.1); }
.revive-timer .ring { stroke: var(--spark); stroke-linecap: round; stroke-dasharray: 276.5; stroke-dashoffset: 0; filter: drop-shadow(0 0 6px #ffb000); }
.revive-timer span { font-size: 50px; font-weight: 900; text-shadow: 0 4px 0 rgba(0, 0, 0, 0.35); }
.overlay.show .revive-timer span { animation: tickPop 1s ease-out infinite; }
@keyframes tickPop { 0% { transform: scale(1.25); } 30% { transform: scale(1); } }
.btn.ad.big { font-size: clamp(20px, 6vw, 26px); }
.overlay.show #btn-revive { animation: breathe 1.1s ease-in-out infinite; }

.ad-actions {
  position: fixed;
  z-index: 5;
  display: flex;
  gap: 10px;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}
.ad-actions[hidden] { display: none; }
.privacy-notice { width: min(380px, 90vw); color: #b8bddd; font-size: 12px; line-height: 1.45; text-align: left; }
.privacy-notice summary { cursor: pointer; text-align: center; padding: 6px; }
.privacy-notice p { margin: 6px 0; }
.ad-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 216, 74, 0.45);
  background: rgba(10, 12, 44, 0.85);
  color: #fff;
  font-family: var(--font);
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.35);
  transition: transform 0.08s, opacity 0.2s;
}
.ad-pill svg { width: 18px; height: 18px; color: var(--spark); }
.ad-pill:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, 0.35); }
.ad-pill[hidden] { display: none; }
.ad-tag {
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  padding: 2px 5px;
  border-radius: 6px;
  background: linear-gradient(180deg, #ffe45c, #ff9a2e);
  color: #3a1d00;
}
.fake-ad { gap: 14px; }
.fake-ad-actions[hidden], .fake-ad [hidden] { display: none; }

.btn.daily {
  min-width: 250px;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #6a5cff, #4433c9);
  box-shadow: 0 6px 0 #2a1f8a, 0 10px 20px rgba(80, 60, 255, 0.3), inset 0 2px 0 rgba(255, 255, 255, 0.3);
}
.btn.daily > svg { width: 28px; height: 28px; flex: none; }
.daily-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; text-align: left; }
.daily-text small { font-size: 14px; font-weight: 800; color: #d9d4ff; }
.daily-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffb02e, #ff6a1e);
  color: #fff;
  font-size: 17px;
  box-shadow: 0 3px 0 #a33a00;
}
.daily-badge svg { width: 18px; height: 18px; }
.daily-badge.done { background: linear-gradient(180deg, #6dff8e, #18b85a); box-shadow: 0 3px 0 #0c7a3a; }

/* botoes de anuncio compactos (so icone + AD) em telas estreitas e na coluna da tela deitada */
.ad-actions.compact .ad-pill > span { display: none; }
.ad-actions.compact .ad-pill { padding: 8px 10px; }
.ad-actions { flex-wrap: nowrap; justify-content: center; }

/* Titulo: a "sombra" solida de 6-7 px embaixo de cada botao come o espaco entre eles. Em telas altas abre respiro
   e separa o Jogar (acao principal) dos botoes secundarios. As telas baixas mantem o espaco compacto de antes. */
@media (min-height: 700px) {
  .title-wrap { gap: 20px; }
  .title-wrap #btn-play { margin-bottom: 8px; }
}

/* telas baixas: overlay rola em vez de cortar, e o titulo fica mais compacto */
.overlay { overflow-y: auto; align-items: flex-start; }
.overlay > .title-wrap, .overlay > .panel { margin: auto; }
@media (max-height: 520px) {
  .tagline { display: none; }
  .title-wrap { gap: 8px; }
  .btn.daily { padding: 6px 14px; }
  .toggles { margin-top: 2px; }
  .icon-btn, .lang-pick { height: 44px; }
  .icon-btn { width: 44px; }
  .sound-panel { gap: 10px; }
}

@media (max-height: 520px) {
  .panel { padding: 14px 18px 10px; gap: 6px; }
  h2 { font-size: 22px; margin: 0; }
  .big-score { font-size: 38px; }
  .btn.big { font-size: 20px; padding: 8px 22px; min-width: 210px; }
  .btn.big svg { width: 22px; height: 22px; }
  .revive-timer { width: 66px; height: 66px; }
  .revive-timer span { font-size: 28px; }
  .revive-text { font-size: 14px; }
  .revive-panel { gap: 6px; }
  .label { font-size: 12px; }
  .near { font-size: 15px; }
  .best-line { font-size: 18px; }
  .ribbon { top: -16px; padding: 5px 16px; font-size: 16px; }
  .vol-row label { font-size: 16px; }
}

/* ---------- ranking ---------- */
.btn.rank {
  min-width: 250px;
  background: linear-gradient(180deg, #ffcf3a, #ff9a1e);
  color: #3a1d00;
  text-shadow: none;
  box-shadow: 0 6px 0 #b45c00, 0 10px 20px rgba(255, 160, 0, 0.25), inset 0 2px 0 rgba(255, 255, 255, 0.5);
}
.btn.rank:active { box-shadow: 0 1px 0 #b45c00, inset 0 2px 0 rgba(255, 255, 255, 0.5); }
.over-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.over-links .btn.link svg { width: 18px; height: 18px; }

.nick-form { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.nick-form[hidden] { display: none; }
.nick-form label { font-weight: 800; font-size: 15px; color: var(--dim); text-align: center; }
.nick-row { display: flex; gap: 8px; }
.nick-row input {
  flex: 1;
  min-width: 0;
  height: 50px;
  border-radius: 16px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  background: rgba(5, 6, 26, 0.7);
  color: #fff;
  font-family: var(--font);
  font-weight: 800;
  font-size: 20px;
  padding: 0 14px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.nick-row input:focus { border-color: var(--spark); box-shadow: 0 0 0 4px rgba(255, 216, 74, 0.25); }
.nick-row input::placeholder { color: rgba(255, 255, 255, 0.35); }
.nick-form.shake .nick-row { animation: shake 0.4s; }
@keyframes shake { 0%, 100% { transform: none; } 20% { transform: translateX(-8px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
.btn.send {
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  font-size: 17px;
  background: linear-gradient(180deg, #4fd8ff, #1c8fe0);
  box-shadow: 0 5px 0 #0d5a99, inset 0 2px 0 rgba(255, 255, 255, 0.4);
}
.btn.send svg { width: 20px; height: 20px; }
.btn.send.loading span { opacity: 0.85; }
.btn.send.loading svg { animation: spin 0.8s linear infinite; }
.btn.send:disabled { filter: saturate(0.7); }
.rank-note { margin: 0; text-align: center; font-weight: 800; font-size: 14px; color: var(--dim); text-wrap: balance; }
.rank-note[hidden] { display: none; }
.nick-status { min-height: 1.2em; text-align: center; font-weight: 800; font-size: 15px; color: var(--gold); }
.nick-status.error { color: #ff8aa8; }

.rank-panel { gap: 10px; max-height: calc(100% - 8px); width: min(440px, 100%); }
.rank-title { display: flex; align-items: center; gap: 10px; }
.rank-title svg { width: 30px; height: 30px; color: var(--gold); filter: drop-shadow(0 0 8px #ff9a00); }
.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: 100%;
  padding: 4px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.3);
}
.tab {
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--dim);
  font-family: var(--font);
  font-weight: 900;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.08s;
}
.tab:active { transform: scale(0.96); }
.tab.on { background: linear-gradient(180deg, #6a5cff, #4433c9); color: #fff; box-shadow: 0 3px 0 #2a1f8a; }
.rank-you {
  width: 100%;
  text-align: center;
  font-weight: 900;
  font-size: 18px;
  color: #3a1d00;
  padding: 8px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe45c, #ff9a2e);
  box-shadow: 0 4px 0 #b45c00;
  animation: ribbonPop 0.6s cubic-bezier(0.2, 1.8, 0.4, 1) both;
}
.rank-you[hidden] { display: none; }
.rank-list {
  list-style: none;
  margin: 0;
  padding: 0 2px;
  width: 100%;
  min-height: 220px;
  max-height: min(58vh, 540px);
  /* Sem rolagem horizontal: com overflow-y definido o outro eixo vira "auto" e a linha "voce" (brilho + scale) passava da largura. */
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 6px;
  /* folga para o brilho e o "pulo" da linha destacada nao serem cortados, e para a barra nao colar nas linhas */
  padding: 8px 10px 8px 8px;
  /* barra de rolagem no estilo do jogo (Firefox e Chrome novo usam estas duas; o resto cai no -webkit- abaixo) */
  scrollbar-width: thin;
  scrollbar-color: #6a5cff rgba(0, 0, 0, 0.28);
}
.rank-list::-webkit-scrollbar { width: 10px; }
.rank-list::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.28); border-radius: 999px; margin: 6px 0; }
.rank-list::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #8b7dff, #5443d6);
  border-radius: 999px;
  border: 2px solid rgba(10, 14, 44, 0.9);
}
.rank-list::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #a094ff, #6a5cff); }
.rank-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
  font-size: 17px;
  opacity: 0;
  transform: translateY(14px) scale(0.97);
  animation: rowIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) forwards;
  animation-delay: calc(var(--i) * 35ms);
}
@keyframes rowIn { to { opacity: 1; transform: none; } }
.rank-row .pos {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 900;
  background: rgba(255, 255, 255, 0.1);
  font-variant-numeric: tabular-nums;
}
.rank-row:nth-child(1) .pos { background: linear-gradient(180deg, #ffe45c, #e8a400); color: #3a1d00; box-shadow: 0 0 12px rgba(255, 210, 0, 0.6); }
.rank-row:nth-child(2) .pos { background: linear-gradient(180deg, #f2f4ff, #a9b0d0); color: #22264a; }
.rank-row:nth-child(3) .pos { background: linear-gradient(180deg, #ffc08a, #c46a2a); color: #3a1600; }
.rank-row .name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-row .score { color: var(--gold); font-variant-numeric: tabular-nums; }
.rank-row.me {
  background: linear-gradient(90deg, rgba(79, 216, 255, 0.35), rgba(106, 92, 255, 0.35));
  border: 2px solid #7cf0ff;
  box-shadow: 0 0 18px rgba(124, 240, 255, 0.45);
}
.rank-row.me.fresh { animation: rowIn 0.35s cubic-bezier(0.2, 1.4, 0.4, 1) forwards, meGlow 1.2s 0.5s ease-in-out 3; }
@keyframes meGlow { 50% { box-shadow: 0 0 34px rgba(124, 240, 255, 0.9); transform: scale(1.03); } }
.rank-row.skeleton { opacity: 1; animation: none; transform: none; height: 46px; background: linear-gradient(90deg, rgba(255,255,255,0.05) 20%, rgba(255,255,255,0.13) 50%, rgba(255,255,255,0.05) 80%); background-size: 200% 100%; animation: skel 1.1s linear infinite; }
@keyframes skel { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.rank-empty { text-align: center; color: var(--dim); font-weight: 800; padding: 30px 0; }
@media (max-height: 520px) {
  .rank-list { max-height: 38vh; min-height: 100px; padding-block: 4px; }
  .tab { height: 34px; font-size: 14px; }
  .nick-row input, .btn.send { height: 42px; }
}

.nick-row input { -webkit-user-select: text; user-select: text; touch-action: manipulation; }

/* telas baixas (celular deitado, janela curta): titulo e fim de jogo cabem sem rolar */
@media (max-height: 620px) {
  .tagline { display: none; }
  .title-wrap { gap: 7px; }
  .btn.big { font-size: 20px; padding: 8px 22px; min-width: 220px; border-radius: 18px; }
  .btn.big svg { width: 22px; height: 22px; }
  .btn.daily, .btn.rank { min-width: 220px; padding: 6px 14px; font-size: 17px; }
  .btn.daily > svg { width: 22px; height: 22px; }
  .daily-text small { font-size: 12px; }
  .best-line { font-size: 17px; }
  .toggles { margin-top: 0; }
  .icon-btn, .lang-pick { height: 42px; }
  .icon-btn { width: 42px; }
  .panel { padding: 12px 18px 8px; gap: 5px; }
  #over .label { display: none; }
  .big-score { font-size: 36px; margin: 0; }
  .near { font-size: 14px; min-height: 0; }
  .near-bar { height: 8px; }
  .nick-form { gap: 3px; }
  .nick-form label { font-size: 13px; }
  .nick-row input, .btn.send { height: 40px; font-size: 17px; }
  .nick-status { min-height: 0; font-size: 13px; }
  .over-links .btn.link { padding: 2px 10px; font-size: 15px; }
}

/* ---------- toque para comecar ---------- */
.title-actions { display: flex; flex-direction: column; align-items: center; gap: inherit; width: 100%; }
.tap-start { display: none; }
#title.splash .title-actions { display: none; }
#title.splash .tap-start {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 16px 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18), 0 0 40px rgba(124, 240, 255, 0.25);
  color: #fff;
  font-family: var(--font);
  font-weight: 900;
  font-size: clamp(17px, 5.2vw, 26px);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  max-width: 100%;
  cursor: pointer;
  animation: tapPulse 1.3s ease-in-out infinite;
}
#title.splash .tap-start svg { width: 34px; height: 34px; color: var(--spark); animation: tapFinger 1.3s ease-in-out infinite; filter: drop-shadow(0 0 8px #ffb000); }
@keyframes tapPulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.06); opacity: 0.8; } }
@keyframes tapFinger { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(5px) scale(0.92); } }
#title.splash { cursor: pointer; }
/* botoes entram um a um depois do toque */
#title.reveal .title-actions > * { animation: popIn 0.5s cubic-bezier(0.2, 1.7, 0.4, 1) both; }
#title.reveal .title-actions > *:nth-child(2) { animation-delay: 0.05s; }
#title.reveal .title-actions > *:nth-child(3) { animation-delay: 0.1s; }
#title.reveal .title-actions > *:nth-child(4) { animation-delay: 0.15s; }
#title.reveal .title-actions > *:nth-child(5) { animation-delay: 0.2s; }
#title.reveal .title-actions > *:nth-child(6) { animation-delay: 0.25s; }
@keyframes popIn { from { opacity: 0; transform: translateY(20px) scale(0.7); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #title.splash .tap-start, #title.splash .tap-start svg, #title.reveal .title-actions > * { animation: none; }
}

/* Frase do titulo ("Complete linhas. Carregue o raio."): pouco legivel sobre o fundo, fica escondida.
   Para voltar, apague esta regra (o texto continua em index.html e src/locales.js). */
.tagline { display: none; }

/* botao de tela cheia some quando o navegador/portal nao permite (o atributo hidden perde para o display do .icon-btn) */
.icon-btn[hidden] { display: none; }
