/* RetrisePlus — interfaz web. Tema oscuro, pensada también para mando (SteamOS). */

:root {
  --bg: #0a0b10;
  --bg-2: #11131b;
  --surface: #161925;
  --surface-2: #1e2232;
  --surface-3: #272c40;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef0f7;
  --text-2: #a7acc0;
  --text-3: #6f758c;
  --accent: #8b5cf6;
  --accent-2: #ec4899;
  --accent-soft: rgba(139, 92, 246, 0.16);
  --grad: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  --ok: #34d399;
  --warn: #fbbf24;
  --danger: #f87171;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --focus: 0 0 0 3px var(--bg), 0 0 0 6px #c4b5fd;
  --header-h: 68px;
  --card-w: 168px;
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
:focus { outline: none; }
/* Tamaño por defecto de los iconos; los contextos concretos lo sobrescriben más abajo. */
svg.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.18em; }
:focus-visible { box-shadow: var(--focus); }
::selection { background: var(--accent); color: white; }

/* Fondo con brillo sutil */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 10% -10%, rgba(139, 92, 246, 0.14), transparent 60%),
    radial-gradient(700px 400px at 100% 0%, rgba(236, 72, 153, 0.08), transparent 60%);
  z-index: -1;
}

/* ---- Cabecera ------------------------------------------------------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 28px;
  background: rgba(10, 11, 16, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.brand { flex: none; display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 19px; letter-spacing: -0.02em; white-space: nowrap; }
.brand img { width: 32px; height: 32px; }
.brand b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav { flex: none; display: flex; gap: 4px; }
.nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  color: var(--text-2); font-weight: 600;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { color: var(--text); background: var(--surface); }
.nav a.active { color: var(--text); background: var(--surface-2); }
.nav svg { width: 18px; height: 18px; }
.search {
  flex: 1; min-width: 0; max-width: 420px; margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 40px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  transition: border-color 0.15s, background 0.15s;
}
.search:focus-within { border-color: var(--accent); background: var(--surface-2); }
.search svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; }
.search input::placeholder { color: var(--text-3); }
.userchip {
  flex: none; display: flex; align-items: center; gap: 10px;
  padding: 4px 14px 4px 4px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 600; white-space: nowrap;
}
.userchip:hover { border-color: var(--line-strong); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--grad); color: white; font-weight: 800; font-size: 14px; text-transform: uppercase;
}
.avatar.guest { background: var(--surface-3); color: var(--text-2); }

main { padding: 28px 28px 80px; max-width: 1680px; margin: 0 auto; }

/* ---- Botones y formularios ----------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--surface-2); color: var(--text);
  font-weight: 650; cursor: pointer; white-space: nowrap;
  transition: transform 0.1s, background 0.15s, border-color 0.15s, opacity 0.15s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn.primary { background: var(--grad); border-color: transparent; color: white; box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface); color: var(--text); }
.btn.danger { color: var(--danger); }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.icon { width: 42px; padding: 0; }
.btn.lg.icon { width: 52px; }
.btn.sm.icon { width: 34px; }
.btn.on { color: var(--accent-2); border-color: rgba(236, 72, 153, 0.5); }
.btn.on svg { fill: currentColor; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.input {
  height: 46px; padding: 0 14px;
  background: var(--bg-2); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  outline: none; transition: border-color 0.15s;
}
.input:focus { border-color: var(--accent); }
.hint { font-size: 13px; color: var(--text-3); }
.error { color: var(--danger); font-size: 14px; min-height: 1em; }

.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.platform-toggles { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); column-gap: 32px; }
.platform-toggles .switch:last-child { border-bottom: 1px solid var(--line); }
.switch input { appearance: none; width: 46px; height: 26px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; flex: none; transition: background 0.2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: white; transition: transform 0.2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }

/* ---- Portada (hero) ------------------------------------------------------ */

.hero {
  position: relative; overflow: hidden;
  min-height: 360px; border-radius: 24px;
  display: flex; align-items: flex-end;
  padding: 40px; margin-bottom: 40px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.hero-bg { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(36px) saturate(150%); opacity: 0.55; transform: scale(1.1); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(10, 11, 16, 0.95) 0%, rgba(10, 11, 16, 0.6) 55%, rgba(10, 11, 16, 0.2) 100%); }
.hero-content { position: relative; z-index: 1; display: flex; gap: 32px; align-items: flex-end; width: 100%; }
.hero-cover { width: 190px; flex: none; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.hero-text { flex: 1; min-width: 0; }
.hero-kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #c4b5fd; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px; }
.hero h1 { font-size: clamp(28px, 4vw, 48px); font-weight: 850; margin-bottom: 10px; }
.hero p { color: var(--text-2); margin: 0 0 22px; max-width: 560px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero.welcome { min-height: 300px; background: var(--grad); border: 0; }
.hero.welcome::after { background: radial-gradient(600px 300px at 90% 20%, rgba(255, 255, 255, 0.2), transparent), linear-gradient(90deg, rgba(10, 11, 16, 0.55), rgba(10, 11, 16, 0.1)); }

/* ---- Filas y cuadrículas ------------------------------------------------- */

.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.section-head h2 { font-size: 21px; font-weight: 750; }
.section-head a { color: var(--text-2); font-size: 14px; font-weight: 600; }
.section-head a:hover { color: var(--text); }

.row {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--card-w);
  gap: 18px; overflow-x: auto; overscroll-behavior-x: contain;
  padding: 8px 4px 18px; margin: -8px -4px 0;
  scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.row > * { scroll-snap-align: start; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: 22px 18px; }

.card { display: flex; flex-direction: column; gap: 10px; border-radius: var(--radius); position: relative; }
.card-art {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius); overflow: hidden;
  background: var(--surface-2);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.card-art img { width: 100%; height: 100%; object-fit: cover; }
.card:hover .card-art, .card:focus-visible .card-art { transform: translateY(-4px) scale(1.03); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); }
.card:focus-visible { box-shadow: none; }
.card:focus-visible .card-art { box-shadow: var(--focus), 0 18px 40px rgba(0, 0, 0, 0.55); }
.card-title { font-weight: 650; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { font-size: 12px; color: var(--text-3); margin-top: -6px; display: flex; gap: 6px; align-items: center; }
.badge {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  padding: 3px 8px; border-radius: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; color: white;
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px);
  border-left: 3px solid var(--pc, var(--accent));
}
.card-fav { position: absolute; top: 8px; right: 8px; z-index: 1; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: rgba(0, 0, 0, 0.55); color: var(--accent-2); }
.card-fav svg { width: 14px; height: 14px; fill: currentColor; }
.card-lock { position: absolute; inset: auto 8px 8px auto; z-index: 1; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.65); color: var(--text-2); }
.card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--grad); z-index: 1; }

/* Carátula generada cuando no hay imagen */
.placeholder {
  width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px; gap: 6px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 50%),
    linear-gradient(160deg, var(--pc, #444) 0%, #0d0f17 110%);
}
.placeholder span { font-weight: 800; font-size: 16px; line-height: 1.15; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.placeholder small { font-size: 11px; font-weight: 800; letter-spacing: 0.1em; opacity: 0.7; }

/* Consolas */
.platforms { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
.platform {
  position: relative; overflow: hidden;
  padding: 18px; border-radius: var(--radius); min-height: 104px;
  display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(140deg, color-mix(in srgb, var(--pc) 55%, #10121a) 0%, var(--surface) 75%);
  border: 1px solid var(--line);
  transition: transform 0.15s, border-color 0.15s;
}
.platform:hover, .platform:focus-visible { transform: translateY(-3px); border-color: var(--line-strong); }
.platform b { font-size: 26px; font-weight: 900; letter-spacing: -0.02em; opacity: 0.95; }
.platform span { font-size: 13px; color: var(--text-2); }
.platform small { position: absolute; top: 14px; right: 14px; font-size: 12px; color: var(--text-2); font-weight: 700; }

/* ---- Biblioteca ---------------------------------------------------------- */

.library { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - var(--header-h) - 40px); overflow-y: auto; padding: 4px; }
.sidebar h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); margin: 14px 12px 8px; }
.side-link { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 600; font-size: 14px; }
.side-link:hover { background: var(--surface); color: var(--text); }
.side-link.active { background: var(--accent-soft); color: var(--text); }
.side-link i { width: 8px; height: 8px; border-radius: 50%; background: var(--pc, var(--text-3)); flex: none; }
.side-link em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--text-3); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.toolbar h1 { font-size: 30px; font-weight: 850; }
.toolbar .count { color: var(--text-3); font-weight: 600; font-size: 15px; margin-left: 8px; }
.segmented { display: inline-flex; padding: 4px; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; }
.segmented button { border: 0; background: none; padding: 6px 14px; border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer; }
.segmented button.active { background: var(--surface-3); color: var(--text); }
.chips { display: none; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 16px; }
.chip { flex: none; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); }
.chip.active { background: var(--accent-soft); color: var(--text); border-color: rgba(139, 92, 246, 0.5); }

/* ---- Ficha de juego ------------------------------------------------------ */

.detail { position: relative; }
.detail-bg { position: fixed; inset: 0; z-index: -1; background-size: cover; background-position: center; filter: blur(60px) saturate(140%) brightness(0.45); opacity: 0.6; transform: scale(1.2); }
.detail-main { display: grid; grid-template-columns: 300px 1fr; gap: 44px; align-items: start; }
/* La imagen manda en la proporción (las cajas de SNES son apaisadas); la generada es 3:4. */
.detail-cover { border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.detail-cover img { width: 100%; height: auto; }
.detail-cover .placeholder, .hero-cover .placeholder { aspect-ratio: 3 / 4; }
.hero-cover img { width: 100%; height: auto; }
.detail-cover .placeholder span { font-size: 26px; }
.detail h1 { font-size: clamp(28px, 4vw, 46px); font-weight: 850; margin: 6px 0 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); }
.pill svg { width: 14px; height: 14px; }
.pill.platform-pill { color: white; background: color-mix(in srgb, var(--pc) 45%, transparent); border-color: color-mix(in srgb, var(--pc) 70%, transparent); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius); background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); color: #fde68a; margin-bottom: 24px; font-size: 14px; }
.notice.info { background: var(--accent-soft); border-color: rgba(139, 92, 246, 0.35); color: #ddd6fe; }
.notice svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.states { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.state { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--line); transition: transform 0.15s, border-color 0.15s; }
.state:hover, .state:focus-within { border-color: var(--line-strong); }
.state-shot { aspect-ratio: 4 / 3; background: #000; display: grid; place-items: center; color: var(--text-3); }
.state-shot img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.state-info { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; font-size: 13px; }
.state-info b { display: block; font-size: 14px; }
.state-info span { color: var(--text-3); }
.state-play { position: absolute; inset: 0 0 52px 0; }
.tag { display: inline-block; padding: 1px 7px; border-radius: 5px; background: var(--accent-soft); color: #c4b5fd; font-size: 11px; font-weight: 800; vertical-align: 2px; margin-left: 6px; }

/* ---- Paneles (cuenta, admin, login) -------------------------------------- */

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px; }
.panel h2 { font-size: 18px; margin-bottom: 4px; }
.panel > p { color: var(--text-2); margin: 0 0 18px; font-size: 14px; }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 20px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.page-title { font-size: 32px; font-weight: 850; margin-bottom: 24px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { padding: 18px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.stat b { display: block; font-size: 28px; font-weight: 850; letter-spacing: -0.02em; }
.stat span { color: var(--text-3); font-size: 13px; font-weight: 600; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); font-weight: 700; padding: 0 10px 10px; }
.table td { padding: 12px 10px; border-top: 1px solid var(--line); vertical-align: middle; }
.table .who { display: flex; align-items: center; gap: 10px; font-weight: 650; }
.table .row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.list-item:first-child { border-top: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item small { display: block; color: var(--text-3); }

.auth { min-height: calc(100vh - var(--header-h) - 120px); display: grid; place-items: center; }
.auth-card { width: min(440px, 100%); }
.auth-card .brand { justify-content: center; font-size: 26px; margin-bottom: 8px; }
.auth-card .brand img { width: 44px; height: 44px; }
.auth-card > p { text-align: center; color: var(--text-2); margin: 0 0 24px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; background: var(--bg-2); border-radius: 999px; margin-bottom: 22px; }
.tabs button { border: 0; background: none; height: 38px; border-radius: 999px; font-weight: 650; color: var(--text-2); cursor: pointer; }
.tabs button.active { background: var(--surface-3); color: var(--text); }
.icon-tile { display: inline-grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; background: var(--accent-soft); color: #c4b5fd; margin-bottom: 14px; }
.icon-tile svg { width: 30px; height: 30px; }
.icon-tile.ok { border-radius: 50%; background: rgba(52, 211, 153, 0.15); color: var(--ok); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- Varios -------------------------------------------------------------- */

.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty svg { width: 48px; height: 48px; color: var(--text-3); margin-bottom: 12px; }
.empty h3 { color: var(--text); margin-bottom: 6px; font-size: 19px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.spinner { width: 22px; height: 22px; border: 3px solid var(--surface-3); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.center { display: grid; place-items: center; padding: 80px 0; }

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { padding: 12px 18px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line-strong); box-shadow: var(--shadow); font-weight: 600; font-size: 14px; animation: toast-in 0.2s ease; }
.toast.error { border-color: rgba(248, 113, 113, 0.5); color: #fecaca; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.modal-back { position: fixed; inset: 0; z-index: 150; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade 0.15s; }
.modal { width: min(480px, 100%); max-height: 90vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); }
.modal h2 { font-size: 20px; margin-bottom: 8px; }
.modal p { color: var(--text-2); margin: 0 0 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }

/* Ayuda de mando abajo a la derecha */
.padhint { position: fixed; right: 20px; bottom: 18px; z-index: 40; display: none; gap: 16px; padding: 8px 14px; border-radius: 999px; background: rgba(10, 11, 16, 0.85); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); backdrop-filter: blur(10px); }
.padhint kbd { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 50%; background: var(--surface-3); color: var(--text); font: 800 11px var(--font); margin-right: 6px; }
body.gamepad .padhint { display: flex; }
body.gamepad, body.gamepad * { cursor: none !important; }
body.gamepad :focus { box-shadow: var(--focus); }
body.gamepad .card:focus .card-art { transform: translateY(-4px) scale(1.05); box-shadow: var(--focus), 0 18px 40px rgba(0, 0, 0, 0.55); }
body.gamepad .card:focus { box-shadow: none; }

/* Modo kiosco (SteamOS): todo un poco más grande y sin distracciones */
body.kiosk { --card-w: 190px; font-size: 16px; }
body.kiosk .kiosk-hide { display: none !important; }

/* ---- Responsive ---------------------------------------------------------- */

@media (max-width: 1000px) {
  .library { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .chips { display: flex; }
  .detail-main { grid-template-columns: 220px 1fr; gap: 28px; }
}
@media (max-width: 720px) {
  :root { --card-w: 132px; --header-h: 60px; }
  .topbar { padding: 0 16px; gap: 12px; }
  .brand span { display: none; }
  .nav a span { display: none; }
  .nav a { padding: 8px 10px; }
  .userchip { padding: 4px; }
  .userchip span:not(.avatar) { display: none; }
  main { padding: 20px 16px 80px; }
  .hero { padding: 24px; min-height: 0; }
  .hero-cover { display: none; }
  .detail-main { grid-template-columns: 1fr; }
  .detail-cover { width: 180px; }
  .panels { grid-template-columns: 1fr; }
  .grid { gap: 18px 12px; }
}
