/* ==========================================================================
   estilos.css — Mi Acuario
   Colores en variables (con modo oscuro). Animaciones solo con transform
   y opacity para que el móvil no tenga que redibujar la pantalla entera.
   ========================================================================== */

:root {
  --bg: #0b3d5c; --card: #ffffff; --ink: #12324a; --acc: #ff9f1c; --acc-ink: #3b2300; --mut: #5b7a8f;
  --line: rgba(136,136,136,.2); --soft: rgba(136,136,136,.18);
  --glass: rgba(0,25,45,.45); --panel: linear-gradient(180deg, rgba(16,58,86,.97), rgba(8,36,56,.97));
  --ok: #3ddc84; --warn: #ffb020; --bad: #ff5a4f;
  --r: 16px; --sombra: 0 10px 30px rgba(0,0,0,.35);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --bg: #06202f; --card: #12324a; --ink: #e8f4fb; --mut: #9fbccd; } }
:root[data-theme="dark"] { --bg: #06202f; --card: #12324a; --ink: #e8f4fb; --mut: #9fbccd; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; -webkit-touch-callout: none; }
html { background: var(--bg); }
body {
  background: var(--bg); color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(120% 60% at 50% 0%, #17618c 0%, var(--bg) 55%, #062638 100%) var(--bg);
  display: flex; flex-direction: column; max-width: 520px; margin: 0 auto;
  height: 100vh; height: 100dvh;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  user-select: none; -webkit-user-select: none; -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
button:disabled { cursor: default; }
img { -webkit-user-drag: none; }

/* ---------- Pantalla de carga ---------- */
#carga { position: fixed; inset: 0; z-index: 3000; background: var(--bg); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; font-weight: 700; transition: opacity .35s; }
#carga img { width: 96px; height: 96px; border-radius: 22px; box-shadow: var(--sombra); animation: flota 2s ease-in-out infinite alternate; }
#carga.fuera { opacity: 0; pointer-events: none; }
@keyframes flota { to { transform: translateY(-8px); } }

/* ---------- Marcador superior ---------- */
.top { display: flex; justify-content: space-between; gap: 6px; padding: 10px 10px 6px; color: #fff; font-weight: 600; font-size: 15px; }
.pill { background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.1)); box-shadow: inset 0 0 0 1px rgba(255,255,255,.22), 0 2px 6px rgba(0,0,0,.18); padding: 0 11px; height: 38px; border-radius: 19px; white-space: nowrap; font-size: 14.5px; display: inline-flex; align-items: center; gap: 5px; border: 0; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pill b { font-variant-numeric: tabular-nums; }
.pill.oro { background: linear-gradient(180deg, rgba(255,214,90,.45), rgba(242,176,30,.25)); box-shadow: inset 0 0 0 1px rgba(255,226,140,.55), 0 2px 6px rgba(0,0,0,.18); }
.sube { animation: sube .45s ease-out; }
@keyframes sube { 30% { transform: scale(1.18); } }
.pill .fi { height: 20px; }
.top > * { min-width: 0; }
@media (max-width: 380px) {
  .top { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .pill { font-size: 13px; padding: 0 8px; height: 34px; }
  .pill .fi { height: 18px; }
}
@media (max-width: 380px) {
  body .btns { gap: 6px; }
  body .btns .b { font-size: 11.5px; letter-spacing: -.2px; padding-left: 1px; padding-right: 1px; }
  body .meter { flex-basis: 66px; }
  body #cln, body #wtr { font-size: 11.5px; padding: 0 9px; }
}
@media (max-width: 340px) { .lvtx { display: none; } .pill { padding: 0 6px; } }
.pill .sep { opacity: .9; }
button.pill:active { transform: scale(.96); }
#lvlp.gift::after { content: "🎁"; margin-left: 2px; animation: latido 1.2s ease-in-out infinite; display: inline-block; }
@keyframes latido { 50% { transform: scale(1.25); } }
.bar { margin: 4px 10px 0; height: 10px; background: rgba(0,0,0,.25); border-radius: 8px; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.3); }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, #ffd25a, #ff9f1c); width: 0; transition: width .5s; border-radius: 8px; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12), inset 0 2px 0 rgba(255,255,255,.35); }
.lbl { color: rgba(255,255,255,.92); font-size: 12px; font-weight: 600; margin: 4px 12px 8px; display: flex; justify-content: space-between; gap: 8px; }

/* ---------- Pecera ---------- */
#tank { position: relative; z-index: 0; isolation: isolate; flex: 1; margin: 0 10px; border-radius: 20px; overflow: hidden; background: #1b9ae0; min-height: 300px; touch-action: none; contain: layout paint; box-shadow: inset 0 0 0 2px rgba(255,255,255,.18), inset 0 0 40px rgba(0,30,60,.35), 0 8px 24px rgba(0,0,0,.3); }
/* Fondo animado con transform (no obliga a redibujar) */
#fondo { position: absolute; top: 0; bottom: 0; left: -6%; width: 112%; z-index: -2; background: url(../img/fondo.jpg) 50% 100% / cover no-repeat; animation: bgm 18s ease-in-out infinite alternate; will-change: transform; pointer-events: none; }
@keyframes bgm { from { transform: translate3d(-3.5%,0,0); } to { transform: translate3d(3.5%,0,0); } }
#tank::before { content: ""; position: absolute; inset: -60px; z-index: -1; pointer-events: none; background: repeating-linear-gradient(105deg, rgba(255,255,255,0) 0 50px, rgba(255,255,255,.10) 80px, rgba(255,255,255,0) 120px); animation: rays 14s ease-in-out infinite alternate; will-change: transform, opacity; }
@keyframes rays { from { transform: translateX(-50px); opacity: .5; } to { transform: translateX(50px); opacity: 1; } }
/* Suciedad */
#tank::after { content: ""; position: absolute; inset: 0; background: #4f6b1d; opacity: var(--dirt, 0); transition: opacity 1.2s; pointer-events: none; z-index: 205; }
#night { position: absolute; inset: 0; z-index: 210; pointer-events: none; background: linear-gradient(rgba(6,14,60,.62), rgba(8,10,40,.7)); opacity: 0; transition: opacity 2s; }

/* Peces */
.f { position: absolute; left: 0; top: 0; z-index: 200; cursor: pointer; will-change: transform; transform-origin: 50% 50%; transition: filter .3s; }
.f canvas { display: block; width: 100%; height: auto; }
.nm { position: absolute; left: 0; top: 0; z-index: 230; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px #000; background: rgba(0,0,0,.28); padding: 1px 7px; border-radius: 9px; white-space: nowrap; cursor: pointer; will-change: transform; }

/* Adornos */
.d { position: absolute; touch-action: none; cursor: grab; }
.d.drag { cursor: grabbing; filter: drop-shadow(0 6px 6px rgba(0,0,0,.3)); }
.d img { display: block; width: 100%; height: auto; transform-origin: 50% 100%; animation: sw 5s ease-in-out infinite alternate; pointer-events: none; }
@keyframes sw { from { transform: rotate(-2.2deg); } to { transform: rotate(2.2deg); } }

/* Burbujas */
.bub { position: absolute; bottom: -20px; width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.5); animation: up 7s linear infinite; pointer-events: none; will-change: transform; }
@keyframes up { to { transform: translateY(-420px); opacity: 0; } }

/* Bolitas de comida */
.pel { position: absolute; left: 0; top: 0; width: 10px; height: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe2ab, #c9792a); border: 1px solid #8a4a10; z-index: 150; pointer-events: none; }
.pel.veg { width: 9px; height: 7px; border-radius: 3px 6px 4px 6px; background: radial-gradient(circle at 35% 30%, #d4f59a, #3f9a35); border: 1px solid #2a6a22; }

/* Monedas y números */
.coin { position: absolute; width: 16px; height: 16px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3a0, #f5b800 60%, #b87300); border: 1px solid #8a5a00; z-index: 600; pointer-events: none; animation: cp 1.2s ease-out forwards; }
@keyframes cp { 0% { opacity: 1; transform: translate(0,0) scale(.6); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); } }
.coin.sud { background: rgba(255,255,255,.55); border: 1px solid rgba(255,255,255,.9); width: 12px; height: 12px; }
.cn { position: absolute; z-index: 620; color: #ffe28a; font-weight: 800; font-size: 13px; text-shadow: 0 1px 3px #000; pointer-events: none; animation: cp2 1.2s ease-out forwards; }
@keyframes cp2 { to { transform: translateY(-34px); opacity: 0; } }
.crn { position: absolute; z-index: 700; width: 40px; height: 40px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3a0, #f2b01e); border: 2px solid #b97a10; color: #7a4a00; font-weight: 800; font-size: 15px; display: flex; align-items: center; justify-content: center; cursor: pointer; top: -44px; animation: crf 7s linear forwards; box-shadow: 0 2px 4px rgba(0,0,0,.35); will-change: transform; }
@keyframes crf { to { transform: translateY(560px) rotate(240deg); } }
.crn.got { animation: none; transition: transform .35s, opacity .35s; transform: translateY(-30px) scale(1.5); opacity: 0; }

/* Huevos */
.egg { position: absolute; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }
.egg svg { width: 100%; height: auto; display: block; }
.egg.wt { animation: eg 1.4s ease-in-out infinite alternate; }
@keyframes eg { to { transform: rotate(7deg); } }

/* Cofre */
#chest { position: absolute; touch-action: none; cursor: grab; background: none; border: 0; padding: 0; transition: opacity .4s; }
#chest .cd { position: absolute; left: 50%; top: -8px; transform: translateX(-50%); background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; display: none; }
#chest .cb { position: relative; width: 100%; aspect-ratio: 412/266; }
#chest img { position: absolute; left: 0; width: 100%; display: block; pointer-events: none; }
#chest .bd { top: 26.3%; height: 73.7%; }
#chest .ld { top: 0; height: 29.3%; transform: translateY(38.5%); transform-origin: 50% 100%; transition: transform .55s cubic-bezier(.34,1.56,.64,1); }
#chest.open .ld { transform: translateY(0) rotate(-2deg); }
#chest.ready { animation: bounce 1s infinite; }
#chest.open { animation: none; }
@keyframes bounce { 50% { transform: translateY(-10px) scale(1.1); } }

/* ---------- Botones sobre la pecera ---------- */
#tl { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 6px; z-index: 900; max-width: calc(100% - 170px); }
#tr { position: absolute; top: 8px; right: 8px; display: flex; gap: 6px; z-index: 900; }
#cln, #wtr { height: 44px; border-radius: 22px; border: 0; background: var(--glass); color: #fff; font-weight: 700; font-size: 13px; padding: 0 12px; display: flex; align-items: center; gap: 6px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#cln { padding-left: 10px; }
#wtr { font-size: 12px; }
#cln, #wtr { white-space: nowrap; }
#wtr.bad { background: rgba(200,50,40,.85); }
.circ { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--glass); display: flex; align-items: center; justify-content: center; padding: 0; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#tl button:active, .circ:active { transform: scale(.92); }
#wh:not(.rd) svg { opacity: .55; }
#wh.rd::after { content: ""; position: absolute; top: 2px; right: 2px; width: 11px; height: 11px; border-radius: 50%; background: #ff3b30; border: 2px solid #fff; }

/* Aviso */
#msg { position: absolute; bottom: 14px; left: 50%; width: max-content; max-width: calc(100% - 24px); z-index: 990; text-align: center; background: rgba(8,30,48,.82); color: #fff; border-radius: 22px; padding: 10px 16px; box-shadow: 0 6px 18px rgba(0,0,0,.35), inset 0 0 0 1px rgba(255,255,255,.15); font-size: 14px; font-weight: 600; opacity: 0; transform: translate(-50%, 12px) scale(.96); transition: opacity .25s, transform .25s cubic-bezier(.2,.9,.3,1.3); pointer-events: none; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
#msg.on { opacity: 1; transform: translate(-50%, 0); }

/* Paneles flotantes dentro de la pecera */
.panel { position: absolute; left: 50%; top: 60px; width: min(300px, 90%); z-index: 940; background: var(--panel); color: #fff; border-radius: 20px; border: 1px solid rgba(255,255,255,.14); padding: 14px 16px; font-size: 13px; box-shadow: var(--sombra); max-height: calc(100% - 72px); overflow: auto; opacity: 0; pointer-events: none; transform: translate(-50%, -8px) scale(.97); transition: opacity .2s, transform .2s; }
.panel.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.panel .tt { font-size: 16px; display: block; padding-right: 36px; }
.panel .fx { float: right; width: 36px; height: 36px; margin: -6px -8px 0 6px; border: 0; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-size: 17px; }
.panel .rn { display: block; margin-top: 10px; border: 0; border-radius: 12px; min-height: 44px; padding: 10px 12px; background: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: 14px; width: 100%; }
.panel .rn.sec { background: rgba(255,255,255,.18); color: #fff; }
.panel .rn.peligro { background: var(--bad); color: #fff; }
.panel .rn:disabled { opacity: .4; }
.panel .rn:active:not(:disabled) { transform: scale(.98); }
.panel .fl, .fl { margin-top: 8px; }
.pq { font-size: 12px; margin-top: 3px; line-height: 1.35; }
.op { opacity: .75; }
.dzb { margin-top: 10px; padding: 10px; border-radius: 12px; background: rgba(255,90,79,.2); }
.bar2 { height: 9px; border-radius: 6px; background: rgba(255,255,255,.2); overflow: hidden; margin: 4px 0 8px; }
.bar2 i { display: block; height: 100%; transition: width .4s; }

.flot { position: absolute; left: 8px; right: 8px; top: 60px; z-index: 945; display: flex; gap: 6px; align-items: center; background: var(--panel); color: #fff; border-radius: 16px; padding: 8px 10px; font-size: 13px; box-shadow: var(--sombra); opacity: 0; pointer-events: none; transform: translateY(-8px); transition: opacity .2s, transform .2s; }
.flot.on { opacity: 1; pointer-events: auto; transform: none; }
.flot b, .flot span { flex: 1; min-width: 0; }
.flot button { border: 0; border-radius: 12px; min-height: 40px; padding: 8px 12px; background: var(--acc); color: var(--acc-ink); font-weight: 700; font-size: 13px; }
.flot .x2, .flot .n { background: rgba(255,255,255,.18); color: #fff; }

/* ---------- Botones principales ---------- */
.btns { display: flex; gap: 8px; padding: 10px 10px 6px; }
button.b { flex: 1; min-height: 48px; padding: 12px 6px; border: 0; border-radius: 16px; background: linear-gradient(180deg, #ffc04d, #ff9f1c 55%, #f28a0c); color: #2b1a00; font-size: 15px; font-weight: 800; transition: transform .12s, filter .12s; box-shadow: 0 4px 0 #c46a00, 0 6px 12px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.5); }
button.b:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #c46a00, 0 2px 4px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.5); }
button.b:disabled { opacity: .45; }
.btns .b { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 13px; padding: 8px 2px; min-width: 0; min-height: 60px; }
.btns .b .ic { font-size: 22px; line-height: 24px; height: 30px; width: 30px; border-radius: 50%; background: rgba(255,255,255,.4); display: flex; align-items: center; justify-content: center; }
.btns .b img { height: 24px; }
.extra { display: flex; justify-content: center; gap: 8px; padding: 0 10px 10px; }
.extra .b.s { flex: none; min-height: 40px; padding: 8px 14px; font-size: 13px; background: rgba(255,255,255,.14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.extra .b.s:active { transform: scale(.97); }
.meter { flex: 0 0 84px; display: flex; flex-direction: column; justify-content: center; gap: 5px; color: #fff; font-size: 11px; }
.mt { display: flex; justify-content: space-between; font-weight: 700; }
.mb { position: relative; height: 14px; background: rgba(255,255,255,.2); border-radius: 8px; overflow: hidden; }
.mb i { display: block; height: 100%; width: 0; transition: width .5s, background .5s; }
.mb u { position: absolute; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,.35); }
.mb u:nth-of-type(1) { left: 33.3%; } .mb u:nth-of-type(2) { left: 66.6%; }

/* ---------- Hoja inferior ---------- */
#modal { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,0); display: none; align-items: flex-end; justify-content: center; transition: background .25s; }
#modal.on { background: rgba(0,0,0,.55); }
#sheet { background: var(--card); color: var(--ink); width: 100%; max-width: 520px; max-height: 82%; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-radius: 22px 22px 0 0; padding: 6px 16px 16px; padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.8,.2,1); box-shadow: 0 -10px 30px rgba(0,0,0,.25); touch-action: pan-y; }
#sheet.alta { max-height: 94%; }
#modal.on #sheet { transform: none; }
#sheet .asa { width: 42px; height: 5px; border-radius: 3px; background: var(--soft); margin: 4px auto 8px; }
#sheet .x { float: right; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); font-size: 18px; margin: -2px 0 0 8px; }
.h2 { font-size: 19px; font-weight: 800; letter-spacing: -.2px; }
.saldo { font-weight: 700; color: var(--mut); }
.nota { color: var(--mut); font-size: 13px; margin: 6px 0; line-height: 1.4; }
.aviso { margin: 8px 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; }
.aviso.am { background: #ffd54a33; } .aviso.rs { background: #ff6fa526; }
.tabs { display: flex; gap: 6px; margin: 12px 0 6px; overflow-x: auto; scrollbar-width: none; position: sticky; top: -6px; background: var(--card); padding: 6px 0; z-index: 2; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: 1 0 auto; white-space: nowrap; min-height: 40px; padding: 8px 14px; border: 0; border-radius: 20px; background: var(--soft); color: var(--ink); font-size: 13px; font-weight: 700; transition: background .2s, transform .1s; }
.tabs button:active { transform: scale(.96); }
.tabs .on { background: linear-gradient(180deg, #ffc04d, #ff9f1c); color: #2b1a00; font-weight: 800; box-shadow: 0 2px 6px rgba(255,159,28,.4); }
.it { display: flex; align-items: center; gap: 10px; padding: 9px 10px; margin: 7px 0; border-radius: 16px; background: rgba(136,136,136,.08); box-shadow: inset 0 0 0 1px var(--line); }
.it .e { flex: 0 0 62px; width: 62px; height: 50px; border-radius: 12px; background: radial-gradient(circle at 50% 40%, rgba(79,195,247,.22), rgba(79,195,247,.05)); display: flex; align-items: center; justify-content: center; font-size: 30px; }
.it .e img, .it .e svg { max-width: 100%; max-height: 100%; width: auto; height: 100%; object-fit: contain; }
.it .e > svg { width: 100%; }
.it .t { flex: 1; font-size: 14px; font-weight: 600; min-width: 0; }
.it small { color: var(--mut); display: block; font-weight: 400; font-size: 12.5px; margin-top: 1px; }
.it button { flex: none; border: 0; border-radius: 14px; min-height: 42px; min-width: 78px; padding: 8px 12px; background: linear-gradient(180deg, #ffc04d, #ff9f1c); color: #2b1a00; font-weight: 800; font-size: 14px; box-shadow: 0 3px 0 #c46a00; }
.it button:disabled { opacity: 1; background: var(--soft); color: var(--mut); box-shadow: none; }
.it.bloq .e img { filter: grayscale(.8) brightness(.9); opacity: .6; }
.it.bloq .t { opacity: .7; }
.it button:active:not(:disabled) { transform: scale(.95); }
.hs { margin: 16px 0 2px; font-weight: 800; font-size: 12.5px; letter-spacing: .3px; color: var(--mut); text-transform: uppercase; }
.mi { display: flex; gap: 2px; align-items: center; justify-content: center; }
.mi img { height: 26px !important; width: auto !important; max-width: 32px; }

/* Pase de batalla */
.bpr .on { outline: 2px solid var(--acc); border-radius: 12px; padding-left: 6px; padding-right: 6px; }
.bpr .ok { opacity: .55; }
.bpbar { height: 10px; border-radius: 6px; background: var(--soft); overflow: hidden; margin: 6px 0 10px; }
.bpbar i { display: block; height: 100%; background: var(--acc); }

/* Relaciones */
.rl { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rl .pr { display: flex; flex: 0 0 auto; }
.rl .pr i { display: block; width: 54px; height: 42px; }
.rl .pr i + i { margin-left: 4px; }
.rl .pr img { width: 100%; height: 100%; object-fit: contain; display: block; }
.rl .tx { flex: 1; min-width: 0; font-size: 14px; }
.rl .tx .nn { font-size: 13.5px; line-height: 1.3; }
.rl .tx small { display: flex; justify-content: space-between; color: var(--mut); font-size: 12px; margin-top: 3px; }
.rl .hr { color: #ff6fa5; letter-spacing: 1px; }
.rl .hr u { text-decoration: none; opacity: .25; }
.rl .eg { font-size: 12px; color: #e2467f; margin-top: 3px; font-weight: 700; }
.seg4 { display: flex; gap: 3px; margin: 5px 0 0; }
.seg4 b { flex: 1; height: 9px; border-radius: 5px; background: var(--soft); overflow: hidden; display: block; }
.seg4 i { display: block; height: 100%; background: #ff6fa5; }

/* Elegir comida */
.fchs { display: flex; gap: 14px; margin: 16px 0 6px; justify-content: center; }
.fch { width: 138px; height: 138px; border-radius: 20px; border: 0; background: var(--acc); color: var(--acc-ink); font-weight: 800; font-size: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 4px 0 rgba(0,0,0,.18); }
.fch:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.fch img { height: 62px; width: auto; }
.fch small { font-size: 12px; font-weight: 700; opacity: .8; }
.fch .pg { display: grid; grid-template-columns: repeat(3, 16px); gap: 5px; height: 62px; align-content: center; }
.fch .pel { position: static; width: 16px; height: 16px; display: block; }

/* Ayuda */
.tut details { border-top: 1px solid var(--line); padding: 10px 2px; }
.tut summary { font-weight: 800; font-size: 15px; cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px; min-height: 32px; }
.tut summary::-webkit-details-marker { display: none; }
.tut summary::after { content: "›"; margin-left: auto; font-size: 22px; transition: transform .2s; color: var(--mut); }
.tut details[open] summary::after { transform: rotate(90deg); }
.tut .ti { font-size: 20px; }
.tut p, .tut li { font-size: 14px; line-height: 1.45; margin: 6px 0 0; }
.tut ul { margin: 4px 0 0; padding-left: 18px; }

/* Ruleta */
.whbg { position: relative; background: radial-gradient(circle at 50% 45%, rgba(255,213,74,.28), transparent 62%); margin: 0 -16px; padding: 0 16px; }
.whw { position: relative; width: min(310px, 84vw, calc(100dvh - 360px)); min-width: 200px; aspect-ratio: 1; margin: 24px auto 8px; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.whw svg { width: 100%; height: 100%; display: block; }
.whw .rot { transition: transform 4.2s cubic-bezier(.12,.7,.12,1); }
.whw .bl { animation: blk 1s steps(1) infinite; }
.whw .bl.b2 { animation-delay: .5s; }
.whw.sp .bl { animation-duration: .25s; }
.whw.sp .b2 { animation-delay: .125s; }
@keyframes blk { 50% { opacity: .35; } }
.whw .pt { position: absolute; left: 50%; top: -14px; transform: translateX(-50%); width: 34px; height: 42px; z-index: 2; filter: drop-shadow(0 3px 2px rgba(0,0,0,.45)); }
.whinfo { position: absolute; top: 2px; right: 16px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 2px solid #8b5a2b; background: linear-gradient(135deg, #fff7c9, #f2b01e); color: #5a3410; font-weight: 800; font-size: 20px; font-family: Georgia, serif; font-style: italic; display: flex; align-items: center; justify-content: center; padding: 0; box-shadow: 0 2px 5px rgba(0,0,0,.35); }
#whr { text-align: center; min-height: 48px; font-weight: 700; font-size: 15px; }
#whb { display: block; width: 100%; border: 0; border-radius: 14px; min-height: 52px; padding: 13px; background: var(--acc); color: var(--acc-ink); font-weight: 800; font-size: 17px; margin-top: 6px; box-shadow: 0 3px 0 rgba(0,0,0,.18); }
#whb:disabled { opacity: .55; }
.whd { position: fixed; top: 58%; transform: translateY(-50%); left: 7%; right: 7%; max-width: 480px; margin: 0 auto; max-height: min(64vh, 440px); font-size: 12px; z-index: 6; overflow: auto; border-radius: 16px; background: var(--card); box-shadow: 0 0 0 2px #8b5a2b, 0 8px 20px rgba(0,0,0,.4); padding: 8px 12px; }
.whd[hidden] { display: none; }
.whx { position: sticky; float: right; top: 0; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); color: var(--ink); font-size: 16px; margin-left: 6px; }
.whdt { display: block; padding: 4px 0 6px; font-size: 13px; }
.whi { display: flex; gap: 8px; align-items: center; padding: 5px 0; border-top: 1px solid var(--line); }
.whi .sw { flex: 0 0 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
.whi b { display: block; font-size: 12.5px; }
.whi small { display: block; font-size: 11px; color: var(--mut); line-height: 1.3; margin-top: 1px; }

/* ---------- Ventanas centradas ---------- */
.caja { position: fixed; inset: 0; z-index: 1200; background: rgba(0,0,0,0); display: none; align-items: center; justify-content: center; padding: 16px; transition: background .2s; }
.caja.on { background: rgba(0,0,0,.55); }
.caja .card { background: var(--card); color: var(--ink); padding: 18px; border-radius: 20px; width: min(340px, 100%); max-height: 90%; overflow: auto; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--sombra); opacity: 0; transform: scale(.94); transition: opacity .2s, transform .2s; }
.caja.on .card { opacity: 1; transform: none; }
.caja small { color: var(--mut); font-size: 12.5px; line-height: 1.4; }
.caja .b.g { background: var(--soft); color: var(--ink); box-shadow: none; }
.caja .dos { display: flex; gap: 8px; }
.caja .dos .b { font-size: 14px; }
#qtx { margin: 0; font-size: 15px; line-height: 1.45; }
#ninp { font-size: 18px; padding: 12px; border-radius: 12px; border: 2px solid rgba(136,136,136,.35); background: transparent; color: var(--ink); user-select: text; -webkit-user-select: text; width: 100%; }
#bta { font-size: 12px; padding: 10px; border-radius: 12px; border: 2px solid rgba(136,136,136,.35); background: transparent; color: var(--ink); user-select: text; -webkit-user-select: text; width: 100%; resize: none; font-family: ui-monospace, Menlo, monospace; }

/* Menos movimiento si el usuario lo pide en su móvil */
@media (prefers-reduced-motion: reduce) {
  #fondo, #tank::before, .bub { animation: none; }
}

/* Cambio de dirección */
#mudanza { position: fixed; left: 0; right: 0; top: 0; z-index: 2000; background: var(--acc); color: #222; padding: 12px 14px; padding-top: calc(12px + env(safe-area-inset-top, 0px)); text-align: center; font-weight: 700; font-size: 14px; border: 0; width: 100%; box-shadow: var(--sombra); }
.pasos { margin: 0; padding-left: 20px; font-size: 13.5px; line-height: 1.45; }
.pasos li + li { margin-top: 4px; }

/* Contador de monedas en la tienda */
.saldo { display: inline-block; margin-left: 4px; padding: 3px 10px; border-radius: 14px; background: rgba(255,200,60,.2); color: var(--ink); font-weight: 800; }
/* Ficha del pez: dibujo arriba */
.panel .cab { display: flex; align-items: center; gap: 10px; }
.panel .cab img { width: 64px; height: 48px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(0,0,0,.4)); }
