/* Jewell Shooot — estilo de la línea Shhhot: fondo #17132B, coral, amarillo y verde,
   Russo One para la marca y Varela Round para el resto. 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; --cell2: #28234A;
  --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; }
.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 { overflow: hidden; text-overflow: ellipsis; }
.brand.small b { font-size: 16px; display: block; }
.brand.small small { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.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; }
.pill { background: var(--panel); border: 2px solid var(--line); border-radius: 999px; padding: 7px 12px; font-family: "Russo One"; font-size: 13px; color: var(--yellow); white-space: nowrap; 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; justify-content: center; padding: 8px 20px 0; min-height: 0; overflow-y: auto; }
.home-logo svg { width: min(200px, 26vh); height: auto; }
h1 { font-size: clamp(34px, 11vw, 46px); line-height: 1; margin: 2.4vh 0 0; }
.lema { margin: 10px 0 0; color: var(--muted); font-size: 16px; text-align: center; }
.gem-row { display: flex; gap: 2px; margin: 2.4vh 0 2.8vh; }
.gem-row img { width: min(52px, 13vw); height: min(52px, 13vw); display: block; }
.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; }
.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; }
.firma { text-align: center; margin: 0; padding: 10px 0 14px; color: #8C85B5; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; flex: none; }

/* vitrina */
.map-body { flex: 1; overflow-y: auto; padding: 14px 14px 24px; -webkit-overflow-scrolling: touch; }
.coll { background: var(--panel); border: 2px solid var(--line); border-radius: 24px; padding: 14px 12px 16px; margin-bottom: 16px; }
.coll h2 { margin: 0; font-size: 20px; }
.coll h2 span { color: var(--yellow); }
.coll > small { margin: 3px 0 12px; }
.sets { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.setting { aspect-ratio: 1; border-radius: 50%; background: var(--bg); border: 3px solid #6A5A2E; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; font-family: "Russo One"; font-size: 16px; color: #fff; }
.setting.locked { border-color: var(--line); color: #7D76A6; }
.setting.locked svg { width: 15px; height: 15px; position: absolute; bottom: 14%; opacity: .7; }
.setting.locked span { transform: translateY(-5px); }
.setting.cur { border-color: var(--yellow); animation: pulse 1.6s ease-in-out infinite; }
.setting.done { border-color: #D9A22B; background: radial-gradient(circle at 35% 30%, #3A3160, var(--bg)); }
.setting.done img { width: 78%; height: 78%; margin-top: -8%; }
.setting.done i { position: absolute; top: 2px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 10px; color: var(--muted); background: var(--bg); border-radius: 8px; padding: 0 5px; line-height: 14px; }
.setting .st { position: absolute; bottom: -5px; display: flex; gap: 0; background: var(--bg); border-radius: 8px; padding: 1px 3px; }
.setting .st svg { width: 11px; height: 11px; color: #4A4272; }
.setting .st svg.on { color: var(--yellow); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 208, 96, .5); } 50% { box-shadow: 0 0 0 7px rgba(245, 208, 96, 0); } }

/* partida */
.game-top { gap: 8px; }
.panel { margin: 10px 12px 0; background: var(--panel); border: 2px solid var(--line); border-radius: 22px; display: flex; align-items: stretch; padding: 8px 12px; gap: 12px; flex: none; }
.mov { text-align: center; padding-right: 12px; border-right: 2px solid var(--line); display: flex; flex-direction: column; justify-content: center; min-width: 86px; }
.mov b { font-size: 36px; line-height: 1; margin-top: 3px; display: block; }
.mov b.low { color: var(--coral); }
.obj { flex: 1; min-width: 0; }
.obj-row { display: flex; gap: 6px; margin-top: 3px; }
.goal { flex: 1; max-width: 86px; display: flex; flex-direction: column; align-items: center; background: var(--bg); border-radius: 14px; padding: 3px 4px 5px; position: relative; }
.goal img { width: 38px; height: 38px; display: block; }
.goal .gs { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--yellow); }
.goal .gs svg { width: 28px; height: 28px; }
.goal i { font-style: normal; font-family: "Russo One"; font-size: 14px; line-height: 1.1; }
.goal.ok i { color: var(--teal); }
.goal.ok i svg { width: 16px; height: 16px; display: block; }
.goal.bump { animation: bump .3s; }
@keyframes bump { 40% { transform: scale(1.14); } }
.points { margin: 9px 16px 0; display: flex; align-items: center; gap: 12px; flex: none; }
.points b { font-size: 17px; color: var(--yellow); min-width: 70px; }
.bar { flex: 1; height: 12px; border-radius: 999px; background: var(--panel); border: 2px solid var(--line); position: relative; margin-right: 8px; }
.bar span { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--teal), var(--yellow)); transition: width .35s; }
.bar em { position: absolute; top: -7px; margin-left: -9px; line-height: 0; color: #4A4272; }
.bar em svg { width: 18px; height: 18px; }
.bar em.on { color: var(--yellow); }
.tip { margin: 8px 12px 0; background: #2F2A55; border: 2px solid var(--line); border-radius: 16px; padding: 9px 12px; font-size: 14px; line-height: 1.35; color: #EDEAFF; flex: none; }
.tip.arm { background: var(--p-yellow); color: var(--ink); border-color: var(--yellow); text-align: center; }

.board-wrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 4px; }
.board { position: relative; background: var(--panel); border: 2px solid var(--line); border-radius: 22px; touch-action: none; }
.cells, .pieces, .fx { position: absolute; left: 6px; top: 6px; }
.pieces { overflow: hidden; }
.fx { pointer-events: none; overflow: hidden; }
.cell { position: absolute; border-radius: 22%; background: var(--cell); }
.cell.alt { background: var(--cell2); }
.cell .rock { position: absolute; inset: 0; background-size: 100% 100%; }
.cell .rock.crack { animation: crack .28s; }
@keyframes crack { 50% { transform: scale(1.12); filter: brightness(1.6); } }
.pc { position: absolute; left: 0; top: 0; will-change: transform; pointer-events: none; }
.pc .sp { position: absolute; inset: 0; background-size: 100% 100%; background-repeat: no-repeat; transition: transform .16s, opacity .16s; }
.pc.sel .sp { animation: sel .7s ease-in-out infinite; }
.pc.hint .sp { animation: hint .9s ease-in-out infinite; }
.pc.pop .sp { animation: pop .26s; }
.pc.out .sp { transform: scale(.2); opacity: 0; }
.pc.shake .sp { animation: shake .3s; }
@keyframes sel { 50% { transform: scale(1.14); } }
@keyframes hint { 0%, 100% { transform: scale(1); } 30% { transform: scale(1.12) rotate(-6deg); } 60% { transform: scale(1.12) rotate(6deg); } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.22); } 100% { transform: scale(1); } }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.board.arming .pc .sp { filter: drop-shadow(0 0 3px #fff); }
.beam { position: absolute; background: linear-gradient(90deg, rgba(255, 255, 255, 0), #fff 20%, #FFF3B0 50%, #fff 80%, rgba(255, 255, 255, 0)); border-radius: 999px; animation: beam .36s ease-out forwards; }
.beam.v { background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 20%, #FFF3B0 50%, #fff 80%, rgba(255, 255, 255, 0)); }
@keyframes beam { 0% { opacity: 0; transform: scale(.2); } 30% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1); } }
.ring { position: absolute; border-radius: 50%; border: 6px solid #fff; box-shadow: 0 0 18px #FFF3B0, inset 0 0 18px #FFF3B0; animation: ringa .4s ease-out forwards; }
@keyframes ringa { 0% { opacity: 1; transform: scale(.2); } 100% { opacity: 0; transform: scale(1); } }
.flash { position: absolute; inset: 0; background: #fff; animation: flasha .4s ease-out forwards; }
@keyframes flasha { 0% { opacity: .55; } 100% { opacity: 0; } }
.pts { position: absolute; font-family: "Russo One"; font-size: 15px; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .5); animation: ptsa .7s ease-out forwards; white-space: nowrap; transform: translate(-50%, -50%); }
@keyframes ptsa { 0% { opacity: 0; margin-top: 6px; } 20% { opacity: 1; } 100% { opacity: 0; margin-top: -22px; } }
#fly { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#fly img { position: absolute; left: 0; top: 0; will-change: transform; }

.boosters { display: flex; justify-content: center; gap: 12px; padding: 10px 12px 14px; flex: none; }
.boo { width: 94px; height: 66px; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; position: relative; box-shadow: 0 5px 0 rgba(0, 0, 0, .28); color: var(--ink); transition: transform .08s; }
.boo svg { width: 24px; height: 24px; }
.boo small { color: var(--ink); font-size: 12px; }
.boo i { position: absolute; top: -8px; right: -6px; background: #fff; color: var(--ink); font-style: normal; font-family: "Russo One"; font-size: 13px; min-width: 26px; height: 26px; border-radius: 13px; display: flex; align-items: center; justify-content: center; border: 2px solid var(--ink); }
.boo.c1 { background: var(--p-coral); } .boo.c2 { background: var(--p-yellow); } .boo.c3 { background: var(--p-teal); }
.boo.armed { transform: translateY(-5px); outline: 3px solid #fff; }
.boo.empty { opacity: .45; }

/* hojas (ventanas) */
.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 .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 .gemfin { width: 96px; height: 96px; }
.toggle { min-width: 64px; height: 40px; border-radius: 999px; background: var(--bg); border: 2px solid var(--line); font-family: "Russo One"; font-size: 13px; color: var(--muted); padding: 0 12px; }
.toggle.on { background: var(--p-teal); color: var(--ink); border-color: var(--p-teal); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.toast { position: absolute; left: 50%; bottom: 110px; 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; }

@media (max-height: 640px) {
  .top { min-height: 52px; padding-top: 6px; }
  .panel { margin-top: 6px; padding: 5px 10px; }
  .mov b { font-size: 28px; }
  .goal img, .goal .gs { width: 30px; height: 30px; }
  .boo { height: 54px; } .boo svg { width: 20px; height: 20px; }
  .boosters { padding: 6px 12px 10px; }
  .tip { font-size: 13px; padding: 6px 10px; }
  .btn { min-height: 50px; margin-bottom: 10px; }
}
@media (max-width: 400px) {
  .game-top { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .brand.small b { font-size: 14px; }
  .brand.small small { font-size: 10px; }
  .pill { padding: 6px 9px; font-size: 12px; }
}
@media (max-width: 345px) {
  .brand.small > div { display: none; }
  .langs button { min-width: 32px; }
  .brand b { font-size: 16px; }
}
/* móvil tumbado: marcadores a la izquierda y tablero a la derecha */
@media (orientation: landscape) and (max-height: 520px) {
  #app { max-width: 940px; }
  #scr-game.on { display: grid; grid-template-columns: minmax(240px, 1fr) auto; grid-template-rows: auto auto auto 1fr auto; column-gap: 4px; }
  #scr-game .game-top, #scr-game .panel, #scr-game .points, #scr-game .tip, #scr-game .boosters { grid-column: 1; min-width: 0; }
  #scr-game .tip { align-self: start; font-size: 12px; overflow: hidden; }
  #scr-game .boosters { grid-row: 5; }
  #scr-game .board-wrap { grid-column: 2; grid-row: 1 / span 5; width: min(100vh, 56vw); width: min(100dvh, 56vw); height: 100%; padding: 4px; }
  .boo { width: 76px; }
  .home-logo, .gem-row { display: none; }
  h1 { font-size: 30px; margin-top: 0; }
  .lema { margin: 4px 0 10px; font-size: 14px; }
  .firma { padding: 4px 0 8px; }
  .toast { bottom: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .setting.cur, .pc.sel .sp, .pc.hint .sp { animation: none; }
}
