/* Fruit Shhhot — estilo de la línea Shhhot: fondo #17132B, coral, amarillo y verde,
   Russo One para la marca y Varela Round para el resto. En la partida, fondo de mundo a pantalla completa
   (los de Smash Shhhot). Montcau Studio. */
@font-face { font-family: "Russo One"; src: url(../fonts/russo-one.woff2) format("woff2"); font-display: swap; }
@font-face { font-family: "Varela Round"; src: url(../fonts/varela-round.woff2) format("woff2"); font-display: swap; }

:root {
  --bg: #17132B; --panel: #231F3F; --line: #3A3160; --cell: #2D2850;
  --coral: #EC7063; --yellow: #F5D060; --teal: #52A096; --muted: #A9A2CC; --ink: #17132B;
  --p-coral: #F7B3AB; --p-yellow: #F8E3A1; --p-teal: #A9D6CD;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #0E0B1C; overscroll-behavior: none; }
body { touch-action: manipulation; color: #fff; font-family: "Varela Round", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
b, h1, h2 { font-family: "Russo One", "Varela Round", sans-serif; font-weight: 400; }
button { font-family: inherit; border: 0; cursor: pointer; color: inherit; padding: 0; background: none; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
small { display: block; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
[hidden] { display: none !important; }

#app { position: relative; max-width: 480px; height: 100vh; height: 100dvh; margin: 0 auto; background: var(--bg); overflow: hidden; }
.scr { position: absolute; inset: 0; display: none; flex-direction: column; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
.scr.on { display: flex; }

/* cabecera */
.top { display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; min-height: 60px; flex: none; position: relative; }
.brand { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; min-width: 0; }
.brand b { font-size: 19px; line-height: 1.1; white-space: nowrap; }
.brand b span, h1 span { color: var(--coral); }
.brand.small { flex: 1; overflow: hidden; }
.brand.small > div { min-width: 0; overflow: hidden; }
.brand.small b { font-size: 16px; display: block; overflow: hidden; text-overflow: ellipsis; }
.brand.small small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; opacity: .86; }
.brand [data-logo], .home-logo { line-height: 0; flex: none; }
.top-title { font-size: 20px; flex: 1; }
.langs { margin-left: auto; display: flex; gap: 4px; background: var(--panel); border: 2px solid var(--line); border-radius: 999px; padding: 3px; flex: none; }
.langs button { min-width: 38px; height: 34px; border-radius: 999px; font-family: "Russo One"; font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.langs button.on { background: var(--yellow); color: var(--ink); }
.ibtn { width: 44px; height: 44px; border-radius: 14px; background: var(--panel); border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; flex: none; }
.ibtn svg { width: 22px; height: 22px; }
.wildpill { display: inline-flex; align-items: center; gap: 7px; background: var(--panel); border: 2px solid var(--line); border-radius: 999px; padding: 8px 14px; color: var(--yellow); margin-top: 4px; }
.wildpill svg { width: 20px; height: 20px; }
.wildpill b { font-size: 17px; color: #fff; }
.wildpill small { color: var(--muted); font-size: 13px; }
.wildpill.mini { margin: 0; padding: 0 11px; height: 44px; flex: none; }

/* portada */
#scr-home { background: radial-gradient(120% 60% at 50% 30%, #2A2450 0%, var(--bg) 62%); }
.home-body { flex: 1; display: flex; flex-direction: column; align-items: center; padding: 8px 20px 0; min-height: 0; overflow-y: auto; }
.home-body > :first-child { margin-top: auto; }
.home-body > :last-child { margin-bottom: auto; }
.home-logo { flex: none; }
.home-logo svg { width: min(180px, 22vh); height: auto; }
h1 { font-size: clamp(34px, 11vw, 46px); line-height: 1; margin: 2.2vh 0 0; }
.lema { margin: 10px 0 0; color: var(--muted); font-size: 16px; text-align: center; }
.fruit-row { display: flex; align-items: flex-end; justify-content: center; gap: 3px; margin: 2.2vh 0 2.6vh; max-width: 100%; flex: none; }
.fruit-row img { display: block; min-width: 0; flex: 0 1 auto; height: auto; aspect-ratio: 1; }
.btn { width: min(300px, 100%); min-height: 58px; border-radius: 20px; font-family: "Russo One"; font-size: 19px; margin-bottom: 14px; color: var(--ink); box-shadow: 0 5px 0 rgba(0, 0, 0, .3); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 14px; transition: transform .08s; flex: none; }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0, 0, 0, .3); }
.btn small { color: rgba(23, 19, 43, .72); font-family: "Varela Round"; font-size: 12px; margin-top: 2px; }
.btn.coral { background: var(--coral); }
.btn.amarillo { background: var(--yellow); }
.btn.teal { background: var(--p-teal); }
.btn.linea { background: var(--panel); color: #fff; border: 2px solid var(--line); box-shadow: none; }
.btn.texto { background: none; box-shadow: none; color: var(--muted); min-height: 44px; font-family: "Varela Round"; font-size: 15px; }
.btn.comodin { background: linear-gradient(135deg, var(--yellow), var(--coral)); min-height: 68px; font-size: 20px; }
.btn[disabled] { opacity: .5; }
.firma { text-align: center; margin: 0; padding: 10px 0 14px; color: #8C85B5; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; flex: none; }

/* niveles */
.map-body { flex: 1; overflow-y: auto; padding: 14px 14px 24px; -webkit-overflow-scrolling: touch; }
.world { background: var(--panel); border: 2px solid var(--line); border-radius: 22px; margin-bottom: 14px; overflow: hidden; }
.world-head { height: 84px; background-size: cover; background-position: center 20%; display: flex; align-items: flex-end; justify-content: space-between; padding: 10px 14px; position: relative; }
.world-head::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 19, 43, 0) 30%, rgba(23, 19, 43, .78)); }
.world-head b { position: relative; font-size: 19px; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.world-head span { position: relative; font-size: 13px; color: var(--yellow); font-family: "Russo One"; display: flex; align-items: center; gap: 4px; }
.world-head span svg { width: 15px; height: 15px; }
.world.locked .world-head { filter: grayscale(.7) brightness(.7); }
.lv-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 12px; }
.lv { aspect-ratio: 1; border-radius: 16px; background: var(--cell); border: 2px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: "Russo One"; font-size: 18px; position: relative; }
.lv.done { background: #33305E; }
.lv.cur { background: var(--coral); color: var(--ink); border-color: #F7B3AB; }
.lv.off { color: #5C5488; }
.lv.off svg { width: 18px; height: 18px; }
.lv .st { display: flex; gap: 1px; margin-top: 2px; height: 11px; }
.lv .st svg { width: 11px; height: 11px; color: #4A4272; }
.lv .st svg.on { color: var(--yellow); }

/* partida */
#scr-game .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
#scr-game .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(23, 19, 43, .55) 0, rgba(23, 19, 43, .1) 22%, rgba(23, 19, 43, 0) 50%, rgba(23, 19, 43, .3) 100%); }
#scr-game > *:not(.bg) { position: relative; }
.game-top .ibtn, .game-top .wildpill { background: rgba(23, 19, 43, .78); border-color: rgba(255, 255, 255, .22); }
.brand.small b { text-shadow: 0 2px 0 rgba(0, 0, 0, .35); }
.panel { margin: 10px 12px 0; background: rgba(23, 19, 43, .82); border: 2px solid rgba(255, 255, 255, .2); border-radius: 22px; display: flex; align-items: stretch; padding: 8px 12px; gap: 12px; flex: none; }
.panel small { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
.mov, .pts { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 58px; }
.mov b { font-size: 28px; line-height: 1.05; color: var(--coral); }
.mov.low b { color: #FF4D4D; animation: pulse .7s infinite alternate; }
.pts b { font-size: 20px; line-height: 1.3; color: var(--yellow); }
.obj { flex: 1; min-width: 0; border-left: 2px solid rgba(255, 255, 255, .14); border-right: 2px solid rgba(255, 255, 255, .14); padding: 0 10px; display: flex; flex-direction: column; justify-content: center; }
.obj-row { display: flex; gap: 12px; align-items: center; min-height: 40px; }
.goal { display: flex; align-items: center; gap: 5px; font-family: "Russo One"; font-size: 16px; }
.goal img { width: 40px; height: 40px; }
.goal.ok { color: var(--teal); }
.goal.ok img { opacity: .5; }
.obj-row.many { gap: 6px; }
.obj-row.many .goal { font-size: 13px; gap: 2px; }
.obj-row.many .goal img { width: 28px; height: 28px; }
.goal.ok span::after { content: " ✓"; }
.goal.bump img { animation: pop .35s; }
.daily-info { font-size: 14px; color: #fff; line-height: 1.25; }
.tip { margin: 8px 16px 0; background: #fff; color: var(--ink); border-radius: 14px; padding: 8px 12px; font-size: 14px; text-align: center; flex: none; }
.jar-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px 4px 2px; }
#cv { display: block; touch-action: none; cursor: pointer; }
.cycle { flex: none; display: flex; align-items: center; gap: 10px; margin: 0 12px 10px; background: rgba(23, 19, 43, .82); border: 2px solid rgba(255, 255, 255, .2); border-radius: 20px; padding: 6px 10px; }
.nextbox { display: flex; flex-direction: column; align-items: center; min-width: 54px; border-right: 2px solid rgba(255, 255, 255, .14); padding-right: 8px; }
.nextbox small { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.nextbox img { width: 36px; height: 36px; object-fit: contain; }
.chain { flex: 1; display: flex; align-items: center; justify-content: space-between; min-width: 0; }
.chain button { line-height: 0; padding: 2px 0; flex: 1; min-width: 0; display: flex; justify-content: center; }
.chain img { width: min(26px, 6vw); height: min(26px, 6vw); }
.chain button.goal-fruit img { filter: drop-shadow(0 0 4px #fff); transform: scale(1.2); }
.chain button.drink img { width: min(32px, 7.4vw); height: min(32px, 7.4vw); }
.chain i { color: var(--muted); font-style: normal; font-size: 16px; flex: none; }

/* globo de ayuda al mantener pulsada una fruta */
.info { position: absolute; z-index: 8; left: 14px; right: 14px; background: #fff; color: var(--ink); border-radius: 18px; padding: 10px 12px; display: flex; gap: 10px; align-items: center; box-shadow: 0 10px 26px rgba(0, 0, 0, .5); pointer-events: none; animation: fade .14s; }
.info img { width: 52px; height: 52px; flex: none; }
.info b { display: block; font-size: 16px; line-height: 1.15; }
.info p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.3; color: #3B3560; }

/* hojas */
.modal { position: absolute; inset: 0; background: rgba(10, 8, 22, .72); display: flex; align-items: flex-end; justify-content: center; z-index: 10; animation: fade .18s; }
.sheet { width: 100%; background: var(--panel); border: 2px solid var(--line); border-bottom: 0; border-radius: 28px 28px 0 0; padding: 22px 20px calc(18px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; text-align: center; animation: up .24s ease-out; max-height: 92%; overflow-y: auto; }
.sheet h2 { margin: 0 0 6px; font-size: 26px; }
.sheet p { margin: 4px 0; color: var(--muted); font-size: 15px; }
.sheet p.big { color: #fff; font-family: "Russo One"; font-size: 22px; margin: 8px 0 2px; }
.sheet p.huge { color: var(--yellow); font-family: "Russo One"; font-size: 44px; line-height: 1; margin: 8px 0 2px; }
.sheet .etiqueta { font-family: "Russo One"; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--teal); margin-bottom: 6px; }
.sheet .stars { display: flex; gap: 6px; margin: 8px 0 6px; }
.sheet .stars svg { width: 46px; height: 46px; color: #4A4272; }
.sheet .stars svg.on { color: var(--yellow); animation: pop .4s backwards; }
.sheet .stars svg.on:nth-child(2) { animation-delay: .18s; } .sheet .stars svg.on:nth-child(3) { animation-delay: .36s; }
.sheet .btn { margin: 12px 0 0; }
.sheet .row { display: flex; align-items: center; justify-content: space-between; width: min(300px, 100%); margin-top: 14px; font-size: 16px; }
.sheet .row .langs { margin-left: 0; }
.sheet .two { display: flex; gap: 10px; width: min(300px, 100%); }
.sheet .two .btn { flex: 1; width: auto; font-size: 16px; }
.sheet ul.lista { text-align: left; margin: 8px 0 2px; padding: 0 0 0 20px; color: var(--muted); font-size: 14.5px; line-height: 1.4; width: min(320px, 100%); }
.sheet .btn.compra { flex-direction: row; justify-content: space-between; text-align: left; min-height: 64px; padding: 8px 12px 8px 18px; background: var(--cell); color: #fff; border: 2px solid var(--line); box-shadow: none; }
.sheet .btn.compra span { display: flex; flex-direction: column; min-width: 0; }
.sheet .btn.compra small { color: var(--muted); }
.precio { flex: none; background: var(--yellow); color: var(--ink); border-radius: 999px; padding: 9px 14px; font-family: "Russo One"; font-size: 16px; white-space: nowrap; }
.sheet img.card { width: min(230px, 62%); border-radius: 18px; border: 2px solid var(--line); margin: 8px 0 2px; display: block; }
.sheet .link { font-size: 12.5px; color: var(--muted); word-break: break-all; -webkit-user-select: text; user-select: text; margin-top: 6px; }
.sheet .chainhelp { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px; margin: 10px 0 4px; }
.sheet .chainhelp img { width: 30px; height: 30px; }
.sheet .chainhelp i { color: var(--muted); font-style: normal; font-size: 12px; }
.toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); background: #fff; color: var(--ink); border-radius: 999px; padding: 9px 16px; font-size: 14px; z-index: 12; white-space: nowrap; max-width: 92%; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); animation: fade .2s; }

@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes pop { 0% { transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes pulse { from { opacity: 1; } to { opacity: .55; } }

@media (max-height: 640px) {
  .top { min-height: 52px; padding-top: 8px; }
  .panel { margin-top: 6px; padding: 5px 10px; }
  .cycle { margin-bottom: 6px; padding: 4px 8px; }
  .home-logo svg { width: 84px; height: 84px; }
  h1 { font-size: 32px; margin-top: 10px; }
  .lema { font-size: 14px; margin-top: 6px; }
  .fruit-row { margin: 10px 0 12px; }
  .btn { min-height: 50px; margin-bottom: 9px; }
  .wildpill { padding: 5px 12px; margin-top: 0; }
  .firma { padding: 6px 0 8px; }
}
@media (max-width: 345px) {
  .brand b { font-size: 16px; }
  .langs button { min-width: 32px; }
  .mov, .pts { min-width: 48px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
