/* =========================================================
   Game Net — estilos
   Paleta: #202020 #FF00B7 #FFFFFF #828282 · #434343 #333333 #161616
   Tipografía: Fredoka (redondeada, trazo grueso)
   ========================================================= */

:root {
  --accent: #FF00B7;
  --accent-ink: #FF00B7;
  --accent-soft: rgb(255 0 183 / .16);
  --glow: 0 0 .5rem rgb(255 0 183 / .85), 0 0 1.6rem rgb(255 0 183 / .55);
  --ok: #3ddc97;
  --danger: #ff5470;
  --col: 720px;
  --radius: 1.1rem;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: 'Fredoka', 'Nunito', 'Trebuchet MS', system-ui, sans-serif;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #202020; --deep: #161616; --card: #333333; --raised: #434343;
  --text: #ffffff; --muted: #9a9a9a; --line: #434343; --field: #202020;
}
html[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f1f4; --deep: #ffffff; --card: #ffffff; --raised: #e8e8ee;
  --text: #202020; --muted: #6a6a72; --line: #dcdce3; --field: #f1f1f4;
  --accent-ink: #c4008f; --accent-soft: rgb(255 0 183 / .1); --glow: 0 0 0 transparent;
}
html { font-size: 17px; -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
html[data-fs="1"] { font-size: 15px; }
html[data-fs="3"] { font-size: 19.5px; }
/* Ancho del contenido según pantalla (automático) */
@media (min-width: 900px)  { :root { --col: 860px; } body[data-nav="mensajes"] { --col: 980px; } body[data-nav="juegos"], body[data-nav="reportes"] { --col: 1040px; } }
@media (min-width: 1280px) { body[data-nav="juegos"] { --col: 1280px; } body[data-nav="reportes"] { --col: 1100px; } }
@media (min-width: 1700px) { body[data-nav="juegos"] { --col: 1560px; } }

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  line-height: 1.45; min-height: 100vh; min-height: 100dvh;
  font-weight: 400; overflow-wrap: break-word; word-break: normal; hyphens: manual;
}
a { color: inherit; text-decoration: none; }
p { margin: 0 0 .6rem; }
h1, h2 { margin: 0; line-height: 1.15; font-weight: 600; }
img, video { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: .4rem; }
button { font: inherit; color: inherit; cursor: pointer; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: .5rem; top: -4rem; z-index: 100; background: var(--accent); color: #fff; padding: .5rem 1rem; border-radius: .6rem; }
.skip:focus { top: .5rem; }
.dim { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; justify-content: center; }
.spacer { flex: 1; }
.hrow { display: flex; align-items: center; gap: .6rem; }
.hrow.end { justify-content: flex-end; margin-top: .4rem; }
.hrow.center { justify-content: center; }
.hrow.wrap { flex-wrap: wrap; }
.only-mobile { display: inline-grid; }

/* ---------- Iconos ---------- */
.ic { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-xs { width: .9rem; height: .9rem; } .ic-sm { width: 1.1rem; height: 1.1rem; }
.ic-lg { width: 2rem; height: 2rem; } .ic-xl { width: 3rem; height: 3rem; opacity: .55; }

/* ---------- Marca ---------- */
.wordmark {
  font-weight: 700; letter-spacing: .01em; color: #fff; font-size: 2.1rem;
  text-shadow: var(--glow);
}
html[data-theme="light"] .wordmark { color: var(--accent-ink); }
.wordmark.big { font-size: 3rem; text-align: center; }
.brand-mini {
  display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: .9rem;
  background: var(--deep); font-weight: 700; color: #fff; text-shadow: var(--glow); letter-spacing: .02em;
}
html[data-theme="light"] .brand-mini { color: var(--accent-ink); border: 1px solid var(--line); }

/* ---------- Estructura ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 30; display: flex; align-items: center; gap: .6rem;
  padding: calc(.55rem + env(safe-area-inset-top, 0px)) max(.8rem, calc((100% - var(--col)) / 2)) .55rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); view-transition-name: topbar;
}
.search { flex: 1; display: flex; align-items: center; gap: .5rem; background: var(--card); border-radius: 999px; padding: 0 1rem; height: 2.6rem; }
.search .ic { color: var(--muted); }
.search input { flex: 1; min-width: 0; background: none; border: 0; color: inherit; font: inherit; height: 100%; outline: none; }
.search:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.search input::placeholder, input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
.icon-btn {
  display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  border: 0; background: transparent; color: inherit; flex: none; transition: background .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--card); }
.icon-btn:active { transform: scale(.9); }
.icon-btn.ok { background: var(--accent); color: #fff; width: 2.1rem; height: 2.1rem; }
.icon-btn.no { background: var(--raised); width: 2.1rem; height: 2.1rem; }
.icon-btn.add { background: var(--accent-soft); color: var(--accent-ink); width: 2.1rem; height: 2.1rem; }
.icon-btn.danger:hover { color: var(--danger); }

.page { max-width: var(--col); margin: 0 auto; padding: 4.9rem .9rem 7rem; padding-top: calc(4.9rem + env(safe-area-inset-top, 0px)); display: grid; gap: .9rem; align-content: start; }
.page-title { font-size: 1.5rem; margin: .3rem .2rem 0; }
.page-title.sm { font-size: 1.15rem; }

.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(.8rem + env(safe-area-inset-bottom, 0px)); width: min(calc(100% - 1.4rem), 520px);
  display: grid; grid-template-columns: repeat(6, 1fr); padding: .35rem;
  background: var(--deep); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 .6rem 1.6rem rgb(0 0 0 / .35);
  view-transition-name: tabbar;
}
.tabbar a { position: relative; display: grid; place-items: center; height: 2.8rem; border-radius: 999px; color: var(--muted); transition: color .2s, background .2s; }
.tabbar a:hover { color: var(--text); }
.tabbar a.on { color: #fff; background: var(--accent); box-shadow: 0 0 1.2rem rgb(255 0 183 / .55); }
.badge {
  position: absolute; top: .15rem; right: calc(50% - 1.4rem); min-width: 1.15rem; height: 1.15rem; padding: 0 .28rem; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: .68rem; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--deep);
}
.tabbar a.on .badge { background: #fff; color: var(--accent); }
.badge.static { position: static; border: 0; }

/* ---------- Drawer ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .55); opacity: 0; transition: opacity .25s; }
.scrim.show { opacity: 1; }
.drawer {
  position: fixed; z-index: 41; top: 0; bottom: 0; right: 0; width: min(86vw, 320px); background: var(--deep); padding: 1rem;
  border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .3s var(--ease); display: flex; flex-direction: column; gap: .6rem;
}
.drawer.show { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding-top: env(safe-area-inset-top, 0px); }
.drawer-title { font-weight: 600; font-size: 1.1rem; }
.drawer-user { display: flex; align-items: center; gap: .7rem; padding: .7rem; border-radius: var(--radius); background: var(--card); font-weight: 500; }
.drawer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.drawer-list a, .drawer-list button {
  display: flex; align-items: center; gap: .8rem; width: 100%; padding: .75rem .8rem; border-radius: .8rem; border: 0; background: none; text-align: left;
}
.drawer-list a:hover, .drawer-list button:hover { background: var(--card); }
.drawer-list .ic { color: var(--accent-ink); }

/* ---------- Toasts / confirm ---------- */
.toasts { position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); top: calc(.8rem + env(safe-area-inset-top, 0px)); display: grid; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: .6rem; padding: .75rem 1rem; border-radius: 1rem; background: var(--deep); border: 1px solid var(--line);
  box-shadow: 0 .6rem 1.6rem rgb(0 0 0 / .4); animation: toast-in .35s var(--ease); pointer-events: auto;
}
.toast.ok .ic { color: var(--ok); } .toast.error { border-color: var(--danger); } .toast.error .ic { color: var(--danger); }
.toast.out { opacity: 0; transform: translateY(-.5rem); transition: .3s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-.8rem) scale(.96); } }
dialog.confirm { border: 1px solid var(--line); border-radius: 1.2rem; background: var(--deep); color: var(--text); padding: 1.2rem; max-width: min(92vw, 360px); }
dialog.confirm::backdrop { background: rgb(0 0 0 / .6); }
dialog.confirm[open] { animation: toast-in .25s var(--ease); }

/* ---------- Botones ---------- */
.btn, .pill {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; border: 0; cursor: pointer; font-weight: 500;
  background: var(--accent); color: #fff; border-radius: 999px; padding: .62rem 1.2rem; line-height: 1.1;
  transition: transform .15s var(--ease), box-shadow .2s, background .2s;
}
.btn:hover, .pill:hover { box-shadow: 0 0 1.1rem rgb(255 0 183 / .55); }
.btn:active, .pill:active { transform: scale(.96); }
.btn.sm { padding: .42rem .85rem; font-size: .88rem; }
.btn.block { width: 100%; padding: .8rem; font-size: 1.05rem; }
.btn.ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 2px var(--raised); }
.btn.ghost:hover { box-shadow: inset 0 0 0 2px var(--accent); }
.btn.danger { background: var(--danger); } .btn.danger:hover { box-shadow: 0 0 1rem rgb(255 84 112 / .5); }
.btn.disabled { opacity: .55; pointer-events: none; }
.pill { padding: .3rem 1rem; font-size: .85rem; }

/* ---------- Tarjetas ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 1rem; min-width: 0; }
html[data-theme="light"] .card { box-shadow: 0 1px 0 var(--line), 0 .4rem 1.2rem rgb(20 20 40 / .05); }
.empty { display: grid; justify-items: center; gap: .7rem; text-align: center; padding: 2rem 1rem; color: var(--muted); }
.hero { padding: .6rem .2rem .2rem; }
.hero-sub { color: var(--muted); margin: .2rem 0 0; }
.strip-title { display: flex; align-items: center; gap: .55rem; font-size: 1.05rem; margin-bottom: .8rem; }
.strip-title .ic { color: var(--accent-ink); }

/* ---------- Blog ---------- */
.blog { padding: 0; overflow: hidden; display: grid; }
.blog-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; background: var(--raised); }
.blog-title { font-weight: 600; font-size: 1.05rem; line-height: 1.2; }
a.blog-title:hover { color: var(--accent-ink); }
.blog.full .blog-title { font-size: 1.35rem; }
.blog-meta { display: flex; align-items: center; gap: .6rem; padding: .8rem 1rem 0; font-size: .92rem; }
.blog-meta a strong { font-weight: 600; } .blog-meta a:hover strong { color: var(--accent-ink); }
.blog-excerpt { padding: .7rem 1rem 0; margin: 0; }
.prose { padding: .8rem 1rem 0; font-size: 1.02rem; line-height: 1.6; }
.blog-media { position: relative; display: block; margin: .8rem 1rem 0; border-radius: .9rem; overflow: hidden; background: var(--deep); }
.blog-media img, .blog-media video { width: 100%; max-height: 24rem; object-fit: cover; }
.media-tag, .media-count { position: absolute; top: .5rem; right: .5rem; padding: .2rem .55rem; border-radius: 999px; background: rgb(0 0 0 / .65); color: #fff; font-size: .8rem; display: inline-flex; align-items: center; gap: .3rem; }
.media-tag { right: auto; left: .5rem; }
.blog-actions { display: flex; align-items: center; gap: .3rem; padding: .7rem 1rem; }
.blog-actions form { margin: 0; }
.act { display: inline-flex; align-items: center; gap: .4rem; background: none; border: 0; padding: .35rem .6rem; border-radius: 999px; color: var(--muted); font-weight: 500; transition: color .15s, background .15s; }
.act:hover { background: var(--raised); color: var(--text); }
.act.liked { color: var(--accent-ink); } .act.liked .ic { fill: var(--accent); stroke: var(--accent); }
.act.pop .ic { animation: pop .45s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.5) rotate(-8deg); } 70% { transform: scale(.9); } 100% { transform: scale(1); } }
.blog-actions .pill { margin-left: auto; }
.gallery { display: grid; gap: .5rem; padding: .8rem 1rem 0; grid-template-columns: 1fr; }
.gallery.n2, .gallery.n4 { grid-template-columns: 1fr 1fr; }
.gallery.n3 { grid-template-columns: 1fr 1fr; } .gallery.n3 figure:first-child { grid-column: 1 / -1; }
.gallery figure { margin: 0; border-radius: .9rem; overflow: hidden; background: var(--deep); }
.gallery img, .gallery video { width: 100%; max-height: 30rem; object-fit: cover; }
.comments { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .9rem; }
.comments li { display: flex; gap: .7rem; } .comments p { margin: .1rem 0 0; }
.comment-form { display: flex; gap: .5rem; }
.comment-form input { flex: 1; }

/* ---------- Chips / tabs / segmentos ---------- */
.chip { white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; padding: .22rem .75rem; border-radius: 999px; background: var(--deep); color: var(--accent-ink); font-size: .82rem; font-weight: 500; border: 1px solid var(--line); }
a.chip:hover { border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chips.center { justify-content: center; margin: .4rem 0; }
.chip.big { padding: .45rem .95rem; font-size: .92rem; color: var(--text); }
.chip.big small { color: var(--muted); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.on small { color: #fff; opacity: .8; }
.chip.check input { position: absolute; opacity: 0; pointer-events: none; }
.chip.check { position: relative; cursor: pointer; }
.chip.check:has(input:checked) { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.check:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabs { display: flex; gap: .3rem; background: var(--card); padding: .3rem; border-radius: 999px; overflow-x: auto; scrollbar-width: none; }
.tabs a { flex: 1; text-align: center; padding: .5rem .8rem; border-radius: 999px; white-space: nowrap; color: var(--muted); font-weight: 500; transition: .2s; }
.tabs a.on { background: var(--accent); color: #fff; }
.tabs small { opacity: .85; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: .35rem; background: var(--field); padding: .3rem; border-radius: 1rem; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: .6rem .5rem; border-radius: .75rem; text-align: center; flex-direction: row; transition: .2s; }
.seg input:checked + span { background: var(--accent); color: #fff; box-shadow: 0 0 .9rem rgb(255 0 183 / .4); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
[data-setting="fuente"] span { flex-direction: column; gap: 0; } [data-setting="fuente"] small { font-size: .75rem; opacity: .8; }
.fs-1 { font-size: .95rem; } .fs-2 { font-size: 1.2rem; } .fs-3 { font-size: 1.5rem; }

/* ---------- Carruseles ---------- */
.carousel { display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x proximity; padding: .2rem .2rem .8rem; scrollbar-width: thin; scrollbar-color: var(--raised) transparent; }
.carousel.small { padding-bottom: .4rem; }
.tile { flex: 0 0 5.8rem; display: grid; justify-items: center; gap: .5rem; scroll-snap-align: start; }
.tile-link { display: grid; justify-items: center; gap: .4rem; text-align: center; }
.tile-link:hover .tile-name { color: var(--accent-ink); }
.tile-name { font-size: .85rem; max-width: 5.8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-actions { display: flex; gap: .4rem; margin: 0; }

/* ---------- Avatares ---------- */
.av { border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; font-weight: 600; color: #fff; background: hsl(var(--h, 320) 55% 42%); width: 3.2rem; height: 3.2rem; font-size: 1.2rem; }
.av-sm { width: 2.4rem; height: 2.4rem; font-size: .95rem; } .av-md { width: 3.2rem; height: 3.2rem; }
.av-lg { width: 5.2rem; height: 5.2rem; font-size: 2rem; box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--accent-soft); }
.av-xl { width: 7.5rem; height: 7.5rem; font-size: 3rem; box-shadow: 0 0 0 4px var(--card), 0 0 0 6px var(--accent); }

/* ---------- Formularios ---------- */
.form { display: grid; gap: 1rem; }
.field { display: grid; gap: .35rem; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { white-space: nowrap; font-weight: 500; font-size: .92rem; padding: 0; }
.field.inline { display: flex; align-items: center; gap: .5rem; } .field.inline input { width: auto; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], select, textarea {
  width: 100%; background: var(--field); border: 2px solid transparent; color: inherit; font: inherit; padding: .7rem .9rem; border-radius: .9rem; transition: border-color .2s, box-shadow .2s;
}
textarea { resize: vertical; min-height: 6rem; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.comment-form input { background: var(--field); }
.field.is-error input, .field.is-error textarea { border-color: var(--danger); }
.field.is-valid input { border-color: color-mix(in srgb, var(--ok) 70%, transparent); }
.hint { min-height: 1.1rem; color: var(--muted); font-size: .8rem; }
.field.is-error .hint { color: var(--danger); } .field.is-valid .hint { color: var(--ok); }
.counter { text-align: right; }
.pw { position: relative; } .pw input { padding-right: 3rem; }
.pw .icon-btn { position: absolute; right: .2rem; top: 50%; transform: translateY(-50%); width: 2.3rem; height: 2.3rem; }
.meter { display: flex; gap: .3rem; } .meter i { flex: 1; height: .28rem; border-radius: 9px; background: var(--raised); transition: background .25s; }
.meter[data-level="1"] i:nth-child(1) { background: var(--danger); }
.meter[data-level="2"] i:nth-child(-n+2) { background: #ffb02e; }
.meter[data-level="3"] i { background: var(--ok); }
.radio-list { display: grid; gap: .4rem; }
.radio { display: flex; align-items: center; gap: .7rem; padding: .7rem .9rem; border-radius: .9rem; background: var(--field); cursor: pointer; }
.radio input { accent-color: var(--accent); width: 1.1rem; height: 1.1rem; }
.radio:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.drop { display: grid; justify-items: center; gap: .3rem; padding: 1.4rem 1rem; border: 2px dashed var(--raised); border-radius: 1rem; text-align: center; cursor: pointer; transition: .2s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { border-color: var(--accent); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.2rem, 1fr)); gap: .6rem; }
.thumbs:empty { display: none; }
.thumb { position: relative; display: block; border-radius: .8rem; overflow: hidden; aspect-ratio: 1; background: var(--deep); cursor: pointer; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }
.thumb input { position: absolute; opacity: 0; }
.thumb-x { position: absolute; inset: auto 0 0 0; padding: .3rem; background: rgb(0 0 0 / .7); color: #fff; font-size: .75rem; display: flex; justify-content: center; align-items: center; gap: .3rem; }
.thumb:has(input:checked) { outline: 3px solid var(--danger); } .thumb:has(input:checked) img, .thumb:has(input:checked) video { opacity: .35; }
.thumb.err { outline: 3px solid var(--danger); }
.avatar-edit { display: flex; align-items: center; gap: 1rem; }
.danger-zone { border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent); background: transparent; }

/* ---------- Perfil ---------- */
.profile { display: grid; justify-items: center; gap: .3rem; text-align: center; padding-top: 1.6rem; }
.profile-name { font-size: 1.6rem; margin-top: .4rem; } .profile-about { max-width: 34ch; margin: .2rem 0; }
.stats { display: flex; gap: 2rem; margin: .8rem 0 1rem; } .stats div { text-align: center; }
.stats dt { color: var(--muted); font-size: .85rem; } .stats dd { margin: 0; font-size: 1.6rem; font-weight: 600; }

/* ---------- Listas ---------- */
.list { display: grid; gap: .2rem; }
.row-item { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .6rem .2rem; flex-wrap: wrap; }
.row-item + .row-item { border-top: 1px solid var(--line); }
.who { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.who span { display: grid; line-height: 1.2; } .who:hover strong { color: var(--accent-ink); }
.notif { display: flex; align-items: center; gap: .9rem; padding: .8rem .6rem; border-radius: .9rem; }
.notif + .notif { margin-top: .1rem; } .notif:hover { background: var(--raised); }
.notif.new { background: var(--accent-soft); }
.notif-ico { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--deep); color: var(--accent-ink); flex: none; }
.notif-body { display: grid; gap: .1rem; }

/* ---------- Mensajes ---------- */
.messenger { display: grid; gap: .9rem; min-width: 0; }
.messenger.in-chat .conv-list, .messenger:not(.in-chat) .chat { display: none; }
.conv-list { padding: .8rem; max-height: calc(100dvh - 16.5rem); overflow-y: auto; }
.conv-list ul { list-style: none; margin: .5rem 0 0; padding: 0; }
.mini-search { display: flex; align-items: center; gap: .5rem; background: var(--field); border-radius: 999px; padding: 0 .9rem; height: 2.5rem; }
.mini-search input { flex: 1; background: none; border: 0; padding: 0; color: inherit; font: inherit; outline: none; box-shadow: none; }
.newchat { margin-top: .6rem; } .newchat summary { cursor: pointer; display: flex; align-items: center; gap: .4rem; padding: .4rem .2rem; color: var(--accent-ink); font-weight: 500; list-style: none; }
.newchat summary::-webkit-details-marker { display: none; }
.conv { display: flex; align-items: center; gap: .8rem; padding: .65rem .5rem; border-radius: .9rem; }
.conv:hover { background: var(--raised); } .conv.on { background: var(--accent-soft); }
.conv-body { display: grid; flex: 1; min-width: 0; line-height: 1.25; }
.conv-body small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-side { display: grid; justify-items: end; gap: .2rem; }
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: calc(100dvh - 16.5rem); min-height: 20rem; max-height: 46rem; }
.page:has(.messenger.in-chat) .page-title { display: none; }
.page:has(.messenger.in-chat) .chat { height: calc(100dvh - 13.5rem); }
.chat[data-empty] { align-items: center; justify-content: center; }
.chat-head { display: flex; align-items: center; gap: .6rem; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
.chat-head .who { flex: 1; }
.menu { position: relative; } .menu summary { list-style: none; cursor: pointer; } .menu summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: 2.8rem; z-index: 5; min-width: 12rem; background: var(--deep); border: 1px solid var(--line); border-radius: 1rem; padding: .35rem; box-shadow: 0 .8rem 1.8rem rgb(0 0 0 / .4); animation: toast-in .2s var(--ease); }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .6rem .7rem; border-radius: .7rem; border: 0; background: none; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--card); }
.msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .45rem; scroll-behavior: smooth; }
.msg { max-width: 78%; align-self: flex-start; background: var(--raised); padding: .5rem .8rem; border-radius: 1.1rem 1.1rem 1.1rem .3rem; animation: msg-in .25s var(--ease); }
.msg p { margin: 0; white-space: pre-wrap; } .msg time { display: block; font-size: .7rem; opacity: .65; text-align: right; }
.msg.mine { align-self: flex-end; background: var(--accent); color: #fff; border-radius: 1.1rem 1.1rem .3rem 1.1rem; }
.msg.sending { opacity: .6; }
@keyframes msg-in { from { opacity: 0; transform: translateY(.5rem) scale(.97); } }
.composer { flex: none; display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--line); }
.composer input { flex: 1; border-radius: 999px; }

/* ---------- Reportes ---------- */
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(7.2rem, 1fr)); gap: .6rem; }
.stat { display: grid; gap: .1rem; padding: .8rem; border-radius: 1rem; background: var(--card); }
.stat .ic { color: var(--accent-ink); } .stat strong { font-size: 1.5rem; font-weight: 600; line-height: 1.1; } .stat small { color: var(--muted); }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); align-items: end; gap: .8rem 1rem; }
.filters .field.inline { display: grid; align-items: stretch; gap: .3rem; }
.filters .field.inline input, .filters .field.inline select { width: 100%; }
.filters .btn { width: 100%; justify-content: center; }
.filters-games { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.filters-games .f-search { grid-column: span 2; }
@media (max-width: 560px) { .filters-games .f-search { grid-column: auto; } }
@media (min-width: 1000px) { .filters-games { grid-template-columns: 2fr 1fr 1fr 1fr auto; } .filters-games .f-search { grid-column: auto; } .filters-games .btn { width: auto; padding-inline: 1.6rem; } }
.filters .seg { min-width: 14rem; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); margin-bottom: .4rem; }
.k { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; margin-left: .6rem; }
.k1, .b1 { fill: var(--accent); background: var(--accent); } .k2, .b2 { fill: #ffffff; background: #ffffff; } .k3, .b3 { fill: #828282; background: #828282; }
html[data-theme="light"] .k2, html[data-theme="light"] .b2 { fill: #202020; background: #202020; }
.chart-wrap { overflow-x: auto; padding-bottom: .4rem; } .chart { display: block; max-width: none; }
.axis { stroke: var(--line); stroke-width: 1; } .tick { fill: var(--muted); font-size: 10px; font-family: inherit; }
.bar { transition: opacity .2s; } .bar:hover { opacity: .75; }
.table-wrap { overflow-x: auto; margin-top: 1rem; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; white-space: nowrap; }
.table th, .table td { padding: .5rem .7rem; text-align: right; border-bottom: 1px solid var(--line); }
.table th:first-child, .table thead th { text-align: left; } .table thead th { color: var(--muted); font-weight: 500; }
.table tbody th { font-weight: 500; }
.hbars { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.hbars li { display: grid; grid-template-columns: 6.5rem 1fr 2rem; align-items: center; gap: .6rem; font-size: .9rem; }
.hbars div { height: .7rem; border-radius: 99px; background: var(--field); overflow: hidden; } .hbars i { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.hbars b { text-align: right; font-weight: 500; }
.report { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: .8rem; border-radius: .9rem; flex-wrap: wrap; }
.report + .report { margin-top: .4rem; } .report.pending { background: var(--accent-soft); } .report small { display: block; }
.report p { margin: .3rem 0 0; } .report a { color: var(--accent-ink); }

/* ---------- Auth ---------- */
.auth-body { display: grid; place-items: center; }
.auth { width: 100%; padding: 1.5rem 1rem; display: grid; place-items: center; min-height: 100dvh; }
.auth-card { width: min(100%, 26rem); display: grid; gap: .9rem; background: var(--card); padding: 2rem 1.5rem; border-radius: 1.6rem; box-shadow: 0 0 0 1px var(--line), 0 1.5rem 3rem rgb(0 0 0 / .35); }
.auth-sub { text-align: center; color: var(--muted); margin-bottom: .4rem; }
.auth-alt { text-align: center; color: var(--muted); margin: 0; } .auth-alt a { color: var(--accent-ink); font-weight: 600; }

/* ---------- Responsive ---------- */
@media (min-width: 800px) {
  .messenger { grid-template-columns: 20rem 1fr; align-items: start; }
  .messenger.in-chat .conv-list, .messenger:not(.in-chat) .chat { display: block; }
  .messenger:not(.in-chat) .chat { display: flex; }
  .only-mobile { display: none; }
  .page:has(.messenger.in-chat) .chat { height: calc(100dvh - 13.5rem); }
  .page:has(.messenger.in-chat) .page-title { display: block; }
  .page:has(.messenger.in-chat) .chat { height: calc(100dvh - 16.5rem); }
}
@media (max-width: 480px) { .hbars li { grid-template-columns: 5rem 1fr 1.8rem; } .stats { gap: 1.4rem; } .wordmark { font-size: 1.8rem; } }

/* ---------- Transiciones entre páginas ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: fade-out .16s ease both; }
::view-transition-new(root) { animation: fade-in .26s var(--ease) both; }
@keyframes fade-out { to { opacity: 0; } } @keyframes fade-in { from { opacity: 0; transform: translateY(.4rem); } }
.carousel, .msgs { overscroll-behavior: contain; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}

/* ---------- Bootstrap Tooltip (JS de Bootstrap, estilo propio) ---------- */
.tooltip { position: absolute; z-index: 1080; display: block; margin: 0; font-size: .8rem; opacity: 0; pointer-events: none; }
.tooltip.show { opacity: 1; transition: opacity .15s; }
.tooltip-inner { background: var(--raised); color: var(--text); padding: .25rem .6rem; border-radius: .5rem; box-shadow: 0 .3rem 1rem rgb(0 0 0 / .3); }
.tooltip .tooltip-arrow { display: none; }
.bs-tooltip-top { padding-bottom: .4rem; }

/* ---------- Rankings (home / dashboard) ---------- */
.rank { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; counter-reset: r; }
.rank li { display: flex; align-items: center; gap: .6rem; padding: .45rem .2rem; border-bottom: 1px solid var(--line); counter-increment: r; }
.rank li:last-child { border-bottom: 0; }
.rank li::before { content: counter(r); min-width: 1.4rem; height: 1.4rem; display: inline-grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); font-size: .8rem; font-weight: 600; }
.rank a { flex: 1; min-width: 0; font-weight: 500; }
.rank small { color: var(--muted); white-space: nowrap; }

/* ---------- Juegos (API externa) ---------- */
.game { padding: 0; overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: transform .2s var(--ease), box-shadow .2s; }
.game:hover { transform: translateY(-3px); box-shadow: 0 .6rem 1.4rem rgb(0 0 0 / .25); }
.game img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--deep); }
.game-body { padding: .8rem; display: grid; gap: .4rem; flex: 1; align-content: start; }
.game-body h3 { margin: 0; font-size: 1.05rem; font-weight: 600; }
.game-body p { margin: 0; font-size: .85rem; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.game-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: .4rem; }
.api-credit { font-size: .8rem; color: var(--muted); text-align: center; }
.api-credit a { text-decoration: underline; }
.chart-box { position: relative; height: 260px; }
.chart-box.sm { height: 230px; }

/* ---------- Responsivo automático ---------- */
.game-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.game-grid > .game { height: 100%; }
.game-body h3 { overflow-wrap: break-word; }
.game .chips { gap: .35rem; }
.card, .page > * { min-width: 0; }
.page { padding-inline: max(.9rem, env(safe-area-inset-left, 0px)); }
@media (max-width: 380px) { html { font-size: 16px; } .page { padding-inline: .7rem; } .tabbar { width: calc(100% - .8rem); } }
@media (min-width: 1100px) { .page { gap: 1.1rem; } .game-grid { gap: 1.2rem; } }
@media (hover: none) { .game:hover { transform: none; } }
@media (min-width: 700px) and (max-height: 520px) { .page { padding-bottom: 6rem; } }
