/* ============ CLICK METAL BAND — UI oscura metal (mobile-first) ============ */
:root {
  --ink: #07060a;            /* contorno casi negro */
  --bg: #0d0c11;             /* fondo global */
  --panel: #17151d;          /* paneles */
  --panel-hi: #221f2b;       /* borde superior iluminado */
  --row-hi: #211e2a;         /* filas (arriba) */
  --row-lo: #141218;         /* filas (abajo) */
  --line: #2e2a3a;           /* líneas sutiles */
  --gold: #f0c030;
  --gold-bright: #ffd970;
  --text-dim: #9a94a8;       /* gris lavanda */
  --purple-hi: #9a6cf8;      /* botones */
  --purple-lo: #5c2ed0;
  --purple-ink: #241448;
  --purple-txt: #b8a0f8;     /* +X/s */
  --red: #f03a2c;
  --fire: #ff8030;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; max-width: 100%; overflow-x: hidden; }

body {
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 50% -10%, rgba(122,74,224,.14), transparent 55%),
    radial-gradient(ellipse at 50% 115%, rgba(255,128,48,.08), transparent 50%);
  color: #fff;
  font-family: 'Trebuchet MS', 'Segoe UI', Verdana, sans-serif;
  overflow: hidden;
  height: 100%;
  height: 100dvh;
  display: flex; flex-direction: column;
}

button { font-family: inherit; cursor: pointer; touch-action: manipulation; border: none; background: none; }

.hidden { display: none !important; }

/* texto con contorno */
.o-text, .m-name, .up-name, .play-lbl, #modal h3 {
  color: #fff;
  text-shadow:
    -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink),
    -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink),
    0 3px 4px rgba(0,0,0,.45);
}

/* ============ Cabecera ============ */
#topbar {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 7px 10px;
  background: linear-gradient(180deg, #16131d, #0f0d14);
  border-bottom: 2.5px solid #000;
  box-shadow: inset 0 1px 0 var(--line), 0 4px 14px rgba(0,0,0,.5);
}

#lvl-box { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lvl-skull {
  font-size: 24px;
  filter: drop-shadow(0 0 6px rgba(154,108,248,.6));
}
.lvl-info small {
  display: block; font-size: 8.5px; font-weight: 900; letter-spacing: 1px;
  color: var(--text-dim);
}
.lvl-info b { font-size: clamp(15px, 4vw, 19px); font-weight: 900; color: #fff; line-height: 1.05; }
.lvl-bar {
  width: 76px; height: 6px; margin-top: 2px;
  background: #0a090e; border: 1.5px solid #000; border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.8);
}
#legend-xp {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #7a4ae0, var(--purple-hi));
  box-shadow: 0 0 6px rgba(154,108,248,.8);
  transition: width .3s;
}

#hud-gold { text-align: center; }
.gold-line { display: flex; align-items: center; justify-content: center; gap: 5px; }
.gold-line .coin { font-size: 19px; filter: drop-shadow(0 0 6px rgba(240,192,48,.6)); }
#gold-amount {
  font-size: clamp(19px, 5.4vw, 27px); font-weight: 900; color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(240,192,48,.4), 0 2px 3px rgba(0,0,0,.9);
  line-height: 1;
}
#gold-rate {
  display: block;
  color: var(--gold); font-size: clamp(10px, 2.7vw, 12.5px); font-weight: 700;
  opacity: .92;
}

.top-pills { display: flex; gap: 6px; align-items: center; }
.res-pill {
  display: flex; align-items: center; gap: 5px;
  background: linear-gradient(180deg, #1e1b26, #131118);
  border: 2px solid #000;
  border-radius: 11px;
  padding: 5px 10px;
  box-shadow: inset 0 1px 0 var(--line), 0 2px 5px rgba(0,0,0,.4);
  color: #fff;
}
.res-pill span { font-size: 14px; }
.res-pill b { font-size: clamp(11px, 3vw, 14px); font-weight: 900; color: var(--gold-bright); }
.res-pill.gear { font-size: 16px; padding: 5px 9px; position: relative; }
#playrow .tab-card { min-height: 58px; align-self: stretch; justify-content: center; }
.res-pill:active { transform: translateY(1.5px); }

/* ============ El concierto ============ */
#stage-wrap {
  position: relative; z-index: 30;
  flex: 0 0 auto;
  display: flex; justify-content: center;
  padding: 8px 8px 4px;
  max-width: 100%; overflow: hidden;
}
/* El marco del concierto no puede estirarse por culpa de un texto largo:
   se queda en el ancho disponible y lo que sobre se recorta con puntos suspensivos. */
#stage-frame { position: relative; max-width: 100%; min-width: 0; }
#stagecanvas {
  display: block;
  height: min(40vh, 55vw);
  width: auto;
  max-width: 100%;
  background: #0d0c12;
  border: 3px solid #000;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 2px rgba(154,108,248,.12),
    0 0 26px rgba(122,74,224,.22),
    0 10px 28px rgba(0,0,0,.6);
}

/* venue */
#venue-overlay {
  position: absolute; left: 10px; bottom: 10px;
  background: linear-gradient(180deg, rgba(20,17,28,.92), rgba(10,9,14,.92));
  border: 2px solid #000;
  border-radius: 11px;
  padding: 6px 11px;
  max-width: 66%;
  box-shadow: inset 0 1px 0 var(--line), 0 3px 8px rgba(0,0,0,.5);
}
#venue-name {
  font-size: clamp(12px, 3.2vw, 15px); color: var(--gold-bright); font-weight: 900;
  text-shadow: 0 2px 3px rgba(0,0,0,.8); margin-bottom: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#venue-progress-wrap {
  height: 8px; background: #0a090e; border: 1.5px solid #000;
  border-radius: 5px; overflow: hidden;
}
#venue-progress {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #c8901f, var(--gold-bright));
  box-shadow: 0 0 8px rgba(240,192,48,.7);
  transition: width .3s;
}
#venue-next {
  font-size: clamp(10px, 2.6vw, 11px); color: var(--text-dim); margin-top: 3px; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

#frenzy-banner {
  position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
  padding: 5px 16px; border-radius: 20px;
  background: linear-gradient(180deg, #f05028, #a02010);
  border: 2.5px solid #000;
  color: #fff8d0; font-weight: 900; font-size: clamp(12px, 3.2vw, 16px);
  white-space: nowrap;
  text-shadow: 0 2px 2px rgba(0,0,0,.5);
  box-shadow: 0 0 22px rgba(255,110,40,.75);
  animation: pulse 0.5s infinite alternate;
  pointer-events: none;
}
@keyframes pulse { from { transform: translateX(-50%) scale(1); } to { transform: translateX(-50%) scale(1.07); } }

/* pastillas sobre el escenario (multiplicador y caché) */
.stage-pill {
  position: absolute; top: 8px;
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(180deg, rgba(20,17,28,.88), rgba(10,9,14,.88));
  border: 2px solid #000;
  border-radius: 11px;
  padding: 4px 9px;
  box-shadow: inset 0 1px 0 var(--line), 0 3px 8px rgba(0,0,0,.5);
  pointer-events: none;
}
.stage-pill.left { left: 8px; }
.stage-pill.right { right: 8px; }
/* la pastilla del caché es un botón: ¡HACER BOLO! */
#btn-gig { pointer-events: auto; cursor: pointer; text-align: left; }
#btn-gig:active { transform: translateY(1.5px); }
#btn-gig.ready {
  border-color: var(--gold);
  animation: gigpulse .9s ease-in-out infinite alternate;
}
#btn-gig.ready b { color: #fff; }
@keyframes gigpulse {
  from { box-shadow: inset 0 1px 0 var(--line), 0 3px 8px rgba(0,0,0,.5), 0 0 8px rgba(240,192,48,.35); }
  to   { box-shadow: inset 0 1px 0 var(--line), 0 3px 8px rgba(0,0,0,.5), 0 0 22px rgba(240,192,48,.95); }
}
.stage-pill > span { font-size: 14px; filter: drop-shadow(0 0 5px rgba(240,192,48,.5)); }
.stage-pill b {
  display: block;
  font-size: clamp(11px, 3vw, 14px); font-weight: 900; color: var(--gold-bright);
  line-height: 1.05; white-space: nowrap;
}
.stage-pill small {
  display: block;
  font-size: 6.5px; font-weight: 900; letter-spacing: .7px;
  color: var(--text-dim);
}

/* ============ Fila de acción: TOCAR ardiente + pastillas ============ */
#playrow {
  flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; max-width: 760px; margin: 2px auto 0;
  padding: 4px 10px 6px;
}
.side-pill {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: linear-gradient(180deg, #1c1925, #121017);
  border: 2px solid #000;
  border-radius: 13px;
  padding: 8px 6px;
  box-shadow: inset 0 1px 0 var(--line), 0 3px 8px rgba(0,0,0,.4);
  min-width: 0;
}
.side-pill .sp-ico { font-size: 16px; filter: drop-shadow(0 0 5px rgba(240,192,48,.5)); }
.side-pill b {
  font-size: clamp(12px, 3.4vw, 16px); font-weight: 900; color: var(--gold-bright);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.side-pill small {
  font-size: 7.5px; font-weight: 900; letter-spacing: .8px; text-align: center;
  color: var(--text-dim); line-height: 1.25;
}

#btn-play {
  position: relative;
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 168px;
  padding: 12px 26px 10px;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,150,50,.28), transparent 60%),
    linear-gradient(180deg, #2c1410, #170b08);
  border: 3px solid var(--fire);
  box-shadow:
    0 0 22px rgba(255,128,48,.55),
    inset 0 0 16px rgba(255,110,30,.28),
    0 6px 0 rgba(0,0,0,.45);
  user-select: none; -webkit-user-select: none;
  transition: transform .05s, box-shadow .05s;
}
#btn-play:active {
  transform: translateY(4px);
  box-shadow: 0 0 26px rgba(255,150,60,.8), inset 0 0 18px rgba(255,110,30,.4), 0 1px 0 rgba(0,0,0,.45);
}
.fire-ring {
  position: absolute; inset: -7px;
  border-radius: 26px;
  background: radial-gradient(ellipse at 50% -20%, rgba(255,170,60,.35), transparent 55%);
  filter: blur(3px);
  pointer-events: none;
  animation: firewob 1.1s ease-in-out infinite alternate;
}
@keyframes firewob { from { opacity: .65; } to { opacity: 1; } }
.play-skull {
  position: absolute; top: -15px; left: 50%; transform: translateX(-50%);
  font-size: 19px;
  filter: drop-shadow(0 0 6px rgba(255,140,50,.9));
}
.play-lbl { font-size: clamp(19px, 5.2vw, 24px); font-weight: 900; letter-spacing: 1px; line-height: 1.05; }
.play-sub {
  font-size: clamp(10px, 2.8vw, 12px); font-weight: 900; color: var(--gold-bright);
  text-shadow: 0 1px 2px rgba(0,0,0,.8);
}

/* ============ Fichas de sección ============ */
#tabs-row {
  flex: 0 0 auto;
  display: flex; gap: 6px;
  width: 100%; max-width: 760px; margin: 2px auto 0;
  padding: 0 10px 6px;
}
.tab-card {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: linear-gradient(180deg, #1c1925, #121017);
  border: 2px solid #000;
  border-radius: 12px;
  padding: 8px 2px 6px;
  box-shadow: inset 0 1px 0 var(--line), 0 3px 7px rgba(0,0,0,.4);
}
.tab-card .tc-ico { font-size: 20px; filter: grayscale(.25) drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.tab-card .tc-lbl { font-size: 9.5px; font-weight: 900; letter-spacing: .8px; color: var(--text-dim); }
.tab-card.active {
  background: linear-gradient(180deg, #342659, #221740);
  border-color: #7a4ae0;
  box-shadow: inset 0 1px 0 rgba(184,160,248,.35), 0 0 14px rgba(122,74,224,.45);
}
.tab-card.active .tc-ico { filter: none; }
.tab-card.active .tc-lbl { color: #fff; }
.tab-card:active { transform: translateY(2px); }

/* ============ Contenido (lo único que scrollea) ============ */
#content {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  width: 100%;
  max-width: 760px; margin: 0 auto;
  padding: 8px 10px 30px;
}
#content::-webkit-scrollbar { width: 5px; }
#content::-webkit-scrollbar-thumb { background: #34304a; border-radius: 3px; }
#content { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }

.tabpane { display: none; }
.tabpane.active { display: block; animation: panein .18s ease; }
@keyframes panein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

.pane-hint { color: var(--text-dim); font-size: 12px; font-style: italic; }
.pane-hint b { color: var(--gold-bright); }
.ach-count { font-weight: 900; color: var(--gold-bright); }

#band-header {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
#buy-qty { display: flex; gap: 5px; }
.qty-btn {
  background: linear-gradient(180deg, #211e2a, #141218);
  border: 2px solid #000; color: var(--text-dim);
  border-radius: 10px; padding: 6px 11px; font-size: 12.5px; font-weight: 900;
  min-height: 36px;
  box-shadow: inset 0 1px 0 var(--line), 0 2px 5px rgba(0,0,0,.35);
}
.qty-btn.active {
  background: linear-gradient(180deg, #342659, #221740);
  color: #fff; border-color: #7a4ae0;
  box-shadow: inset 0 1px 0 rgba(184,160,248,.3), 0 0 10px rgba(122,74,224,.4);
}

/* ============ Filas oscuras (miembros y mejoras) ============ */
#members, #upgrades {
  display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 4px;
}

.member, .upgrade {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  background: linear-gradient(180deg, var(--row-hi), var(--row-lo));
  border: 2.5px solid #000;
  border-radius: 15px;
  padding: 9px 10px;
  text-align: left;
  min-height: 78px;
  box-shadow:
    inset 0 1.5px 0 var(--line),
    0 4px 10px rgba(0,0,0,.4);
  transition: transform .08s;
  overflow: hidden;
}
.member::after, .upgrade::after {
  content: '🤘';
  position: absolute; right: 108px; top: 50%;
  transform: translateY(-50%) rotate(-12deg);
  font-size: 44px; opacity: .05; pointer-events: none;
  filter: grayscale(1);
}
.member:active:not(:disabled), .upgrade:active:not(:disabled) { transform: translateY(2px); }

/* sin oro: apagado. con oro: brillo púrpura invitando */
.member:disabled, .upgrade:disabled {
  cursor: not-allowed;
  filter: saturate(.4) brightness(.6);
}
.member:not(:disabled):not(.mystery), .upgrade:not(:disabled) {
  animation: affordglow 1.6s ease-in-out infinite alternate;
}
@keyframes affordglow {
  from { box-shadow: inset 0 1.5px 0 var(--line), 0 4px 10px rgba(0,0,0,.4), 0 0 8px rgba(154,108,248,.18); }
  to   { box-shadow: inset 0 1.5px 0 var(--line), 0 4px 10px rgba(0,0,0,.4), 0 0 18px rgba(154,108,248,.5); }
}

.member:disabled .cost-pill, .upgrade:disabled .cost-pill {
  filter: grayscale(.95) brightness(.8);
}

/* titulares del escenario */
.member-wrap { position: relative; }
.member-wrap .member { width: 100%; }
.stage-toggle {
  position: absolute; top: -7px; left: 44px; z-index: 3;
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  background: linear-gradient(180deg, #262230, #15131b);
  border: 2px solid #000; border-radius: 50%;
  box-shadow: inset 0 1px 0 var(--line), 0 3px 6px rgba(0,0,0,.5);
  cursor: pointer;
}
.stage-toggle:active { transform: translateY(1.5px); }
.stage-toggle.on {
  background: linear-gradient(180deg, #4a3a10, #2c2108);
  border-color: var(--gold);
  box-shadow: inset 0 1px 0 rgba(255,217,112,.4), 0 0 10px rgba(240,192,48,.55);
}
.member.titular { border-color: rgba(240,192,48,.75); }
.member.mystery { filter: saturate(.3) brightness(.7); }
.member.mystery .pchar { filter: brightness(0); opacity: .85; }

/* retrato cuadrado oscuro con nivel */
.medallion {
  position: relative; flex-shrink: 0;
  width: 58px; height: 58px;
}
.medallion .pchar, .medallion .up-emoji {
  width: 58px; height: 58px;
  border-radius: 12px;
  border: 2.5px solid #000;
  background: radial-gradient(circle at 50% 28%, #2c2838, #15131b);
  box-shadow: inset 0 0 0 1.5px var(--line), inset 0 -8px 12px rgba(0,0,0,.4);
  display: flex; align-items: center; justify-content: center;
}
.medallion .up-emoji { font-size: 27px; }
.medallion .lv-tag {
  position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  background: #0e0c13; color: var(--gold-bright);
  border: 1.5px solid var(--line);
  font-size: 10px; font-weight: 900;
  border-radius: 8px; padding: 1px 7px;
  white-space: nowrap;
  box-shadow: 0 2px 4px rgba(0,0,0,.5);
}

.m-info, .up-info { flex: 1; min-width: 0; }
.m-name, .up-name {
  font-weight: 900; font-size: clamp(13.5px, 3.7vw, 16px); line-height: 1.15;
  text-transform: uppercase; letter-spacing: .4px;
}
.m-flavor {
  color: var(--text-dim); font-size: 10.5px; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.m-prod, .up-desc {
  color: var(--purple-txt); font-size: 12.5px; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,.6);
}
.m-bar {
  height: 7px; margin-top: 4px; max-width: 220px;
  background: #0a090e; border: 1.5px solid #000; border-radius: 4px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(0,0,0,.8);
}
.m-bar i {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #6a3ad8, var(--purple-hi));
  box-shadow: 0 0 6px rgba(154,108,248,.8);
  transition: width .25s;
}

/* botón púrpura de compra */
.cost-pill {
  flex-shrink: 0;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  background: linear-gradient(180deg, var(--purple-hi), var(--purple-lo));
  border: 2.5px solid var(--purple-ink);
  border-radius: 12px;
  color: #fff; font-weight: 900;
  padding: 8px 11px;
  min-width: 96px;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.32),
    inset 0 -4px 0 rgba(0,0,0,.25),
    0 3px 0 rgba(0,0,0,.4);
}
.cost-pill small {
  font-size: 8.5px; font-weight: 900; letter-spacing: .8px;
  color: #e8dcff; opacity: .95;
}
.cost-pill b, .cost-pill .cp-cost {
  font-size: clamp(12px, 3.4vw, 14.5px); font-weight: 900;
  text-shadow: 0 2px 0 rgba(36,20,72,.8);
  white-space: nowrap;
}

.empty-note { color: var(--text-dim); font-style: italic; font-size: 13px; padding: 14px 4px; }

/* ============ Logros ============ */
#achievements { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.ach {
  font-size: 25px; width: 54px; height: 54px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 28%, #383048, #191521);
  border: 2.5px solid #000; border-radius: 50%;
  cursor: help;
  box-shadow: inset 0 0 0 1.5px var(--line), 0 3px 7px rgba(0,0,0,.4), 0 0 10px rgba(240,192,48,.25);
}
.ach.locked { filter: grayscale(1) brightness(.5); box-shadow: inset 0 0 0 1.5px var(--line), 0 3px 7px rgba(0,0,0,.4); }

/* ============ Leyenda / prestigio ============ */
#prestige-box {
  text-align: center; padding: 20px 12px;
  background: linear-gradient(180deg, #2c2144, #1a1328);
  border: 2.5px solid #000; border-radius: 15px;
  margin-top: 8px;
  box-shadow: inset 0 1.5px 0 rgba(184,160,248,.2), 0 4px 10px rgba(0,0,0,.4), 0 0 20px rgba(122,74,224,.25);
}
.prestige-lore { color: #d8ccf0; font-size: 14px; line-height: 1.6; margin-bottom: 16px; }
.prestige-lore b { color: #d8b8ff; }
#btn-prestige {
  width: 100%; max-width: 380px; padding: 14px; border-radius: 13px;
  border: 2.5px solid var(--purple-ink);
  background: linear-gradient(180deg, var(--purple-hi), var(--purple-lo));
  color: #fff; font-size: 17px; font-weight: 900;
  min-height: 54px;
  text-shadow: 0 2px 0 rgba(36,20,72,.8);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.32), inset 0 -4px 0 rgba(0,0,0,.25), 0 4px 0 rgba(0,0,0,.4), 0 0 16px rgba(122,74,224,.5);
}
#btn-prestige:active { transform: translateY(3px); }
#btn-prestige:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
#prestige-info { display: block; color: #b8a8d8; font-size: 12.5px; margin-top: 10px; }

/* ============ Navegación inferior ============ */
#bottomnav {
  position: relative; z-index: 40;
  flex: 0 0 auto;
  display: flex; align-items: stretch;
  padding: 5px 8px calc(7px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, #16131d, #0e0c13);
  border-top: 2.5px solid #000;
  box-shadow: inset 0 1px 0 var(--line), 0 -6px 18px rgba(0,0,0,.5);
}
.nav-btn {
  position: relative;
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 6px 2px 4px;
  border-radius: 10px;
  color: var(--text-dim);
}
.nav-btn + .nav-btn { border-left: 1px solid rgba(46,42,58,.6); border-radius: 0 10px 10px 0; }
.nav-btn .nav-ico { font-size: 20px; filter: grayscale(.3) drop-shadow(0 2px 2px rgba(0,0,0,.5)); }
.nav-btn .nav-lbl { font-size: 9px; font-weight: 900; letter-spacing: .8px; }
.nav-btn:active { transform: translateY(2px); background: rgba(122,74,224,.12); }

.nav-badge {
  position: absolute; top: -6px; right: 8px;
  min-width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 40% 30%, #ff6a50, var(--red));
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff; font-size: 11px; font-weight: 900;
  padding: 0 4px;
  box-shadow: 0 3px 6px rgba(0,0,0,.5);
  text-shadow: 0 1px 1px rgba(0,0,0,.4);
  animation: badgepop .25s ease;
}
@keyframes badgepop { from { transform: scale(0); } to { transform: scale(1); } }

/* ============ Toasts ============ */
#toasts {
  position: fixed; top: 8px; right: 8px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  pointer-events: none;
}
.toast {
  background: linear-gradient(180deg, #221f2c, #131118);
  border: 2px solid var(--gold); border-radius: 12px;
  padding: 9px 14px; max-width: min(300px, 78vw);
  box-shadow: inset 0 1px 0 var(--line), 0 8px 20px rgba(0,0,0,.55), 0 0 14px rgba(240,192,48,.2);
}
.toast b { color: var(--gold-bright); font-size: 13px; }
.toast div { font-size: 12px; color: var(--text-dim); }
@keyframes slidein { from { transform: translateX(120%); } to { transform: translateX(0); } }
@keyframes fadeout { to { opacity: 0; transform: translateY(-8px); } }
.toast { animation: slidein .3s ease, fadeout .5s ease 4.2s forwards; }

/* ============ Números flotantes ============ */
.float-num {
  position: fixed; pointer-events: none; z-index: 50;
  color: var(--gold-bright); font-weight: 900; font-size: 19px;
  text-shadow:
    -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink),
    -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink);
  animation: floatup 1s ease-out forwards;
}
@keyframes floatup { to { transform: translateY(-80px) scale(1.15); opacity: 0; } }

/* ventas de merchan: verdes, pequeñitas y resultonas */
.float-num.merch {
  color: #8ae08a; font-size: 12.5px; font-weight: 900;
  text-shadow: -1px -1px 0 #06230a, 1px -1px 0 #06230a, -1px 1px 0 #06230a, 1px 1px 0 #06230a, 0 2px 4px rgba(0,0,0,.6);
  animation: floatup 1.7s ease-out forwards;
}

/* ============ Cuerno dorado ============ */
#horn {
  position: fixed; z-index: 55; cursor: pointer;
  filter: drop-shadow(0 0 16px rgba(255,217,112,.95));
  animation: hornfloat 1.2s ease-in-out infinite alternate, hornin .4s ease;
  user-select: none;
  padding: 10px;
}
@keyframes hornfloat { from { transform: translateY(0) rotate(-8deg); } to { transform: translateY(-12px) rotate(8deg); } }
@keyframes hornin { from { transform: scale(0); } }
#horn canvas { width: 76px; height: 61px; display: block; }

/* ============ Modal ============ */
#modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 4, 8, .8); z-index: 100;
  display: flex; align-items: center; justify-content: center;
}
#modal {
  background: linear-gradient(180deg, #221f2c, #131118);
  border: 2.5px solid var(--gold); border-radius: 18px;
  padding: 22px; max-width: 430px; width: calc(100% - 28px); text-align: center;
  box-shadow: inset 0 1px 0 var(--line), 0 24px 60px rgba(0,0,0,.8), 0 0 26px rgba(240,192,48,.18);
}
#modal h3 { font-size: 20px; font-weight: 900; margin-bottom: 10px; }
#modal-body { font-size: 14px; line-height: 1.55; margin-bottom: 16px; color: #e8e4f0; }
#modal-body .big {
  font-size: 27px; color: var(--gold-bright); font-weight: 900;
  text-shadow: 0 0 14px rgba(240,192,48,.5), 0 2px 3px rgba(0,0,0,.8);
}
#modal-body table td { padding: 3px 6px; }
#modal-close {
  background: linear-gradient(180deg, var(--purple-hi), var(--purple-lo));
  border: 2.5px solid var(--purple-ink); color: #fff;
  border-radius: 12px; padding: 12px 26px; font-size: 15.5px; font-weight: 900;
  min-height: 48px;
  text-shadow: 0 2px 0 rgba(36,20,72,.8);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.32), 0 4px 0 rgba(0,0,0,.4);
}
#modal-close:active { transform: translateY(3px); }

/* botones del menú (dentro del modal) */
.menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%;
  background: linear-gradient(180deg, #262230, #17151d);
  border: 2px solid #000; border-radius: 12px;
  color: #fff; font-size: 15px; font-weight: 900;
  padding: 12px 14px; margin-bottom: 8px;
  box-shadow: inset 0 1px 0 var(--line), 0 3px 6px rgba(0,0,0,.35);
}
.menu-item:active { transform: translateY(2px); }
.menu-item.danger { background: linear-gradient(180deg, #5a1c14, #38100a); border-color: #000; }

/* ============ Pantallas grandes ============ */
@media (min-width: 700px) {
  #members, #upgrades { grid-template-columns: 1fr 1fr; }
  #stagecanvas { height: min(46vh, 55vw); }
  #bottomnav { max-width: 760px; width: 100%; margin: 0 auto; border-radius: 16px 16px 0 0; border: 2.5px solid #000; border-bottom: none; }
}

/* ============================================================
   CLICK METAL BAND — capa de jugo: animaciones y chispas
   ============================================================ */

/* --- ticker de frases tontas --- */
#ticker {
  flex: 0 0 auto;
  width: 100%;
  max-width: 760px; margin: 0 auto; padding: 0 14px 2px;
  text-align: center; cursor: pointer;
}
#ticker-text {
  display: inline-block;
  color: var(--text-dim); font-size: 11.5px; font-style: italic;
  opacity: .92;
}
#ticker-text.in { animation: tickin .5s ease; }
@keyframes tickin { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: .92; transform: none; } }

/* --- combo (overlay del escenario) --- */
#combo-badge {
  position: absolute; right: 10px; bottom: 10px;
  display: flex; flex-direction: column; align-items: center;
  padding: 5px 14px; border-radius: 14px;
  background: linear-gradient(180deg, #ff9a2e, #e0431c);
  border: 2.5px solid #000;
  box-shadow: 0 4px 0 rgba(0,0,0,.35), 0 0 22px rgba(255,150,40,calc(.25 + var(--cf, 0) * .6));
  animation: combopop .18s ease;
  pointer-events: none;
}
#combo-badge b {
  font-size: clamp(15px, 4.2vw, 20px); font-weight: 900; color: #fff8d0; line-height: 1;
  text-shadow: -1.5px -1.5px 0 var(--ink), 1.5px -1.5px 0 var(--ink), -1.5px 1.5px 0 var(--ink), 1.5px 1.5px 0 var(--ink);
}
#combo-badge small {
  font-size: 9.5px; font-weight: 900; letter-spacing: .6px; color: #2a1004; text-transform: uppercase;
}
@keyframes combopop { from { transform: scale(1.28) rotate(-3deg); } to { transform: none; } }

/* --- filas que entran y saltan al comprar --- */
.member.appear, .upgrade.appear { animation: rowin .32s ease backwards; }
@keyframes rowin { from { opacity: 0; transform: translateX(-14px) scale(.97); } to { opacity: 1; } }
.member.bought { animation: buypop .34s ease; }
@keyframes buypop {
  0% { transform: scale(1); }
  35% { transform: scale(1.03) rotate(-.5deg); filter: brightness(1.3); }
  100% { transform: scale(1); }
}

/* --- el precio hace señas cuando ya te lo puedes permitir --- */
.cost-pill.ready { animation: pillglow 1.1s ease-in-out infinite alternate; }
@keyframes pillglow {
  from { box-shadow: inset 0 2px 0 rgba(255,255,255,.32), inset 0 -4px 0 rgba(0,0,0,.25), 0 3px 0 rgba(0,0,0,.4); }
  to   { box-shadow: inset 0 2px 0 rgba(255,255,255,.4), inset 0 -4px 0 rgba(0,0,0,.25), 0 3px 0 rgba(0,0,0,.4), 0 0 16px rgba(154,108,248,.9); }
}
.member:not(:disabled) .medallion .pchar { animation: medbob 3.2s ease-in-out infinite; }
@keyframes medbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-2.5px); } }

/* --- contador de oro con latido --- */
#gold-amount.bump { animation: goldbump .26s ease; }
@keyframes goldbump {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); color: #fff; }
  100% { transform: scale(1); }
}

/* --- botón TOCAR: nunca se está quieto --- */
#btn-play { animation: playidle 2.4s ease-in-out infinite, firewob2 1.3s ease-in-out infinite alternate; }
@keyframes playidle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes firewob2 {
  from { box-shadow: 0 0 16px rgba(255,128,48,.4), inset 0 0 14px rgba(255,110,30,.22), 0 6px 0 rgba(0,0,0,.45); }
  to   { box-shadow: 0 0 30px rgba(255,150,60,.75), inset 0 0 20px rgba(255,110,30,.36), 0 6px 0 rgba(0,0,0,.45); }
}
#btn-play:active { animation: none; }
.play-skull { animation: guitarwag 1.2s ease-in-out infinite; }
@keyframes guitarwag { 0%,100% { transform: translateX(-50%) rotate(-8deg); } 50% { transform: translateX(-50%) rotate(8deg); } }

/* --- números flotantes: los críticos son otra cosa --- */
.float-num.crit {
  color: #fff; font-size: 25px;
  text-shadow: -2px -2px 0 #b01808, 2px -2px 0 #b01808, -2px 2px 0 #b01808, 2px 2px 0 #b01808, 0 0 18px #ff8a3a;
  animation: floatcrit 1.1s ease-out forwards;
}
@keyframes floatcrit {
  0% { transform: scale(.5) rotate(-8deg); opacity: 0; }
  25% { transform: scale(1.3) rotate(4deg); opacity: 1; }
  100% { transform: translateY(-110px) scale(1.05) rotate(-3deg); opacity: 0; }
}

/* --- temblores --- */
body.shake { animation: shake .18s ease; }
body.shake-big { animation: shakebig .5s ease; }
@keyframes shake {
  0%,100% { transform: translate(0,0); }
  30% { transform: translate(-3px, 2px); }
  60% { transform: translate(3px, -2px); }
}
@keyframes shakebig {
  0%,100% { transform: translate(0,0) rotate(0); }
  15% { transform: translate(-8px, 4px) rotate(-.6deg); }
  35% { transform: translate(7px, -5px) rotate(.6deg); }
  55% { transform: translate(-5px, 3px) rotate(-.4deg); }
  80% { transform: translate(4px, -2px) rotate(.3deg); }
}

/* --- modo frenesí: la pantalla entera se vuelve loca --- */
body.frenzy { animation: frenzybg 1.1s linear infinite; }
@keyframes frenzybg {
  0%   { box-shadow: inset 0 0 90px rgba(255,80,20,.35); }
  50%  { box-shadow: inset 0 0 130px rgba(255,190,40,.5); }
  100% { box-shadow: inset 0 0 90px rgba(255,80,20,.35); }
}
body.frenzy #stagecanvas { animation: frenzycanvas .32s ease-in-out infinite alternate; }
@keyframes frenzycanvas {
  from { box-shadow: inset 0 0 0 2px rgba(154,108,248,.12), 0 0 26px rgba(122,74,224,.22), 0 10px 28px rgba(0,0,0,.6); }
  to   { box-shadow: inset 0 0 0 2px rgba(255,220,120,.5), 0 0 42px rgba(255,140,40,.75), 0 10px 28px rgba(0,0,0,.6); }
}

/* --- modal con rebote --- */

@keyframes modalpop { from { transform: scale(.7) rotate(-2deg); opacity: 0; } to { transform: none; opacity: 1; } }
.menu-item span { flex: 1; text-align: left; }
.menu-item b { color: var(--gold-bright); }

/* --- logros conseguidos brillan un pelín --- */
.ach:not(.locked) { animation: achbob 4s ease-in-out infinite; }
.ach:not(.locked):hover { transform: scale(1.12) rotate(-4deg); }
@keyframes achbob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* --- toasts: un pelín más chulos --- */
.toast { position: relative; overflow: hidden; }
.toast::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.25) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: toastshine 1.1s ease .15s;
}
@keyframes toastshine { to { transform: translateX(120%); } }

/* ============================================================
   MÓVIL: layout vertical de siempre, con el botón de TOCAR
   fijo abajo del todo (zona del pulgar). Tocar el escenario
   también cuenta como riff.
   ============================================================ */
@media (pointer: coarse) {
  #stagecanvas { cursor: pointer; }
  /* dock flotante inferior: BANDA + TOCAR + MEJORAS */
  #playrow {
    position: fixed; left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
    max-width: none; margin: 0;
    gap: 8px; align-items: center; justify-content: space-between;
    padding: 8px;
    border-radius: 22px;
    background: rgba(15, 13, 21, .86);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    border: 1.5px solid rgba(255, 255, 255, .1);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .55);
  }
  #playrow .tab-card .nav-badge { top: -6px; right: 0; }
  #content { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
}

/* móvil: botón TOCAR clásico bien encajado + avisos que NO tapan el concierto */
@media (pointer: coarse) {
  #btn-play {
    min-width: 0; flex: 0 0 148px;
    padding: 8px 10px 7px;
    margin: 0;
    z-index: 45;
  }
  .play-lbl { font-size: 17px; }
  .play-skull { top: -12px; font-size: 15px; }
  #btn-play .play-sub { font-size: 11px; }

  /* toasts = mini-banners de una línea arriba del todo */
  #toasts { top: 4px; left: 8px; right: 8px; align-items: stretch; }
  .toast {
    max-width: none;
    display: flex; gap: 6px; align-items: baseline;
    padding: 5px 10px;
    border-width: 1.5px; border-radius: 9px;
    background: rgba(20, 18, 28, .93);
    animation: slidein .25s ease, fadeout .4s ease 2.6s forwards;
  }
  .toast b { font-size: 11px; white-space: nowrap; flex-shrink: 0; }
  .toast div {
    font-size: 10.5px; flex: 1; min-width: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .toast::after { display: none; }

  /* combo más discreto, que no pise el cartel del venue */
  #combo-badge { padding: 3px 9px; border-width: 2px; }
  #combo-badge b { font-size: 13px; }
  #combo-badge small { font-size: 7.5px; }

  /* multiplicador compacto */
  .stage-pill { padding: 3px 7px; }
  .stage-pill b { font-size: 11px; }

  /* ticker en una sola línea */
  #ticker { padding: 0 10px 2px; }
  #ticker-text {
    display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-size: 11px;
  }

  /* filas compactas: NADA se sale del ancho de pantalla */
  #content { padding-left: 8px; padding-right: 8px; overflow-x: hidden; }
  #members, #upgrades { width: 100%; }
  .member, .upgrade {
    gap: 8px; padding: 8px;
    min-height: 68px; max-width: 100%;
  }
  .member::after, .upgrade::after { display: none; }
  .medallion { width: 50px; height: 50px; }
  .medallion .pchar, .medallion .up-emoji { width: 50px; height: 50px; }
  .medallion .up-emoji { font-size: 23px; }
  .medallion .lv-tag { font-size: 9px; padding: 1px 6px; }
  .stage-toggle { width: 26px; height: 26px; font-size: 12px; left: 38px; }
  .m-name, .up-name { font-size: 13px; }
  .m-flavor { font-size: 9.5px; }
  .m-prod, .up-desc { font-size: 10.5px; }
  .m-bar { height: 6px; margin-top: 3px; }
  .cost-pill { min-width: 74px; padding: 6px 8px; border-radius: 10px; border-width: 2px; }
  .cost-pill small { font-size: 7.5px; letter-spacing: .5px; }
  .cost-pill b, .cost-pill .cp-cost { font-size: 12px; }
}

/* ============================================================
   BOTONERA RENOVADA: dock limpio y compacto
   ============================================================ */
#playrow {
  max-width: 560px;
  padding: 8px;
  border-radius: 22px;
  background: rgba(15, 13, 21, .8);
  border: 1.5px solid rgba(255, 255, 255, .09);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .45);
  justify-content: space-between;
}

/* BANDA / MEJORAS: píldoras fantasma, finas y elegantes */
.tab-card, #playrow .tab-card {
  flex: 1 1 0; min-width: 0; min-height: 44px; max-width: none;
  flex-direction: row; gap: 7px; justify-content: center; align-items: center;
  margin: 0; padding: 0 10px;
  border-radius: 22px;
  background: rgba(255, 255, 255, .055);
  border: 1.5px solid rgba(255, 255, 255, .13);
  box-shadow: none;
  transition: background .15s, box-shadow .15s;
}
.tab-card::before { display: none; }
.tab-card .tc-ico { font-size: 15px; filter: none; }
.tab-card .tc-lbl, #playrow .tab-card .tc-lbl {
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  color: #beb6d4; text-shadow: none;
}
.tab-card:active { transform: scale(.96); }
.tab-card.active {
  background: linear-gradient(135deg, #8a5cf0, #5c2ed0);
  border-color: rgba(255, 255, 255, .28);
  box-shadow: 0 3px 14px rgba(122, 74, 224, .55);
}
.tab-card.active .tc-lbl { color: #fff; }

/* TOCAR: píldora de fuego, compacta y con presencia */
#btn-play {
  flex: 0 0 auto; min-width: 148px; height: 52px;
  margin: 0; padding: 0 20px;
  display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 8px;
  border-radius: 26px;
  background: linear-gradient(135deg, #ffa03a 0%, #f0512a 55%, #c92e1a 100%);
  border: 1.5px solid rgba(255, 255, 255, .3);
  box-shadow:
    0 4px 16px rgba(240, 80, 40, .5),
    inset 0 1.5px 0 rgba(255, 255, 255, .4),
    inset 0 -4px 8px rgba(120, 20, 0, .35);
  filter: none;
  animation: playglow 1.8s ease-in-out infinite alternate;
}
@keyframes playglow {
  from { box-shadow: 0 4px 14px rgba(240,80,40,.4), inset 0 1.5px 0 rgba(255,255,255,.4), inset 0 -4px 8px rgba(120,20,0,.35); }
  to   { box-shadow: 0 4px 22px rgba(255,120,50,.75), inset 0 1.5px 0 rgba(255,255,255,.4), inset 0 -4px 8px rgba(120,20,0,.35); }
}
#btn-play:active {
  transform: scale(.95);
  box-shadow: 0 2px 10px rgba(240, 80, 40, .5), inset 0 2px 6px rgba(120, 20, 0, .4);
  animation: none;
}
.fire-ring, .play-skull { display: none; }
.play-lbl {
  display: inline; font-size: 16px; font-weight: 900; letter-spacing: .5px;
  text-shadow: 0 1.5px 0 rgba(120, 20, 0, .6);
}
#btn-play .play-sub {
  position: static; transform: none; max-width: none;
  font-size: 10.5px; font-weight: 900; color: #ffe9c8;
  background: rgba(0, 0, 0, .25);
  border-radius: 10px; padding: 2px 8px;
  text-shadow: none; white-space: nowrap;
}

@media (pointer: coarse) {
  #btn-play { min-width: 132px; height: 48px; padding: 0 14px; }
  .play-lbl { font-size: 14.5px; }
  #btn-play .play-sub { font-size: 9.5px; }
  .tab-card, #playrow .tab-card { min-height: 40px; }
}

/* La Calle */
/* en la calle se esconde el atrezzo del concierto */
body.in-city #venue-line,
body.in-city #venue-progress-wrap,
body.in-city #combo-badge,
body.in-city #frenzy-banner,
body.in-city #btn-gig,
body.in-city .stage-pill.left { display: none !important; }

/* El paso entre concierto y calle: una pastilla simple y legible.
   Nada de puertas ni artificios: se lee de un vistazo y no descoloca nada. */
#btn-street {
  position: absolute; right: 12px; bottom: 12px; z-index: 6;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 14px;
  font-size: 12.5px; font-weight: 900; letter-spacing: .5px;
  color: #ffd970;
  background: linear-gradient(180deg, #37304a, #1c1728);
  border: 2px solid #0a0810; border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 4px 12px rgba(0,0,0,.6);
  cursor: pointer;
}
#btn-street b { font-size: 15px; line-height: 1; opacity: .85; }
#btn-street:active { transform: translateY(2px); }

/* fundido a negro tipo televisor al cambiar de escena */
#fade {
  position: fixed; inset: 0; z-index: 90;
  background: #000;
  opacity: 0; pointer-events: none;
  transition: opacity .26s ease;
}
#fade.on { opacity: 1; }
#fade.on::after {
  content: '';
  position: absolute; left: 0; right: 0; top: 50%;
  height: 2px;
  background: rgba(255, 255, 255, .75);
  box-shadow: 0 0 12px rgba(255, 255, 255, .9);
  animation: tvline .3s ease forwards;
}
@keyframes tvline { from { transform: scaleX(1); opacity: 1; } to { transform: scaleX(.02); opacity: 0; } }
#btn-street .nav-badge { top: -7px; right: -7px; }
/* En la calle, el botón de volver se muda a la cabecera (lo mueve game.js al
   hueco del nivel de leyenda, que ahí fuera no pinta nada). Sin position fixed:
   así no se solapa ni empuja el resto del interfaz. */
#topbar #btn-street {
  position: static; margin-right: auto;
  padding: 8px 13px; font-size: 12px;
  border-radius: 12px;
  color: #c8a8ff;
  border-color: #2a2038;
}
body.in-city #lvl-box { display: none; }

#combo-badge { bottom: 64px !important; }

/* barra de progreso del nivel: todo el borde superior del concierto */
#venue-progress-wrap {
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  height: 6px; border: none; border-radius: 14px 14px 0 0;
  background: rgba(10, 9, 14, .6);
  overflow: hidden;
}

/* cartel del venue: una línea discreta bajo el concierto */
#venue-line {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 5px 4px 0;
  max-width: 100%; overflow: hidden;
}
#venue-line > * { min-width: 0; flex-shrink: 1; }
#venue-line #venue-name {
  color: var(--gold-bright); font-weight: 900; font-size: 13px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 0;
}
#venue-line #venue-next {
  color: var(--text-dim); font-size: 11.5px; font-style: italic;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin: 0;
}

/* puzle de negociación */
.puz-bar {
  position: relative; height: 36px;
  border-radius: 18px; background: #0a090e;
  border: 2px solid #000; overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, .85);
  cursor: pointer;
}
.puz-zone {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(240,192,48,.9), rgba(200,140,20,.9));
  box-shadow: 0 0 14px rgba(240,192,48,.8);
}
.puz-needle {
  position: absolute; top: -2px; bottom: -2px; width: 4px; margin-left: -2px;
  background: #fff; box-shadow: 0 0 9px #fff;
}

button.cost-pill { cursor: pointer; }
button.cost-pill:disabled { filter: grayscale(.9) brightness(.75); cursor: not-allowed; }
button.cost-pill:active:not(:disabled) { transform: translateY(2px); }
.city-row .medallion .up-emoji { font-size: 26px; }

@media (pointer: coarse) {
  #btn-play { min-width: 116px; padding: 0 10px; }
}

/* retratos mini del modal de sustitución */
.pchar-mini {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 10px; border: 2px solid #000;
  background: radial-gradient(circle at 50% 28%, #2c2838, #15131b);
}
.menu-item.swap-opt { align-items: center; }

/* --- respeto por quien no quiere fiesta visual --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ============ EN LA CALLE NO SE TOCA ============ */
/* fuera el botonaco de TOCAR y las pestañas inferiores mientras paseas */
body.in-city #playrow,
body.in-city #ticker { display: none !important; }

/* ============ RESULTADO DE LOS PUZLES ============ */
.puz-result {
  font-size: 21px; font-weight: 900; text-align: center;
  margin: 12px 0 2px; letter-spacing: .5px;
  animation: puzpop .35s cubic-bezier(.2, 1.6, .4, 1);
}
.puz-result.win { color: #6be07a; text-shadow: 0 0 14px rgba(80, 220, 110, .6); }
.puz-result.retry { color: #f0b83a; font-size: 17px; text-shadow: 0 0 12px rgba(240, 184, 58, .55); }
.puz-result.fail { color: #f0584a; text-shadow: 0 0 14px rgba(240, 80, 60, .6); }
@keyframes puzpop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#modal.puz-win { box-shadow: 0 0 0 3px #3fae52, 0 0 44px rgba(80, 220, 110, .5); }
#modal.puz-fail {
  box-shadow: 0 0 0 3px #c8372a, 0 0 44px rgba(240, 80, 60, .5);
  animation: puzshake .45s ease;
}
@keyframes puzshake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-9px); }
  40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

/* ============ SIMÓN FOLK ============ */
.simon-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0; }
.simon-key {
  font-size: 34px; padding: 16px 0; border-radius: 12px; cursor: pointer;
  border: 2px solid var(--line, #3a3444); background: #1c1824;
  transition: transform .08s, box-shadow .12s, background .12s;
}
.simon-key.lit {
  background: #4a3c14; border-color: var(--gold, #f0c030);
  box-shadow: 0 0 18px rgba(240, 192, 48, .7);
  transform: scale(1.06);
}
.simon-key:active { transform: scale(.95); }

/* ============ CAZANOTAS ============ */
.topo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.topo-cell {
  height: 52px; font-size: 26px; border-radius: 10px; cursor: pointer;
  border: 2px solid var(--line, #3a3444); background: #1c1824;
}
.topo-cell:active { transform: scale(.93); }

/* ============ AUDICIONES PENDIENTES ============ */
.member.locked-aud .m-name::after { content: ' 🎭'; }
.member.locked-aud .pchar { filter: grayscale(.7) brightness(.75); }

/* ============================================================
   MODO AVENTURA — pantalla completa vertical
   ============================================================ */
#adv {
  position: fixed; inset: 0; z-index: 200;
  background: #05040a;
  display: flex; align-items: center; justify-content: center;
}
#adv-stage {
  position: relative;
  aspect-ratio: 360 / 640;
  height: min(100dvh, calc(100vw * 16 / 9));
  width: auto; max-width: 100vw;
}
#advcanvas {
  position: absolute; inset: 0;
  display: block; width: 100%; height: 100%;
  background: #08070e;
  touch-action: manipulation;
}
/* barra superior: título, inventario y salida */
#adv-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 10px;
  background: linear-gradient(180deg, rgba(6,5,12,.8), rgba(6,5,12,0));
  pointer-events: none;
}
/* el título, en una chapa de gira con su cinta dorada */
#adv-title {
  flex: 1; min-width: 0;
  font-size: 11px; font-weight: 900; letter-spacing: .6px;
  color: #ffe9a8;
  padding: 6px 12px 7px;
  background: linear-gradient(180deg, #2a2036, #16111f);
  border: 2px solid #07060a;
  border-left: 4px solid var(--gold);
  border-radius: 4px 12px 12px 4px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 4px 10px rgba(0,0,0,.6);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#adv-inv { display: flex; gap: 4px; }
.adv-item {
  font-size: 17px; line-height: 1;
  background: rgba(20,17,28,.85);
  border: 2px solid #000; border-radius: 9px;
  padding: 4px 6px;
  box-shadow: inset 0 1px 0 var(--line);
  animation: puzpop .3s cubic-bezier(.2, 1.6, .4, 1);
}
#adv-exit {
  pointer-events: auto;
  width: 34px; height: 34px; flex: 0 0 auto;
  font-size: 15px; font-weight: 900; color: #ffd0c8;
  background: linear-gradient(180deg, #5a2028, #2c1016);
  border: 2px solid #07060a; border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 4px 10px rgba(0,0,0,.6);
}
#adv-exit:active { transform: translateY(2px); }
/* ---- lo que se dice: bocadillo blanco, como en los cómics ---- */
#adv-box {
  position: absolute; left: 12px; right: 12px; bottom: 14px;
  padding: 14px 15px 15px;
  border: 3px solid #07060a; border-radius: 16px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .8);
}
#adv-box.habla {
  background: #f6f2e6;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .8), inset 0 -3px 0 rgba(0, 0, 0, .07);
}
/* el pico del bocadillo, apuntando a quien habla */
#adv-box.habla::before {
  content: '';
  position: absolute; top: -15px; left: 34px;
  border: 8px solid transparent;
  border-bottom-color: #07060a;
}
#adv-box.habla::after {
  content: '';
  position: absolute; top: -9px; left: 34px;
  border: 8px solid transparent;
  border-bottom-color: #f6f2e6;
}
#adv-box.narra {
  background: linear-gradient(180deg, rgba(24, 20, 34, .96), rgba(11, 9, 16, .96));
  box-shadow: inset 0 1.5px 0 var(--line), 0 10px 26px rgba(0, 0, 0, .8);
}

/* el nombre, en una chapita por encima del bocadillo */
#adv-who {
  position: absolute; top: -13px; left: 14px;
  display: inline-block;
  font-size: 10px; font-weight: 900; letter-spacing: 1.2px;
  color: #0b0910;
  padding: 3px 9px;
  border: 2.5px solid #07060a; border-radius: 8px;
}
#adv-box.narra #adv-who { display: none; }

#adv-txt {
  font-size: 17px; font-weight: 700; line-height: 1.45;
  letter-spacing: .1px;
  color: #100d18;
  min-height: 2.6em;
}
#adv-box.narra #adv-txt { font-size: 15.5px; font-weight: 600; }
#adv-box.narra #adv-txt { color: #d8d2e4; }
#adv-txt.narr { color: #b9b2c8; font-style: italic; }

/* el cursor de "sigue" solo aparece cuando ha acabado de escribir */
#adv-next {
  position: absolute; right: 12px; bottom: 6px;
  font-size: 12px; color: #7a4ae0;
  animation: advnext .9s ease-in-out infinite;
}
#adv-box.habla #adv-next { color: #7a4ae0; }
#adv-box.narra #adv-next { color: var(--gold); }
@keyframes advnext { 0%, 100% { transform: translateY(0); opacity: .45; } 50% { transform: translateY(3px); opacity: 1; } }

#adv-opts { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
.adv-opt {
  text-align: left;
  font-size: 13px; font-weight: 700; color: #fff;
  padding: 10px 12px;
  background: linear-gradient(180deg, #322a46, #1d1828);
  border: 2px solid #000; border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.adv-opt:active { transform: translateY(2px); background: linear-gradient(180deg, #4a3a68, #2a2038); }

/* mientras juegas la aventura, el idle de fondo no se ve ni se toca */
body.en-aventura { overflow: hidden; }

/* ============ MISIÓN DESTACADA EN EL TABLÓN DE LA CALLE ============ */
.city-row.quest {
  background: linear-gradient(180deg, #35204a, #1d1230);
  border-color: #7a4ae0;
  box-shadow: inset 0 1px 0 rgba(200,160,255,.18), 0 0 16px rgba(122,74,224,.35);
  animation: questglow 1.8s ease-in-out infinite alternate;
}
@keyframes questglow {
  from { box-shadow: inset 0 1px 0 rgba(200,160,255,.18), 0 0 10px rgba(122,74,224,.25); }
  to   { box-shadow: inset 0 1px 0 rgba(200,160,255,.18), 0 0 24px rgba(154,108,248,.6); }
}
.city-row.quest .up-name { color: #d8b8ff; }
.city-row.quest .up-desc { color: #a88ad8; }
.city-row.quest .cost-pill {
  background: linear-gradient(180deg, var(--purple-hi), var(--purple-lo));
  border-color: #000; color: #fff;
}
.city-row.quest .medallion { box-shadow: 0 0 12px rgba(154,108,248,.6); }

/* fundido entre escenas de la aventura (lo anima el navegador) */
#adv-fade {
  position: absolute; inset: 0;
  background: #000; opacity: 0;
  pointer-events: none;
}
#adv-fade.go { animation: advfade .5s ease; }
@keyframes advfade { from { opacity: 1; } to { opacity: 0; } }

/* ---- el retrato de quien habla ---- */
#adv-face {
  position: absolute; left: -4px; top: -48px;
  width: 56px; height: 56px;
  border: 3px solid #07060a; border-radius: 14px;
  background: #241a34;
  box-shadow: 0 4px 10px rgba(0, 0, 0, .6);
  image-rendering: pixelated;
}
/* con retrato, el nombre se aparta para no pisarlo */
#adv-box.con-cara #adv-who { left: 58px; }

/* la nota que explica por dónde se empieza en la calle */
.street-nota {
  margin: 0 0 10px;
  padding: 11px 13px;
  font-size: 12.5px; line-height: 1.5; color: var(--text-dim);
  background: linear-gradient(180deg, #1d1a28, #14121c);
  border: 2px solid #000; border-left: 4px solid var(--purple-hi);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 var(--line);
}
.street-nota b { display: block; color: #d8b8ff; margin-bottom: 3px; font-size: 13px; }

/* fundido del concierto: solo apaga la pantalla de juego, no toda la app */
#fade-stage {
  position: absolute; inset: 0; z-index: 8;
  background: #000; border-radius: 14px;
  opacity: 0; pointer-events: none;
  transition: opacity .26s ease;
}
#fade-stage.on { opacity: 1; }

/* ============ EL SIGUIENTE PASO ============ */
#objetivo {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  margin: 6px 10px 0;
  padding: 9px 10px 9px 13px;
  background: linear-gradient(180deg, #4a2a12, #2a1608);
  border: 2.5px solid #000; border-left: 5px solid var(--fire);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255,190,120,.22), 0 4px 14px rgba(0,0,0,.5);
  animation: objglow 2s ease-in-out infinite alternate;
}
@keyframes objglow {
  from { box-shadow: inset 0 1px 0 rgba(255,190,120,.22), 0 0 8px rgba(255,128,48,.3); }
  to   { box-shadow: inset 0 1px 0 rgba(255,190,120,.22), 0 0 22px rgba(255,128,48,.7); }
}
#objetivo small {
  flex: 1; min-width: 0;
  font-size: 12px; line-height: 1.35; color: #ffcf9a; font-weight: 700;
}
#objetivo button {
  flex: 0 0 auto;
  font-size: 12.5px; font-weight: 900; letter-spacing: .4px; color: #2a1200;
  padding: 11px 14px;
  background: linear-gradient(180deg, #ffb04a, #f07820);
  border: 2.5px solid #000; border-radius: 12px;
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.5), 0 4px 0 #8a3c08;
}
#objetivo button:active { transform: translateY(3px); box-shadow: inset 0 1.5px 0 rgba(255,255,255,.5), 0 1px 0 #8a3c08; }
/* cuando lo que falta es dinero, el cartel tira aún más del ojo */
#objetivo.urgente { animation-duration: 1s; }

/* avisos dentro de las fichas: naranja = te falta algo por hacer */
.aviso { color: var(--fire); font-weight: 700; }
.cost-pill.sin-oro { border-color: #7a3a10; }
.cost-pill.sin-oro .cp-lbl { color: var(--fire); }

/* el botón de pistas: señala qué se puede tocar en la escena */
#adv-hint {
  pointer-events: auto;
  width: 34px; height: 34px; flex: 0 0 auto;
  font-size: 15px;
  background: linear-gradient(180deg, #4a3a12, #241a06);
  border: 2px solid #07060a; border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 4px 10px rgba(0,0,0,.6);
}
#adv-hint:active { transform: translateY(2px); }

/* el cartel cuando AÚN NO se puede: azul frío, para que no invite a pulsar
   pensando que va a pasar algo. Al tocarlo explica qué falta. */
#objetivo.espera {
  background: linear-gradient(180deg, #1e2a44, #121a2c);
  border-left-color: #4a7ad0;
  animation: none;
  box-shadow: inset 0 1px 0 rgba(150,190,255,.16), 0 4px 14px rgba(0,0,0,.5);
}
#objetivo.espera small { color: #9fbde8; }
#objetivo.espera button {
  color: #eaf2ff;
  background: linear-gradient(180deg, #3d5f9e, #243a63);
  box-shadow: inset 0 1.5px 0 rgba(255,255,255,.18), 0 4px 0 #16233c;
}
#objetivo.espera button:active { box-shadow: inset 0 1.5px 0 rgba(255,255,255,.18), 0 1px 0 #16233c; }

/* la coletilla de las excusas de los músicos */
.excusa-req {
  margin-top: 12px; padding: 9px 11px;
  font-size: 12.5px; color: var(--gold-bright);
  background: rgba(240,192,48,.08);
  border: 1.5px solid rgba(240,192,48,.35); border-radius: 10px;
}

/* ============ APARICIONES CON GARBO ============ */
/* el modal entra dando un salto, con un pelín de giro y el fondo desenfocado */
#modal-backdrop { backdrop-filter: blur(3px); animation: velo .22s ease; }
@keyframes velo { from { opacity: 0; } to { opacity: 1; } }
#modal.pop { animation: modalentra .46s cubic-bezier(.18, 1.5, .35, 1); }
@keyframes modalentra {
  0%   { transform: translateY(34px) scale(.72) rotate(-3.5deg); opacity: 0; }
  55%  { transform: translateY(-8px) scale(1.05) rotate(1.2deg); opacity: 1; }
  75%  { transform: translateY(2px) scale(.985) rotate(-.5deg); }
  100% { transform: translateY(0) scale(1) rotate(0); }
}
#modal h3 { animation: titentra .5s .06s both cubic-bezier(.2, 1.4, .4, 1); }
@keyframes titentra { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ============ RÓTULO DE CAPÍTULO ============ */
#adv-intro {
  position: absolute; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px;
  background: radial-gradient(ellipse at 50% 50%, rgba(20,10,34,.86), rgba(0,0,0,.97));
  pointer-events: none;
  text-align: center; padding: 0 24px;
}
/* ojo: nacen VISIBLES. Si el navegador no ejecutara la animación (pasa en
   pestañas dormidas), el rótulo se vería igual en vez de quedarse en blanco. */
#adv-intro small {
  font-size: 12px; font-weight: 900; letter-spacing: 7px; color: var(--gold);
}
#adv-intro b {
  font-size: 74px; font-weight: 900; line-height: 1; color: #fff;
  text-shadow: 0 0 26px rgba(240,192,48,.7), 0 5px 0 #7a4a10;
}
#adv-intro span {
  margin-top: 12px;
  font-size: 16px; font-weight: 700; font-style: italic; color: #ffe9a8;
  border-top: 2px solid rgba(240,192,48,.45); padding-top: 12px;
}
#adv-intro.va small { animation: introsub .5s .1s ease-out; }
#adv-intro.va b     { animation: intronum .6s .2s cubic-bezier(.2, 1.7, .4, 1); }
#adv-intro.va span  { animation: introsub .5s .55s ease-out; }
#adv-intro.va       { animation: introsale .4s 1.8s forwards ease-in; }
@keyframes introsub { from { opacity: 0; transform: translateY(12px); } }
@keyframes intronum { from { opacity: 0; transform: scale(.5) rotate(-6deg); } }
@keyframes introsale { to { opacity: 0; transform: scale(1.12); } }

/* ============ TELÓN ENTRE ESCENAS ============ */
/* dos mitades que se cierran y se abren, en vez de un fundido plano */
#adv-fade { background: none; }
#adv-fade::before, #adv-fade::after {
  content: ''; position: absolute; left: 0; right: 0; height: 52%;
  background: linear-gradient(180deg, #07060c, #14101f);
  box-shadow: 0 0 22px rgba(0,0,0,.9);
  transform: scaleY(0);
}
#adv-fade::before { top: 0; transform-origin: top; }
#adv-fade::after  { bottom: 0; transform-origin: bottom; }
#adv-fade.go::before, #adv-fade.go::after { animation: telon .62s ease-in-out; }
@keyframes telon {
  0%   { transform: scaleY(0); }
  42%  { transform: scaleY(1); }
  58%  { transform: scaleY(1); }
  100% { transform: scaleY(0); }
}

/* el fundido del concierto también con más cuerpo */
#fade-stage { transition: opacity .22s ease; }

/* ============================================================
   ESCRITORIO / PC — el juego deja de ser una columna de móvil
   y se convierte en un panel de control a dos columnas:
   izquierda el concierto, derecha la gestión de la banda.
   Solo se activa con ratón (pointer: fine) y sitio de sobra.
   ============================================================ */

/* fuera del escritorio, el rail de pestañas y los pies de atajos no existen */
#pc-rail, #pc-keys, #adv-keys { display: none; }

@media (min-width: 1000px) and (pointer: fine) {

  body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(380px, 30vw, 520px);
    grid-template-rows: auto minmax(0, 1fr) auto auto auto auto;
    grid-template-areas:
      "top   top"
      "stage side"
      "play  side"
      "obj   side"
      "tick  side"
      "keys  side";
    column-gap: 16px;
    padding: 0 16px 14px;
    align-content: start;
    overflow: hidden;
  }

  #topbar      { grid-area: top; margin: 0 -16px 10px; padding: 9px 20px; }
  #stage-wrap  { grid-area: stage; align-items: center; padding: 0; min-height: 0; }
  #objetivo    { grid-area: obj; margin: 10px 0 0; }
  #ticker      { grid-area: tick; margin: 6px 0 0; max-width: none; }
  #content     { grid-area: side; }

  /* En PC el concierto se come TODO el hueco de la izquierda: crece hasta el
     cartel naranja de abajo. Aquí no hay botón de TOCAR: se toca clicando en
     el propio escenario (o con la barra espaciadora). */
  #stage-frame {
    height: 100%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
  }
  #stagecanvas {
    flex: 1 1 auto; min-height: 0;
    height: auto; width: auto; max-width: 100%;
    border-radius: 18px;
    box-shadow:
      inset 0 0 0 2px rgba(154,108,248,.14),
      0 0 46px rgba(122,74,224,.26),
      0 18px 44px rgba(0,0,0,.65);
  }

  /* la columna de gestión: un panel propio con su marco */
  #content {
    max-width: none; margin: 0;
    padding: 0;
    display: flex; flex-direction: column;
    min-height: 0; overflow: hidden;
    background: linear-gradient(180deg, #16131e, #100e15);
    border: 2px solid #000;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 var(--line), 0 12px 30px rgba(0,0,0,.5);
  }
  #content::-webkit-scrollbar { width: 8px; }
  #pc-panes {
    flex: 1 1 auto; min-height: 0; overflow-y: auto;
    padding: 10px 12px 22px;
    scrollbar-color: #4a4266 #14121b;
  }
  #pc-panes::-webkit-scrollbar { width: 9px; }
  #pc-panes::-webkit-scrollbar-track { background: #14121b; border-radius: 5px; }
  #pc-panes::-webkit-scrollbar-thumb { background: #3d3757; border-radius: 5px; border: 2px solid #14121b; }
  #pc-panes::-webkit-scrollbar-thumb:hover { background: #5b5183; }

  /* la fila de pestañas propia del escritorio */
  #pc-rail {
    display: flex; gap: 4px;
    flex: 0 0 auto;
    padding: 8px 8px 0;
    border-bottom: 2px solid #000;
    background: linear-gradient(180deg, #1d1928, #15121d);
    border-radius: 14px 14px 0 0;
  }
  #pc-rail button {
    flex: 1 1 0; min-width: 0;
    position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 7px 4px 8px;
    border-radius: 10px 10px 0 0;
    color: #a79ec2;
    background: transparent;
    border: 2px solid transparent; border-bottom: none;
    transition: background .14s, color .14s;
  }
  #pc-rail button .r-ico { font-size: 17px; line-height: 1; }
  #pc-rail button .r-lbl { font-size: 9.5px; font-weight: 900; letter-spacing: 1px; }
  #pc-rail button .r-key {
    position: absolute; top: 3px; right: 5px;
    font-size: 8px; font-weight: 900; color: #6d6488;
    border: 1px solid #3a3450; border-radius: 4px; padding: 0 3px;
  }
  #pc-rail button:hover { background: rgba(255,255,255,.06); color: #e6e0f5; }
  #pc-rail button.active {
    background: linear-gradient(180deg, #35265c, #221740);
    border-color: #000; color: #fff;
    box-shadow: inset 0 1px 0 rgba(184,160,248,.3);
  }
  #pc-rail button.active .r-key { color: #b8a0f8; border-color: #5c2ed0; }
  #pc-rail .nav-badge { top: 2px; left: 4px; right: auto; }

  /* el dock de móvil entero sobra: las pestañas están en el rail y el botón
     de TOCAR lo sustituye el propio escenario */
  #playrow { display: none; }

  /* el paso a la calle, abajo del todo a la derecha del escenario */
  #btn-street { right: 14px; bottom: 40px; padding: 10px 16px; font-size: 14px; }
  #venue-line { flex: 0 0 auto; width: 100%; padding-top: 7px; }

  /* fichas a dos columnas y con aire */
  #members, #upgrades, #street-tasks { grid-template-columns: 1fr; }
  #ticker-text { font-size: 12.5px; }

  /* ------- ratón: todo lo que se puede pulsar lo dice ------- */
  button, .member, .upgrade, .city-row, .tab-card, .res-pill,
  #stagecanvas, #ticker, .menu-item, .qty-btn { cursor: pointer; }
  .member:hover, .upgrade:hover, .city-row:hover {
    border-color: #5c4a86;
    background: linear-gradient(180deg, #262133, #17141e);
    transform: translateY(-1px);
  }
  .member, .upgrade, .city-row { transition: transform .12s, border-color .12s, background .12s; }
  .menu-item:hover { filter: brightness(1.18); }
  .res-pill:hover { filter: brightness(1.2); }
  #btn-play:hover { filter: brightness(1.08) saturate(1.1); }
  #btn-gig:hover, #btn-street:hover { filter: brightness(1.15); }
  .cost-pill:hover { filter: brightness(1.15); }

  /* foco visible para quien juega solo con teclado */
  :focus-visible {
    outline: 2.5px solid var(--gold-bright);
    outline-offset: 2px;
    border-radius: 8px;
  }

  /* pie de atajos */
  #pc-keys {
    grid-area: keys;
    display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: center;
    margin-top: 4px;
    font-size: 10.5px; color: #6f6789;
  }
  #pc-keys kbd {
    font: inherit; font-weight: 900; color: #b4abd0;
    background: #1b1826; border: 1px solid #383150; border-bottom-width: 2px;
    border-radius: 5px; padding: 0 5px;
  }
  #ticker { margin-top: 8px; }
}

/* ============ AVENTURA EN PC: marco de cine + atajos ============ */
@media (min-width: 1000px) and (pointer: fine) {
  #adv {
    background:
      radial-gradient(ellipse at 50% 40%, rgba(122,74,224,.16), transparent 60%),
      radial-gradient(ellipse at 50% 110%, rgba(255,128,48,.10), transparent 55%),
      #05040a;
  }
  #adv-stage {
    height: min(94dvh, calc(100vw * 16 / 9));
    border-radius: 16px;
    box-shadow: 0 0 0 3px #000, 0 0 60px rgba(122,74,224,.3), 0 24px 60px rgba(0,0,0,.8);
  }
  #advcanvas { border-radius: 14px; cursor: pointer; }
  #adv-keys {
    position: fixed; left: 0; right: 0; bottom: 12px;
    display: flex; gap: 14px; justify-content: center; align-items: center;
    font-size: 11px; color: #6f6789; pointer-events: none;
  }
  #adv-keys kbd {
    font: inherit; font-weight: 900; color: #b4abd0;
    background: #14121c; border: 1px solid #383150; border-bottom-width: 2px;
    border-radius: 5px; padding: 1px 6px;
  }
}

/* el botón TOCAR responde también cuando se pulsa con la barra espaciadora */
#btn-play.pulsado { transform: scale(.95); filter: brightness(1.15); }

/* con la pestaña en segundo plano no animamos nada: ni CPU ni batería */
body.oculto *, body.oculto *::before, body.oculto *::after { animation-play-state: paused !important; }
