/* Layout: launcher de una columna. Barra superior, franja de estadisticas, pestañas de estado, rejilla de portadas. Oscuro por decision de diseño. */
:root {
  --bg: #0d1017;
  --panel: #151a24;
  --panel-2: #1b2130;
  --line: #262d3d;
  --glass: rgba(17, 24, 39, 0.72);
  --glass-rim: rgba(255, 255, 255, 0.10);
  --halo-indigo: rgba(99, 102, 241, 0.14);
  --halo-emerald: rgba(16, 185, 129, 0.09);
  --grid-line: rgba(255, 255, 255, 0.03);
  --accent-bright: #6366F1;
  --fg: #e8ebf3;
  --muted: #8a93a8;
  --accent: #7f8cff;
  --accent-ink: #0d1017;
  --s-play: #4cc3ff;
  --s-pend: #f2b24c;
  --s-done: #4ed6a0;
  --s-plat: #c79bff;
  --s-aband: #ff6b7a;
  --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
/* El atributo hidden debe ganar siempre sobre reglas como .overlay { display:flex }. */
[hidden] { display: none !important; visibility: hidden !important; opacity: 0 !important; pointer-events: none !important; }
.overlay[hidden], .modal-backdrop[hidden], .modal[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  color: var(--fg);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  padding-inline: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* Safe area inferior: el contenido no queda bajo el home indicator del iPhone. */
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  /* Fondo atmosferico: dos halos ambientales fijos y una micro-trama tecnica. */
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 780px at 0% 0%, var(--halo-indigo), transparent 72%),
    radial-gradient(950px 680px at 100% 0%, var(--halo-emerald), transparent 72%),
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 44px 44px, 44px 44px;
  background-position: 0 0, 0 0, -1px -1px, -1px -1px;
  background-repeat: no-repeat, no-repeat, repeat, repeat;
  background-attachment: fixed, fixed, fixed, fixed;
}
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  /* Safe area superior: el titulo "GameVault" no queda bajo la barra de estado
     ni la Dynamic Island cuando se abre como PWA standalone. */
  padding-top: calc(16px + env(safe-area-inset-top, 0px));
  padding-bottom: 56px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 18px;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

/* barra superior */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; margin-right: auto; }
.brand-copy { display: flex; flex-direction: column; min-width: 0; }
.brand-mark {
  width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(145deg, rgba(99,102,241,.20), rgba(168,85,247,.06));
  border: 1px solid rgba(129,140,248,.48);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.14), 0 0 18px rgba(99,102,241,.28);
}
.brand-mark svg { display: block; width: 36px; height: 36px; }
.brand h1 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.035em; white-space: nowrap; }
.brand-copy > span { color: var(--muted); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.wordmark strong { color: #818CF8; font-weight: 800; }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .wordmark strong { background: linear-gradient(95deg, #818CF8, #A855F7); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; }
}
@media (max-width: 380px) {
  .brand { gap: 8px; }
  .brand-mark { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
  .brand-mark svg { width: 32px; height: 32px; }
}
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  box-sizing: border-box;
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: 9px 14px; font-weight: 600; transition: background .15s, border-color .15s;
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: #34405a; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { background: #95a0ff; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--s-aband); }
.btn.danger.armed { background: var(--s-aband); color: var(--accent-ink); border-color: var(--s-aband); }
.btn svg { width: 16px; height: 16px; display: block; flex: none; }
.btn.recommend { border-color: #3c4570; background: var(--panel-2); }
.btn.recommend:hover { border-color: var(--accent); background: #242c46; }
.btn.recommend svg { color: var(--accent); }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: rgba(127,140,255,.18); color: var(--accent); font-size: 11px; font-weight: 700; line-height: 1;
}
.btn.configured .badge { background: var(--accent); color: var(--accent-ink); }

/* selector de idioma */
.lang-pick {
  display: inline-flex; align-items: center; gap: 6px; height: 38px;
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: 0 8px 0 10px;
}
.lang-pick > svg { width: 15px; height: 15px; display: block; color: var(--muted); flex: none; }
.lang-select {
  appearance: none; border: 0; background: transparent; color: var(--fg);
  font-weight: 700; font-size: 12px; letter-spacing: .08em;
  padding: 6px 4px; min-width: 44px; cursor: pointer;
}
.lang-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.lang-select option { background: var(--panel); color: var(--fg); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* avisos */
.note {
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; color: var(--muted);
}
.note b { color: var(--fg); font-weight: 600; }
.note .btn { padding: 6px 10px; margin-left: auto; }

/* estadisticas */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; background: var(--panel); overflow: hidden; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; min-width: 0; border-right: 1px solid var(--line); }
.stat:last-child { border-right: 0; }
.stat .k { color: var(--muted); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; overflow-wrap: anywhere; }
.stat .v small { font-size: 14px; color: var(--muted); font-weight: 600; margin-left: 2px; }
.stat .s { color: var(--muted); font-size: 12px; }

.insight { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.panel { border: 1px solid var(--line); border-radius: 14px; background: var(--panel); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.panel h2 { margin: 0; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.stack { display: flex; height: 10px; border-radius: 6px; overflow: hidden; background: var(--panel-2); gap: 2px; }
.stack i { display: block; min-width: 3px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.legend em { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend b { color: var(--fg); font-weight: 600; }
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar { display: grid; grid-template-columns: minmax(0, 130px) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12px; }
.bar .n { white-space: normal; overflow-wrap: anywhere; }
.bar .t { height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.bar .t i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.bar .c { color: var(--muted); font-variant-numeric: tabular-nums; }

/* superficies de cristal: KPIs, paneles de estado/plataforma y agrupaciones */
.stats, .panel, .note, .owned-group, .console-game-group {
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--glass-rim);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .04);
}

/* pestañas principales y filtros */
.view { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.view-tabs {
  position: relative;
  display: flex; flex-wrap: wrap; gap: 4px; min-width: 0;
}
.view-tabs::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(99,102,241,.45) 22%, rgba(16,185,129,.32) 78%, transparent);
  pointer-events: none;
}
.view-tab {
  position: relative;
  border: 0; border-bottom: 2px solid transparent; background: transparent;
  color: var(--muted); padding: 10px 14px; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  transition: color .18s ease, text-shadow .18s ease;
}
.view-tab:hover { color: var(--fg); }
.view-tab[aria-pressed="true"] {
  color: var(--fg); border-bottom-color: var(--accent-bright);
  text-shadow: 0 0 14px rgba(127,140,255,.45);
}
.view-tab[aria-pressed="true"]::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: -2px; height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, rgba(99,102,241,.55), #9aa3ff, rgba(99,102,241,.55));
  box-shadow: 0 0 12px rgba(99,102,241,.8), 0 0 26px rgba(99,102,241,.35);
}
.view-tab .badge { min-width: 22px; height: 20px; font-size: 11px; }
.view-tab.configured .badge { background: var(--accent); color: var(--accent-ink); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.tab {
  border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 7px 14px;
  color: var(--muted); font-weight: 600; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center;
}
.tab:hover { color: var(--fg); border-color: #34405a; }
.tab[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.tab .c { font-size: 12px; opacity: .7; font-variant-numeric: tabular-nums; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.field {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; min-width: 0;
}
.field:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.toolbar .search { flex: 1 1 220px; }
.toolbar select.field { flex: 0 1 190px; min-width: 0; }
.owned-toggle {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px;
  border: 1px solid var(--line); background: var(--panel); border-radius: 10px;
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; cursor: pointer;
}
.owned-toggle:hover { border-color: #34405a; color: var(--fg); }
.owned-toggle input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; }
.owned-toggle:has(input:checked) { color: var(--fg); border-color: rgba(127,140,255,.45); background: rgba(127,140,255,.08); }
/* selector de hardware a ancho completo: 2 columnas en escritorio, 1 en movil */
.console-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 2px; min-width: 0; }
.owned-group { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 10px 12px 12px; min-width: 0; }
.owned-group-title { margin: 0 0 8px; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.owned-group-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.owned-group:has(.genre-chip[aria-pressed="true"]) { border-color: rgba(127,140,255,.38); }
.console-selector .msg { margin: 0; }

/* juegos agrupados por consola */
.console-game-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.console-game-group { border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); padding: 12px 14px; min-width: 0; }
.console-game-group h3 { margin: 0 0 10px; font-size: 14px; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.console-game-group h3 .num { color: var(--muted); font-size: 12px; font-weight: 600; }
.console-game-list { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.console-game-item {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0;
  text-align: left; border: 1px solid var(--line); background: var(--bg);
  border-radius: 9px; padding: 7px 10px; color: inherit;
}
.console-game-item:hover { border-color: #34405a; background: var(--panel); }
.console-game-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.console-game-item .t { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; font-weight: 600; }
.console-game-item .h { color: var(--muted); font-size: 12px; flex: none; }
select.field, select.input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 38px; min-width: 0; text-overflow: clip; }
/* El desplegable lo dibuja el sistema (iOS Safari / Android Chrome): lo dejamos
   sin transformaciones ni contenedores con overflow que puedan recortarlo. */
select.input option { background: var(--panel); color: var(--fg); }
#e-plat { min-height: 40px; touch-action: manipulation; }
#e-plat-manual { margin-top: 2px; }

/* rejilla de juegos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 10px; min-width: 0; text-align: left; background: none; border: 0; padding: 0; color: inherit; }
.cover {
  position: relative; aspect-ratio: 3 / 4; max-width: 100%; border-radius: 12px; overflow: hidden;
  /* Esquinas fijas: ejemplo arriba-izquierda, puntuación + trofeo arriba-derecha
     y plataforma sola abajo-izquierda. Ningún badge fluye: no hay escalones. */
  --badge-inset: 10px;
  --badge-gap: 4px;
  --badge-h: 20px;
  --score-w: 38px;
  border: 1px solid rgba(255,255,255,.06);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover .cover, .card:focus-visible .cover {
  transform: translateY(-2px);
  border-color: rgba(99,102,241,.55);
  box-shadow: 0 12px 26px rgba(0,0,0,.42), 0 0 20px rgba(99,102,241,.28);
}
.cover .ini { position: absolute; inset: 0; display: grid; place-items: center; font-size: 54px; font-weight: 800; letter-spacing: -0.04em; color: rgba(255,255,255,.16); }
/* La plataforma se ancla sola abajo-izquierda y usa todo el ancho disponible:
   nunca comparte fila con el trofeo ni empuja el pie de la tarjeta. */
.cover .plat {
  position: absolute; left: var(--badge-inset); right: var(--badge-inset); bottom: var(--badge-inset); z-index: 1;
  width: fit-content; max-width: calc(100% - var(--badge-inset) * 2);
  font-size: 9px; line-height: 1.25; letter-spacing: 0; text-transform: uppercase;
  background: rgba(8,10,16,.62); padding: 3px 5px; border-radius: 6px;
  white-space: nowrap; overflow-wrap: normal; hyphens: none; -webkit-hyphens: none;
}
/* Puntuación y trofeo comparten la esquina superior derecha. El trofeo se
   desplaza exactamente el ancho de la puntuación cuando esta existe (el score
   precede al trofeo en el DOM), quedando ambos en una sola fila superior. */
.cover .score {
  position: absolute; top: var(--badge-inset); right: var(--badge-inset); z-index: 2;
  box-sizing: border-box; min-width: var(--score-w); height: var(--badge-h);
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(8,10,16,.72); border-radius: 8px; padding: 0 4px;
  font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.cover .score small { color: var(--muted); font-weight: 600; }
.cover .trophy {
  position: absolute; top: var(--badge-inset); right: var(--badge-inset); z-index: 2;
  height: var(--badge-h); margin: 0;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 5px; border-radius: 7px;
  background: rgba(8,10,16,.78); border: 1px solid rgba(255,255,255,.10);
  color: var(--fg); font-size: 9px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; white-space: nowrap; hyphens: none;
}
.cover .score ~ .trophy { right: calc(var(--badge-inset) + var(--score-w) + var(--badge-gap)); }
.cover .trophy.is-full { color: var(--s-plat); border-color: rgba(199,155,255,.48); }
.cover .ex {
  position: absolute; top: var(--badge-inset); left: var(--badge-inset); z-index: 2;
  height: var(--badge-h); display: inline-flex; align-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 8px; font-weight: 700;
  padding: 0 4px; border-radius: 6px; letter-spacing: 0; text-transform: uppercase; white-space: nowrap;
}
.meta { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meta .t { font-weight: 650; white-space: normal; overflow-wrap: anywhere; }
/* Los generos envuelven enteros: nunca se recorta una letra a mitad en tarjetas estrechas. */
.meta .g { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 4px; color: var(--muted); font-size: 11px; line-height: 1.3; min-width: 0; max-width: 100%; }
.meta .g .gtag { max-width: 100%; background: var(--panel-2); border-radius: 5px; padding: 1px 5px; line-height: 1.35; white-space: normal; overflow-wrap: anywhere; }
.meta .g .gsep { display: none; }
.meta .d { color: var(--muted); font-size: 11px; opacity: .82; white-space: normal; overflow-wrap: anywhere; }
/* Pie de tarjeta: estado completo a la izquierda; horas y "+1h" a la derecha,
   siempre en una sola fila. margin-top:auto lo ancla abajo aunque el título o
   los géneros ocupen más alto, nivelando todas las tarjetas de la misma fila. */
.row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; min-width: 0; max-width: 100%; hyphens: none; -webkit-hyphens: none; }
.card-foot { margin-top: auto; flex-wrap: nowrap; align-items: center; min-height: 24px; }
.card-foot .pill { flex: 1 1 auto; min-width: 0; max-width: none; white-space: normal; overflow-wrap: anywhere; }
.card-foot .pill > span { display: block; min-width: 0; line-height: 1.15; white-space: normal; overflow-wrap: anywhere; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--c); }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: 0 0 7px; }
.card-actions { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap; hyphens: none; -webkit-hyphens: none; }
.hrs { flex: none; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { flex: none; border: 1px solid var(--line); background: var(--panel); border-radius: 8px; padding: 2px 8px; font-size: 11px; font-weight: 600; line-height: 1.2; color: var(--muted); white-space: nowrap; }
.plus:hover { color: var(--fg); border-color: #34405a; }
.empty { border: 1px dashed var(--line); border-radius: 14px; padding: 44px 20px; text-align: center; color: var(--muted); display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty b { color: var(--fg); font-size: 16px; }

/* tarjetas de juego: cristal, rim lighting superior y resplandor ambiental */
.grid > .card, .game-card {
  position: relative;
  isolation: isolate;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-top: 1px solid var(--glass-rim);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 10px 26px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.04);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.grid > .card::before, .game-card::before {
  content: "";
  position: absolute; left: 10px; right: 10px; top: 10px; height: 60%;
  border-radius: 12px;
  background: radial-gradient(70% 70% at 50% 45%, rgba(99,102,241,.40), transparent 78%);
  filter: blur(20px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  z-index: -1;
}
.grid > .card:hover, .grid > .card:focus-within,
.game-card:hover, .game-card:focus-within {
  transform: translateY(-4px);
  border-color: var(--accent-bright);
  box-shadow: 0 18px 38px rgba(0,0,0,.38), 0 0 22px rgba(99,102,241,.20), inset 0 1px 0 rgba(255,255,255,.08);
}
.grid > .card:hover::before, .grid > .card:focus-within::before,
.game-card:hover::before, .game-card:focus-within::before {
  opacity: 1;
  transform: translateY(0);
}

/* ventanas */
.overlay, .modal-backdrop { position: fixed; inset: 0; background: rgba(5,7,12,.74); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: calc(24px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); z-index: 20; }
.modal, .modal-backdrop .modal {
  width: 100%; max-width: 540px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 16px; margin: auto;
  /* Fallback para iOS anteriores a 15.4, donde todavia no existe dvh. */
  max-height: calc(100vh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  /* Alto dinamico real: el dialogo nunca crece bajo la barra de estado ni el home indicator. */
  max-height: calc(100dvh - 24px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal h3 { margin: 0; font-size: 18px; letter-spacing: -0.01em; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.full { grid-column: 1 / -1; }
.lbl { display: flex; flex-direction: column; gap: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); min-width: 0; }
.input { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--fg); width: 100%; min-width: 0; }
.input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea.input { min-height: 72px; resize: vertical; }
.err { color: var(--s-aband); font-size: 12px; text-transform: none; letter-spacing: 0; min-height: 0; }
.scores { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 4px; }
.scores button { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 0; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.scores button:hover { color: var(--fg); border-color: #34405a; }
.scores button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Todos los géneros (incluidos los híbridos) deben verse sin scroll interno. */
.genre-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px; }
.genre-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  border-radius: 999px; padding: 6px 11px; font-size: 12px; font-weight: 600;
  letter-spacing: 0; text-transform: none; transition: background .15s, border-color .15s, color .15s;
}
.genre-chip:hover { color: var(--fg); border-color: #34405a; }
.genre-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Enlace discreto para pasar de la vista compacta al catálogo completo de géneros. */
.genre-actions { display: flex; align-items: center; min-height: 14px; }
.genre-actions .link-btn { color: var(--accent); opacity: .85; }
.genre-actions .link-btn:hover { opacity: 1; }
.hoursrow { display: flex; gap: 6px; }
.hoursrow .input { flex: 1; }
.hoursrow .plus { padding: 0 10px; border-radius: 10px; }

/* autocompletado de ficha */
.title-row { display: flex; align-items: stretch; gap: 8px; min-width: 0; }
.title-row .input { flex: 1 1 auto; min-width: 0; }
.btn.autofill { flex: none; border-color: #3c4570; background: var(--panel-2); }
.btn.autofill svg { color: var(--accent); }
.btn.autofill:hover:not(:disabled) { background: #242c46; border-color: var(--accent); }
.btn.autofill:disabled { cursor: progress; opacity: .72; }
.autofill-msg { display: block; font-size: 11px; text-transform: none; letter-spacing: 0; line-height: 1.45; }
.autofill-msg.is-searching { color: var(--accent); }
.autofill-msg.is-ok { color: var(--s-done); }
.autofill-msg.is-warn { color: var(--s-pend); }
.autofill-msg.is-error { color: var(--s-aband); }
textarea.input.summary { min-height: 54px; }
.spinner {
  width: 12px; height: 12px; flex: none; display: inline-block; border-radius: 50%;
  border: 2px solid rgba(232,235,243,.25); border-top-color: var(--accent);
  animation: gv-spin .7s linear infinite;
}
@keyframes gv-spin { to { transform: rotate(360deg); } }
.foot { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
/* Pie de los dialogos: Cancelar/Guardar quedan completos y separados del borde inferior. */
.modal .foot { padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
.foot .left { margin-right: auto; }
.pick { display: flex; gap: 16px; align-items: center; }
.pick .cover { width: 120px; flex: none; }
.pick .info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.pick .info h4 { margin: 0; font-size: 22px; letter-spacing: -0.02em; text-wrap: balance; overflow-wrap: anywhere; }
.pick .info p { margin: 0; color: var(--muted); }
.shuffling .info h4 { color: var(--muted); }
.rec-pick { align-items: flex-start; }
.rec-pick .cover { width: 132px; }
.rec-pick .info { flex: 1; }
.facts { margin: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.fact { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.fact dt { color: var(--muted); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.fact dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.rec-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.rec-summary { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
textarea.mono { font-family: var(--mono); font-size: 12px; min-height: 200px; }
.msg { color: var(--muted); font-size: 12px; min-height: 16px; }

/* ---------- v1.3.0: sesiones, logros, colecciones y resumen anual ---------- */
/* Pestañas, etiquetas y valores: si no caben se parten en varias lineas, nunca
   se recortan con puntos suspensivos ni se parte una palabra a guion. */
.view-tab, .view-tab span, .tabs .tab, .toolbar .col-manage,
.year-row, .ach-mini, .subpanel > summary,
.dlc-pill, .dlc-name, .dlc-hours, .dlc-price, .dlc-add,
.check-row span, .inv-row .c,
.stat .v, .stat .v small, .card-actions, .hrs, .dlc-badge {
  hyphens: none; -webkit-hyphens: none; overflow-wrap: anywhere;
}
.view-tab { max-width: 100%; }

/* Secciones plegables dentro de la ficha: el modal sigue compacto hasta que se abren. */
.subpanel { border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); min-width: 0; }
.subpanel > summary {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; font-size: 11px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.subpanel > summary::-webkit-details-marker { display: none; }
.subpanel > summary::before { content: "+"; color: var(--accent); font-size: 14px; line-height: 1; }
.subpanel[open] > summary::before { content: "−"; }
.subpanel > summary:hover { color: var(--fg); }
.sub-sum { margin-left: auto; color: var(--accent); font-size: 11px; letter-spacing: 0; text-transform: none; font-variant-numeric: tabular-nums; }
.sub-body { border-top: 1px solid var(--line); padding: 12px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.session-form { display: grid; grid-template-columns: 1fr .7fr .7fr; gap: 8px; align-items: end; }
.session-form .session-note { grid-column: 1 / 3; }
.session-form .session-add { grid-column: 3; min-height: 40px; justify-content: center; padding: 9px 8px; }
.session-list { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.session-item {
  display: flex; align-items: center; gap: 8px; min-width: 0; border: 1px solid var(--line);
  background: var(--bg); border-radius: 8px; padding: 6px 8px; font-size: 12px;
}
.session-item .sd { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; }
.session-item .sn { flex: 1 1 auto; min-width: 0; white-space: normal; overflow-wrap: anywhere; color: var(--fg); }
.session-item .sh { color: var(--accent); font-weight: 700; flex: none; font-variant-numeric: tabular-nums; }
.session-item .btn.sm { padding: 3px 7px; flex: none; }
.ach-body { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.ach-body .help { grid-column: 1 / -1; }
.ach-badge, .ach-mini {
  display: inline-flex; align-items: center; gap: 4px; border-radius: 999px;
  background: rgba(199,155,255,.16); color: var(--s-plat); border: 1px solid rgba(199,155,255,.45);
  font-size: 11px; font-weight: 800; padding: 3px 8px; line-height: 1.2;
}
.ach-badge { margin-bottom: 2px; }
.ach-mini { padding: 2px 6px; font-size: 10px; flex: none; }
.coll-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.coll-chip {
  border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  border-radius: 999px; padding: 5px 10px; font-size: 12px; font-weight: 600; max-width: 100%;
  white-space: normal; overflow-wrap: anywhere;
}
.coll-chip:hover { color: var(--fg); border-color: #34405a; }
.coll-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.coll-manage { padding: 8px 10px; font-size: 12px; }
.coll-create { display: flex; gap: 8px; align-items: stretch; }
.coll-create .input { flex: 1; }
.coll-list { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.coll-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.coll-row .input { flex: 1; }
.coll-row .btn { flex: none; }

/* vista "Resumen anual" */
.wrapped-head { flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.wrapped-title { min-width: 0; }
.wrapped-title h2 { font-size: 15px; letter-spacing: -0.01em; text-transform: none; color: var(--fg); }
.wrapped-title .msg { margin: 4px 0 0; }
.year-pick { flex-direction: row; align-items: center; gap: 8px; }
.year-pick select { min-width: 132px; max-width: 190px; }
.year-list { display: flex; flex-direction: column; gap: 6px; }
.year-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: 10px; align-items: center;
  width: 100%; min-width: 0; text-align: left; border: 1px solid var(--line); background: var(--bg);
  border-radius: 9px; padding: 8px 10px; color: var(--fg); font-size: 12px;
}
.year-row:hover { border-color: #34405a; background: var(--panel); }
.year-row[aria-pressed="true"] { border-color: var(--accent); background: rgba(127,140,255,.10); }
.year-row .y { font-weight: 700; color: var(--accent); }
.year-row .t { height: 6px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.year-row .t i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #A855F7); border-radius: 4px; }
.year-row .h, .year-row .f { color: var(--muted); font-variant-numeric: tabular-nums; }
.wrapped-insight { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wrapped-stats .stat .k { overflow-wrap: anywhere; }

/* ---------- Etapa 2: DLC, precios e inversion ---------- */
/* El desplegable de moneda necesita sitio para la etiqueta y la flecha: con
   92px se recortaba a "E..". Sin ellipsis, se ve siempre "EUR (€)", "UYU ($U)"... */
.price-currency { flex: 0 0 120px; min-width: 112px; text-overflow: clip; }
/* "Moneda principal" (pestana Resumen): el <select> se rellena desde JS. Este
   ancho evita el recuadro vacio/cortado y deja ver la divisa seleccionada. */
#inv-currency {
  flex: 0 0 auto; width: auto; min-width: 164px; max-width: none;
  min-height: 40px; padding: 9px 38px 9px 12px;
  white-space: nowrap; text-overflow: clip; color: var(--fg);
  text-transform: none; letter-spacing: 0;
  background-color: var(--panel);
}
#inv-currency option { background: var(--panel); color: var(--fg); }
.free-field { gap: 6px; }
.check-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.check-row input { width: 17px; height: 17px; accent-color: var(--accent); flex: none; }
.check-row span { color: var(--fg); font-size: 12px; font-weight: 500; letter-spacing: 0; text-transform: none; }
.input:disabled { opacity: .5; }
/* DLC en dos filas limpias: estado + horas, luego precio (min 90px) + moneda
   completa + "Gratis / Suscripción (0)". Nunca tres columnas estrechas. */
.dlc-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: end; }
.dlc-form .dlc-title, .dlc-form .dlc-add { grid-column: 1 / -1; }
.dlc-form .dlc-add { min-height: 40px; justify-content: center; }
.dlc-row { display: grid; gap: 8px; min-width: 0; }
.dlc-row-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dlc-row-cost { grid-template-columns: minmax(90px, 1fr) 124px minmax(0, 1.25fr); }
.dlc-row-cost .input { width: 100%; min-width: 0; }
.dlc-row-cost .dlc-price-field .input { min-width: 90px; }
.dlc-row-cost .price-currency { flex: none; width: 100%; min-width: 0; text-overflow: clip; }
.dlc-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.dlc-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto auto;
  align-items: center; gap: 7px; min-width: 0; border: 1px solid var(--line);
  background: var(--bg); border-radius: 8px; padding: 6px 8px; font-size: 12px;
}
.dlc-pill {
  border: 1px solid var(--c); color: var(--c); border-radius: 999px;
  padding: 2px 7px; font-size: 10px; font-weight: 800; background: rgba(127,140,255,.08);
}
.dlc-name { min-width: 0; white-space: normal; overflow-wrap: anywhere; color: var(--fg); }
.dlc-hours { color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
.dlc-price { color: var(--muted); font-variant-numeric: tabular-nums; }
.dlc-item .btn.sm { padding: 3px 7px; }
.dlc-badge {
  align-self: flex-start; border: 1px solid rgba(127,140,255,.4); color: var(--accent);
  border-radius: 999px; padding: 1px 6px; font-size: 9px; font-weight: 800;
  background: rgba(127,140,255,.10);
}
.investment { flex-direction: column; gap: 12px; }
.invest-stats .stat .v small { font-size: 11px; color: var(--muted); margin-left: 2px; }
.invest-insight { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.inv-list { display: flex; flex-direction: column; gap: 6px; }
.inv-row {
  display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 8px; align-items: center;
  border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 7px 9px; font-size: 12px;
}
.inv-row .rank { color: var(--accent); font-weight: 800; }
.inv-row .n { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.inv-row .c { color: var(--muted); font-variant-numeric: tabular-nums; }


/* cover art */
.cover img.cover-img { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; display:block; }
.cover.has-img .ini { display:none; }
.cover-preview { width:72px; aspect-ratio:3/4; border-radius:10px; overflow:hidden; border:1px solid var(--line); background:var(--panel-2); display:grid; place-items:center; flex:none; position:relative; }
.cover-preview img { width:100%; height:100%; object-fit:cover; display:block; }
.cover-preview .ini { font-size:24px; font-weight:800; color:rgba(255,255,255,.18); }
.cover-preview.has-img .ini { display:none; }
.cover-row { display:flex; gap:10px; align-items:flex-start; }
.cover-controls { display:flex; flex-direction:column; gap:8px; flex:1; min-width:0; }
.cover-actions { display:flex; flex-wrap:wrap; gap:8px; }
.btn.sm { padding:7px 10px; font-size:12px; border-radius:8px; }
.help { font-size:11px; color:var(--muted); text-transform:none; letter-spacing:0; line-height:1.4; }
.link-btn { align-self:flex-start; border:0; background:none; padding:0; color:var(--accent); font-size:11px; letter-spacing:0; text-transform:none; text-decoration:underline; text-underline-offset:2px; }
.link-btn:hover { color:var(--fg); }
.file-input { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); white-space:nowrap; border:0; }
@media (max-width: 767px) {
  /* Ninguna palabra se parte con guion en Safari iOS / Chrome Android. */
  .wrap, .modal { hyphens: none; -webkit-hyphens: none; word-break: normal; }
  /* No usar padding-block aqui: sobrescribiria el padding-top con safe area. */
  .wrap { padding-bottom: 40px; gap: 14px; }
  .top { align-items: stretch; gap: 10px; }
  .brand { width: 100%; margin-right: 0; }
  .brand .wordmark { font-size: 20px; }
  .actions { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  /* Las etiquetas largas ("Recomiéndame un juego") deben partirse dentro del
     botón: sin nowrap ni anchos fijos, el icono y el texto nunca desbordan. */
  .actions .btn {
    box-sizing: border-box; width: 100%; max-width: 100%; min-width: 0;
    height: auto; min-height: 40px; padding: 9px 10px;
    display: inline-flex; flex-wrap: wrap; align-items: center; align-content: center;
    justify-content: center; gap: 4px 6px; text-align: center;
    font-size: 13px; line-height: 1.25; white-space: normal;
    overflow-wrap: anywhere;
  }
  .actions .btn > span { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
  .actions .btn svg { flex: 0 0 auto; }
  .actions .lang-pick { grid-column: 1 / -1; justify-content: center; box-sizing: border-box; max-width: 100%; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 14px 14px; min-width: 0; border-right: 1px solid var(--line); }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stat .v { font-size: 24px; }
  .insight { grid-template-columns: minmax(0, 1fr); }
  .console-groups, .console-game-groups { grid-template-columns: minmax(0, 1fr); }
  .view-tab { padding: 10px 9px; font-size: 13px; }
  .toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .toolbar .search { grid-column: 1 / -1; width: 100%; min-width: 0; }
  .toolbar select.field { width: 100%; max-width: 100%; min-width: 0; flex: none; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card, .cover, .meta, .row { min-width: 0; max-width: 100%; }
  .meta .t { white-space: normal; }
  .meta .g { white-space: normal; overflow: visible; }
  .grid .cover {
    --badge-inset: 8px;
    --badge-gap: 3px;
    --badge-h: 18px;
    --score-w: 34px;
  }
  .grid .cover .plat {
    bottom: 8px; max-width: calc(100% - 16px);
    font-size: clamp(6px, 2.2vw, 9px); letter-spacing: .02em; padding: 2px 5px;
  }
  .grid .cover .score { padding: 0 3px; font-size: 8px; }
  .grid .cover .trophy { padding: 0 2px; font-size: 8px; }
  .grid .cover .ex { padding: 0 2px; font-size: 7px; }
  .card-foot { gap: 4px; }
  .card-actions { gap: 3px; }
  .card-actions .plus { padding: 2px 5px; }
  .form { grid-template-columns: minmax(0, 1fr); }
  .pick { flex-direction: column; align-items: flex-start; }
  .modal { padding: 18px; }
  .foot { justify-content: stretch; }
  .foot .btn { flex: 1; justify-content: center; }
  .foot .left { margin-right: 0; width: 100%; flex-basis: 100%; }
  .cover-row { align-items: stretch; }
  .title-row { flex-wrap: wrap; }
  .title-row .input { flex-basis: 100%; }
  .btn.autofill { width: 100%; justify-content: center; }
  /* Pestañas: etiquetas completas en una o varias lineas, sin guiones partidos. */
  .view-tab { padding: 10px 8px; font-size: 12px; flex: 0 1 auto; }
  .tabs .tab, .toolbar .col-manage { hyphens: none; -webkit-hyphens: none; overflow-wrap: anywhere; }
  .toolbar .col-manage { width: 100%; justify-content: center; }
  /* Filtros de estado: 6 píldoras completas en 2 filas de 3, sin scroll lateral. */
  .tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    overflow-x: visible;
    padding-bottom: 0;
  }
  .tabs .tab {
    box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%;
    justify-content: center; text-align: center;
    padding: 8px 6px; font-size: 0.78rem;
    white-space: normal; hyphens: none; -webkit-hyphens: none; overflow-wrap: anywhere;
    gap: 4px;
  }
  .tabs .tab .c { font-size: 10px; }
  .wrapped-head { flex-direction: column; align-items: stretch; }
  .year-pick { justify-content: space-between; }
  .year-pick select { max-width: 60%; }
  .wrapped-insight { grid-template-columns: minmax(0, 1fr); }
  .year-row { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; }
  .year-row .f { display: none; }
  .session-form { grid-template-columns: 1fr 1fr; }
  .session-form .session-note { grid-column: 1 / -1; }
  .session-form .session-add { grid-column: 1 / -1; }
  .ach-body { grid-template-columns: 1fr 1fr; }
  .ach-body .ach-badge { grid-column: 1 / -1; }
  .coll-create { flex-wrap: wrap; }
  .coll-create .input { flex-basis: 100%; }
  .coll-create .btn { width: 100%; justify-content: center; }
  .coll-row { flex-wrap: wrap; }
  .coll-row .input { flex-basis: 100%; }
  .coll-row .btn { flex: 1; justify-content: center; }
  .subpanel > summary { font-size: 10px; padding: 9px 10px; }
  .sub-sum { overflow-wrap: anywhere; text-align: right; }
  /* Etapa 2: formularios y listas de DLC e inversion legibles con una mano. */
  /* En movil la fila del costo pasa a precio + moneda, con el checkbox debajo. */
  .dlc-row-cost { grid-template-columns: minmax(90px, 1fr) 124px; }
  .dlc-row-cost .dlc-free-field { grid-column: 1 / -1; }
  .price-currency { flex: 1 1 116px; min-width: 104px; }
  .dlc-item { grid-template-columns: auto minmax(0, 1fr) auto auto; }
  .dlc-item .dlc-price { grid-column: 2; }
  .dlc-item .btn.sm { padding: 4px 6px; }
  .invest-insight { grid-template-columns: minmax(0, 1fr); }
  .investment .year-pick { flex-wrap: wrap; justify-content: space-between; }
  .investment .year-pick #inv-currency {
    flex: 1 1 100%; width: 100%; min-width: 0; max-width: 100%;
  }
  .inv-row .c { font-size: 11px; }
}
@media (max-width: 519.98px) {
  /* Pie en una sola fila también en móvil: el estado se parte dentro de su
     píldora antes que bajar horas y "+1h" a una segunda línea. */
  .card-foot { flex-wrap: nowrap; gap: 4px; }
  .card-foot .pill { width: auto; max-width: none; font-size: 10px; }
  .card-foot .card-actions { width: auto; max-width: none; justify-content: flex-end; }
  .card-foot .hrs { font-size: 11px; }
  .card-foot .plus { padding: 2px 5px; font-size: 10px; }

  /* La plataforma conserva su ancho útil dentro de la portada, sin invadir
     los márgenes ni competir con los badges superiores. */
  .grid .cover .plat { max-width: calc(100% - 16px); }
}

@media (max-width: 380px) {
  .actions { grid-template-columns: 1fr; }
  .stat .v { font-size: 22px; }
  .fact { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Pantallas muy estrechas: el precio conserva sus 90px y la moneda su etiqueta
   completa; cada control pasa a una linea en vez de comprimirse. */
@media (max-width: 359px) {
  .dlc-row-cost { grid-template-columns: minmax(90px, 1fr); }
  .dlc-row-cost .price-currency { width: 100%; min-width: 112px; }
  /* Ajuste suave de fuente en móvil muy estrecho: caben "PC / STEAM",
     "NINTENDO SWITCH" y "GAME BOY ADVANCE (GBA)" sin recortes. */
  .grid .cover {
    --badge-inset: 6px;
    --badge-gap: 2px;
    --badge-h: 16px;
    --score-w: 28px;
  }
  .grid .cover .plat {
    bottom: 6px; max-width: calc(100% - 12px);
    font-size: clamp(6px, 2vw, 7px); letter-spacing: 0; padding: 2px 4px;
  }
  .grid .cover .score, .grid .cover .trophy, .grid .cover .ex {
    padding-inline: 2px; font-size: 6.5px;
  }
}

@media (max-width: 299px) {
  .grid .cover {
    --badge-inset: 4px;
    --badge-gap: 1px;
    --badge-h: 14px;
    --score-w: 23px;
  }
  .grid .cover .plat {
    bottom: 4px; max-width: calc(100% - 8px);
    font-size: clamp(5px, 1.8vw, 6px); padding: 2px 3px;
  }
  .grid .cover .score, .grid .cover .trophy, .grid .cover .ex {
    padding-inline: 2px; font-size: 5.5px;
  }
  .card-foot { align-items: flex-end; }
  .card-foot .pill { font-size: 9px; line-height: 1.05; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
