/* =============================================================================
   MoonOrbit Arcade — tema espacial. Unidades = px del lienzo 1920×1080.
   Tipografía: 35 título / 25 meta / 20 cuerpo. Sin vw/vh en chrome.
   ============================================================================= */

:root {
  --bg-deep: #05060f;
  --bg-panel: rgba(12, 14, 28, 0.78);
  --bg-elevated: rgba(18, 22, 44, 0.92);
  --line: rgba(123, 92, 255, 0.28);
  --line-strong: rgba(0, 240, 255, 0.45);
  --text: #e8ecff;
  --text-muted: #8b93b8;
  --cyan: #00f0ff;
  --magenta: #ff2bd6;
  --violet: #7b5cff;
  --gold: #ffd166;
  --danger: #ff4d6d;
  --ok: #3dffb0;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --font-display: "Orbitron", "Segoe UI", sans-serif;
  --font-body: "Exo 2", "Segoe UI", sans-serif;
  --type-title: 35px;
  --type-meta: 25px;
  --type-body: 20px;
}

/* El atributo hidden debe ganar siempre sobre cualquier display de clase */
[hidden] {
  display: none !important;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg-deep);
}

body {
  font-family: var(--font-body);
  color: var(--text);
  font-size: var(--type-body);
  line-height: 1.45;
}

.game-stage-body {
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(123, 92, 255, 0.22), transparent 55%),
    radial-gradient(900px 420px at 90% 0%, rgba(255, 43, 214, 0.14), transparent 50%),
    radial-gradient(700px 400px at 50% 110%, rgba(0, 240, 255, 0.1), transparent 50%),
    var(--bg-deep);
  scrollbar-width: thin;
  scrollbar-color: var(--cyan) var(--bg-deep);
}

.game-stage-body::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

.game-stage-body::-webkit-scrollbar-track {
  background: var(--bg-deep);
  border-left: 1px solid var(--line);
}

.game-stage-body::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--cyan), var(--violet));
  border-radius: 999px;
  border: 2px solid var(--bg-deep);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.35);
}

.game-stage-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #7af7ff, var(--magenta));
}

.game-stage-body::-webkit-scrollbar-corner {
  background: var(--bg-deep);
}

.game-stage-body::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 28% 72%, rgba(0, 240, 255, 0.8) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 63% 24%, rgba(255, 255, 255, 0.55) 50%, transparent 51%),
    radial-gradient(1px 1px at 81% 61%, rgba(255, 43, 214, 0.7) 50%, transparent 51%),
    radial-gradient(1px 1px at 44% 48%, rgba(255, 255, 255, 0.45) 50%, transparent 51%),
    radial-gradient(1.6px 1.6px at 91% 12%, rgba(123, 92, 255, 0.9) 50%, transparent 51%);
  opacity: 0.7;
  z-index: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font-family: inherit;
  font-size: var(--type-body);
}

.app-chrome {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.site-header {
  height: var(--vu-hud-h, 100px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--vu-margin, 20px);
  padding: 0 40px;
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 15, 0.72);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand img {
  width: var(--vu-icon, 64px);
  height: var(--vu-icon, 64px);
  object-fit: cover;
  border-radius: 22%;
  filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.45));
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-copy strong {
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  font-size: var(--type-meta);
  text-transform: uppercase;
}

.brand-copy span {
  color: var(--text-muted);
  font-size: var(--type-body);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-chip {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(18, 22, 44, 0.7);
}

.profile-chip.is-visible {
  display: inline-flex;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--violet), var(--cyan));
  color: #05060f;
  font-weight: 700;
  font-size: var(--type-meta);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.profile-chip small {
  color: var(--text-muted);
  display: block;
  font-size: 20px;
}

.welcome {
  margin: 40px 80px 20px;
  padding: 36px 40px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(123, 92, 255, 0.14), transparent 42%),
    linear-gradient(90deg, rgba(0, 240, 255, 0.05), transparent 55%),
    rgba(8, 10, 24, 0.72);
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 240, 255, 0.08);
  position: relative;
  overflow: hidden;
}

.welcome::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -48px;
  top: -70px;
  border: 2px dashed rgba(0, 240, 255, 0.16);
  border-radius: 50%;
  pointer-events: none;
}

.kicker {
  color: var(--cyan);
  font-family: var(--font-display);
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: var(--type-body);
  margin: 0 0 12px;
}

.welcome h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-size: var(--type-title);
  line-height: 1.25;
  max-width: 28ch;
}

.welcome h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--magenta));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.welcome p {
  margin: 0;
  max-width: 68ch;
  color: var(--text-muted);
  font-size: var(--type-body);
}

.section {
  margin: 0 80px 40px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 28px 0 18px;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: var(--type-meta);
}

.section-head p {
  margin: 0;
  color: var(--text-muted);
  font-size: var(--type-body);
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.site-footer {
  margin-top: auto;
  padding: 22px 80px 28px;
  color: var(--text-muted);
  font-size: var(--type-body);
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.account-loading {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  background: rgba(5, 6, 15, 0.72);
  font-size: var(--type-meta);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.game-shell[data-layout="mobile"] .site-header {
  height: auto;
  min-height: 72px;
  flex-wrap: wrap;
  row-gap: 8px;
  column-gap: 12px;
  padding: 12px 16px;
}

.game-shell[data-layout="mobile"] .brand-copy strong {
  font-size: 16px;
  white-space: nowrap;
}

.game-shell[data-layout="mobile"] .header-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.game-shell[data-layout="mobile"] .header-actions .btn {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 16px;
  white-space: nowrap;
}

.game-shell[data-layout="mobile"] .brand img {
  width: 40px;
  height: 40px;
}

.game-shell[data-layout="mobile"] .brand-copy span,
.game-shell[data-layout="mobile"] .profile-meta {
  display: none;
}

.game-shell[data-layout="mobile"] .welcome,
.game-shell[data-layout="mobile"] .section {
  margin: 12px;
  padding: 16px;
}

.game-shell[data-layout="mobile"] .welcome {
  flex-shrink: 0;
  min-height: min-content;
  padding: 18px 16px 16px;
}

.game-shell[data-layout="mobile"] .welcome .kicker {
  letter-spacing: 0.12em;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.game-shell[data-layout="mobile"] .welcome > p:not(.kicker) {
  display: none;
}

.game-shell[data-layout="mobile"] .welcome h1 {
  margin-bottom: 0;
  font-size: 26px;
  line-height: 1.3;
}

.game-shell[data-layout="mobile"] .section-head p {
  font-size: 15px;
}

.game-shell[data-layout="mobile"] .game-grid {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.game-shell[data-layout="mobile"] .game-grid .game-card {
  height: 100%;
  min-height: 0;
  padding: 0 8px 10px;
  gap: 8px;
}

.game-shell[data-layout="mobile"] .game-grid .card-media {
  margin: 0 -8px 8px;
}

.game-shell[data-layout="mobile"] .game-grid .card-top,
.game-shell[data-layout="mobile"] .game-grid .game-card > p {
  display: none;
}

.game-shell[data-layout="mobile"] .game-grid .game-card h3 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.game-shell[data-layout="mobile"] .game-grid .game-card .btn {
  margin-top: auto;
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  font-size: 14px;
}

.game-shell[data-layout="mobile"] .site-footer {
  padding: 16px;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.game-shell[data-layout="mobile"][data-orient="landscape"] .welcome,
.game-shell[data-layout="mobile"][data-orient="landscape"] .section {
  margin: 8px 12px;
  padding: 12px;
}

.game-shell[data-layout="mobile"][data-orient="landscape"] .welcome {
  padding: 14px 16px;
}

.game-shell[data-layout="mobile"][data-orient="landscape"] .game-grid {
  grid-template-columns: 1fr 1fr;
}

.game-shell[data-layout="mobile"][data-orient="landscape"] .site-footer {
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
}
