/* Nani Blast · gelatina nocturna */
:root {
  --ink: #f5eeff;
  --muted: #a995d6;
  --pink: #ff4fb0;
  --violet: #8a5bff;
  --glass-line: rgba(255, 255, 255, .2);
  --font: "SF Pro Rounded", ui-rounded, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  color: var(--ink);
  background: #0e0527;
  font-family: var(--font);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
body { position: fixed; inset: 0; }
#scene { position: fixed; inset: 0; width: 100vw; height: 100vh; touch-action: none; display: block; }
#app { position: absolute; inset: 0; pointer-events: none; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; pointer-events: auto; }

.view {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  pointer-events: none;
  padding: calc(env(safe-area-inset-top) + 10px) calc(env(safe-area-inset-right) + 16px) calc(env(safe-area-inset-bottom) + 14px) calc(env(safe-area-inset-left) + 16px);
}
.view.active { display: flex; animation: viewin .4s ease both; }
@keyframes viewin { from { opacity: 0; } to { opacity: 1; } }

/* ---------- botones ---------- */
.icon-btn {
  appearance: none; border: 1px solid var(--glass-line); width: 46px; height: 46px; border-radius: 16px;
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
  background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05));
  box-shadow: 0 6px 16px rgba(5, 0, 30, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
  transition: transform .09s, box-shadow .09s;
}
.icon-btn:active { transform: scale(.93); }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn.off { color: #7c6aa8; }
.icon-btn.off svg { opacity: .6; }

.btn {
  appearance: none; border: 0; cursor: pointer; width: 100%; position: relative; overflow: hidden;
  font-weight: 900; font-size: 22px; letter-spacing: .4px; color: #fff;
  padding: 17px 28px; border-radius: 24px;
  background: linear-gradient(180deg, #ff6cc0 0%, #ff3d9a 45%, #8a5bff 100%);
  text-shadow: 0 2px 0 rgba(90, 0, 70, .45);
  box-shadow: 0 0 28px rgba(255, 79, 176, .5), 0 10px 22px rgba(60, 0, 80, .5), inset 0 2px 0 rgba(255, 255, 255, .5), inset 0 -3px 0 rgba(60, 0, 100, .35);
  transition: transform .09s, filter .09s;
}
.btn::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent);
  transform: skewX(-18deg); animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 140%; } }
.btn:active { transform: scale(.97); filter: brightness(1.1); }
.btn.alt {
  color: var(--ink); text-shadow: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, .17), rgba(255, 255, 255, .06));
  border: 1px solid var(--glass-line);
  box-shadow: 0 8px 18px rgba(5, 0, 30, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn.alt::after { display: none; }
.btn.small { font-size: 17px; padding: 12px 20px; border-radius: 20px; }

/* ---------- inicio ---------- */
.home-top { display: flex; gap: 10px; align-items: center; }
.spacer { flex: 1; }
.home-mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.home-bottom { display: flex; flex-direction: column; gap: 14px; width: min(100%, 380px); margin: 0 auto; }
#logo-anchor { width: 118px; height: 118px; margin-bottom: 10px; flex: none; }
.logo { text-align: center; }
.word { font-weight: 900; line-height: .95; letter-spacing: 1px; font-size: clamp(54px, 17vw, 84px); }
.word.w2 { font-size: clamp(46px, 14.5vw, 72px); margin-top: 2px; }
.word span {
  display: inline-block; color: #fff;
  text-shadow: 0 0 6px var(--c), 0 0 16px var(--c), 0 0 34px var(--c), 0 0 60px var(--c), 0 5px 0 rgba(0, 0, 0, .3);
  animation: wob 2.6s ease-in-out infinite;
}
.word span:nth-child(2n) { animation-delay: -.5s; }
.word span:nth-child(3n) { animation-delay: -1.1s; }
@keyframes wob { 50% { transform: translateY(-5px) rotate(2deg); } }
.best-line { margin-top: 16px; font-weight: 800; color: var(--muted); font-size: 16px; min-height: 22px; }
.best-line b { color: #fff; text-shadow: 0 0 12px rgba(255, 79, 176, .8); }

.daily {
  appearance: none; border: 1px solid var(--glass-line); cursor: pointer; text-align: left; width: 100%;
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 22px;
  background: linear-gradient(160deg, rgba(255, 255, 255, .15), rgba(255, 255, 255, .05));
  box-shadow: 0 8px 20px rgba(5, 0, 30, .45), inset 0 1px 0 rgba(255, 255, 255, .22);
  transition: transform .09s;
}
.daily:active { transform: scale(.97); }
.daily-ico { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; font-size: 24px; color: #fff; background: linear-gradient(#ffd54a, #ff7a1f); text-shadow: 0 2px 0 rgba(160, 80, 0, .4); box-shadow: 0 0 18px rgba(255, 160, 50, .55), inset 0 2px 0 rgba(255, 255, 255, .6); flex: none; }
.daily-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.daily-txt b { font-size: 17px; }
.daily-txt span { font-size: 14px; color: var(--muted); font-weight: 700; }
.daily-state { font-weight: 900; font-size: 13px; padding: 6px 10px; border-radius: 12px; background: rgba(138, 91, 255, .3); color: #d7c7ff; white-space: nowrap; }
.daily-state.done { background: rgba(25, 217, 138, .25); color: #7dffc4; }

/* ---------- juego ---------- */
.hud { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.scorebox { text-align: center; flex: 1; }
.scorebox .label { font-size: 12px; letter-spacing: 2.5px; font-weight: 900; color: var(--muted); }
.score { font-size: 46px; font-weight: 900; line-height: 1; color: #fff; text-shadow: 0 0 10px rgba(255, 79, 176, .55), 0 0 26px rgba(138, 91, 255, .65), 0 3px 0 rgba(0, 0, 0, .25); font-variant-numeric: tabular-nums; }
.score.bump { animation: bump .34s ease; }
@keyframes bump { 40% { transform: scale(1.2); text-shadow: 0 0 14px #fff, 0 0 34px rgba(255, 79, 176, .95), 0 3px 0 rgba(0, 0, 0, .25); } }
.bestbox { min-width: 46px; height: 46px; padding: 0 12px 0 10px; border-radius: 16px; display: flex; align-items: center; gap: 5px; font-weight: 900; font-size: 17px; border: 1px solid var(--glass-line); background: linear-gradient(160deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, .05)); box-shadow: 0 6px 16px rgba(5, 0, 30, .45), inset 0 1px 0 rgba(255, 255, 255, .25); }
.bestbox svg { width: 22px; height: 22px; filter: drop-shadow(0 0 6px rgba(255, 196, 0, .7)); }

.strip { min-height: 34px; display: flex; align-items: center; justify-content: center; margin: 6px 0 2px; }
.goal { display: flex; align-items: center; gap: 10px; width: min(100%, 360px); font-weight: 800; font-size: 14px; background: rgba(255, 255, 255, .09); border: 1px solid var(--glass-line); padding: 6px 12px; border-radius: 14px; }
.goal span { white-space: nowrap; }
.goal .bar { flex: 1; height: 10px; border-radius: 6px; background: rgba(0, 0, 0, .35); overflow: hidden; }
.goal .bar i { display: block; height: 100%; width: 0; border-radius: 6px; background: linear-gradient(90deg, #ff4fb0, #ffa63d); box-shadow: 0 0 10px rgba(255, 79, 176, .8); transition: width .4s ease; }
.goal.done { border-color: rgba(61, 255, 168, .5); color: #7dffc4; }
.goal.done .bar i { background: linear-gradient(90deg, #19d98a, #3dffa8); box-shadow: 0 0 10px rgba(61, 255, 168, .8); }
.combo { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; color: #fff; padding: 5px 14px; border-radius: 16px; background: linear-gradient(#ffb04a, #ff4fb0); text-shadow: 0 2px 0 rgba(120, 20, 60, .45); box-shadow: 0 0 22px rgba(255, 79, 176, .6), inset 0 2px 0 rgba(255, 255, 255, .45); }
.combo.pulse { animation: bump .4s ease; }
.pips { display: flex; gap: 4px; }
.pips i { width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; }
.pips i.off { background: rgba(255, 255, 255, .3); box-shadow: none; }
#stage { flex: 1; min-height: 0; }

/* ventanas */
.modal-bg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: rgba(8, 2, 28, .62); pointer-events: auto; animation: fade .25s ease both; }
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(88vw, 350px); padding: 24px 22px 22px; border-radius: 32px; text-align: center; position: relative;
  background: linear-gradient(180deg, #2c1458, #190a3a);
  border: 1px solid rgba(190, 150, 255, .35);
  box-shadow: 0 0 60px rgba(138, 91, 255, .35), 0 26px 50px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
  animation: modalin .42s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes modalin { from { transform: scale(.6) translateY(30px); opacity: 0; } }
.modal h2 { margin: 0 0 6px; font-size: 28px; font-weight: 900; text-shadow: 0 0 18px rgba(255, 79, 176, .6); }
.modal p { margin: 4px 0 14px; color: var(--muted); font-weight: 700; font-size: 15px; }
.modal .big { font-size: 60px; font-weight: 900; line-height: 1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; background: linear-gradient(#fff, #ffb0e0 55%, #ff4fb0); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 16px rgba(255, 79, 176, .7)); }
.modal .badge { display: inline-block; margin: 2px 0 10px; padding: 6px 14px; border-radius: 14px; font-weight: 900; font-size: 14px; color: #fff; background: linear-gradient(#ffb04a, #ff4fb0); text-shadow: 0 2px 0 rgba(120, 20, 60, .45); box-shadow: 0 0 20px rgba(255, 130, 100, .6); animation: bump .8s ease infinite alternate; }
.modal .btn { margin-top: 12px; }
.modal .row { display: flex; gap: 10px; }
.modal .row .icon-btn { flex: 1; width: auto; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 4px; }
.stat { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); border-radius: 18px; padding: 12px 8px; }
.stat b { display: block; font-size: 26px; font-weight: 900; color: #fff; }
.stat span { font-size: 12px; font-weight: 800; color: var(--muted); }

@media (max-height: 640px) {
  .score { font-size: 38px; }
  .icon-btn { width: 42px; height: 42px; }
  #logo-anchor { width: 92px; height: 92px; }
}
@media (prefers-reduced-motion: reduce) {
  .word span, .btn::after { animation: none; }
}
