/* PIXR GTA - console shell (single stage theme) */

.console-shell {
  --c-bg: #070a12;
  --c-text: #f5f7fb;
  --c-muted: #9aa6bd;
  --c-accent: #ffffff;
  --c-glow: 90, 150, 255;
  --c-game: #66a0ff;
  --c-hint-bg: rgba(4, 8, 16, 0.55);
  --c-font-display: "Bebas Neue", Impact, sans-serif;
  --c-font-body: "DM Sans", system-ui, sans-serif;

  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--c-text);
  font-family: var(--c-font-body);
  background: var(--c-bg);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px) scale(0.985);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.4s;
}
.console-shell.is-on {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}
body.console-open {
  overflow: hidden;
  cursor: none;
}
body.console-open * {
  cursor: none !important;
}
body.console-open .topbar,
body.console-open .wrap,
body.console-open .noise,
body.console-open .atmosphere {
  visibility: hidden;
  pointer-events: none;
}
body.console-open .modal { z-index: 100; }
body.console-open .toast { z-index: 110; }

/* Gamepad focus ring inside Settings while console mode is on */
body.console-open .modal .pad-focus,
body.console-open .modal .tab.pad-focus,
body.console-open .modal select.pad-focus,
body.console-open .modal .btn.pad-focus {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 4px rgba(102, 160, 255, 0.35);
}

.console-bg {
  position: absolute;
  inset: -8%;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center 35%;
  filter: blur(52px) saturate(1.35) brightness(0.42);
  transform: scale(1.2);
  z-index: 0;
  transition: background-image 0.45s ease, filter 0.45s ease;
}
.console-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 50% 20%, rgba(var(--c-glow), 0.28), transparent 60%),
    radial-gradient(ellipse 50% 40% at 15% 80%, rgba(var(--c-glow), 0.12), transparent 55%),
    radial-gradient(ellipse 45% 35% at 85% 75%, rgba(255, 255, 255, 0.05), transparent 50%);
  animation: consoleAmbient 10s ease-in-out infinite alternate;
}
.console-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 10, 18, 0.25) 0%, rgba(7, 10, 18, 0.55) 45%, rgba(7, 10, 18, 0.92) 100%),
    radial-gradient(ellipse 80% 70% at 50% 40%, transparent 30%, rgba(0, 0, 0, 0.55) 100%);
}
@keyframes consoleAmbient {
  from { opacity: 0.85; transform: scale(1); }
  to { opacity: 1; transform: scale(1.04); }
}

.console-hero { display: none; }

.console-shell > *:not(.console-bg):not(.console-hero) {
  position: relative;
  z-index: 1;
}

.console-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem clamp(1.2rem, 4vw, 2.75rem);
}
.console-brand {
  font-family: var(--c-font-display);
  font-size: 1.75rem;
  letter-spacing: 0.12em;
}
.console-brand span {
  color: var(--c-game);
  text-shadow: 0 0 24px color-mix(in srgb, var(--c-game) 50%, transparent);
}
.console-theme-pill { display: none !important; }
.console-desktop-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  color: var(--c-text);
  font: inherit;
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.62rem 1rem;
  border-radius: 999px;
  transition: border-color 0.2s, background 0.2s;
}
.console-desktop-btn:hover {
  border-color: rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.12);
}

.console-main {
  display: grid;
  gap: clamp(1.25rem, 3vh, 2.25rem);
  min-height: 0;
  padding: 0 clamp(1.2rem, 4vw, 2.75rem);
  align-content: center;
  justify-items: center;
  height: 100%;
}

.console-rail-wrap {
  width: 100%;
  overflow: visible;
  padding: 1.25rem 0 0.5rem;
}
.console-rail {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(1rem, 2.5vw, 2rem);
  padding: 1.75rem 0 1rem;
}
.console-card {
  flex: 0 0 min(30vw, 260px);
  position: relative;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 26px;
  background: rgba(12, 16, 28, 0.55);
  backdrop-filter: blur(20px);
  overflow: hidden;
  color: inherit;
  text-align: left;
  padding: 0;
  transform: scale(0.86) translateY(18px);
  opacity: 0.5;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  transition:
    transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.35s ease,
    border-color 0.25s,
    box-shadow 0.4s;
}
.console-shell.is-on .console-card {
  animation: consoleCardIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.console-shell.is-on .console-card:nth-child(1) { animation-delay: 0.05s; }
.console-shell.is-on .console-card:nth-child(2) { animation-delay: 0.12s; }
.console-shell.is-on .console-card:nth-child(3) { animation-delay: 0.19s; }
@keyframes consoleCardIn {
  from { opacity: 0; transform: scale(0.8) translateY(28px); }
  to { opacity: 0.5; transform: scale(0.86) translateY(18px); }
}
.console-shell.is-on .console-card.is-focus {
  animation: none;
}
.console-card.is-focus {
  transform: scale(1.12) translateY(0);
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 3px color-mix(in srgb, var(--c-game) 45%, transparent),
    0 28px 70px rgba(0, 0, 0, 0.5),
    0 0 70px color-mix(in srgb, var(--c-game) 28%, transparent);
  z-index: 2;
}
.console-card::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -18%;
  height: 28%;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--c-game) 35%, transparent), transparent 70%);
  opacity: 0;
  filter: blur(8px);
  transition: opacity 0.35s;
  pointer-events: none;
}
.console-card.is-focus::after { opacity: 0.85; }
.console-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  object-position: center;
  background: #000;
}
.console-card-label {
  text-align: center;
  padding: 0.7rem 0.8rem 0.95rem;
  font-family: var(--c-font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  letter-spacing: 0.05em;
  line-height: 1;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.35));
}

.console-detail {
  text-align: center;
  max-width: 32rem;
}
.console-detail.is-swap {
  animation: consoleDetailSwap 0.32s ease both;
}
@keyframes consoleDetailSwap {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.console-meta {
  margin: 0 0 0.35rem;
  color: var(--c-muted);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.console-title {
  margin: 0;
  font-family: var(--c-font-display);
  font-size: clamp(2.8rem, 7.5vw, 5rem);
  letter-spacing: 0.04em;
  line-height: 0.92;
  color: #fff;
  text-shadow: 0 0 42px color-mix(in srgb, var(--c-game) 40%, transparent);
}
.console-status {
  margin: 0.8rem 0 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--c-muted);
}
.console-status .dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--c-muted);
}
.console-status .dot.ok { background: #6fcf97; box-shadow: 0 0 10px rgba(111, 207, 151, 0.5); }
.console-status .dot.warn { background: #f2c94c; }
.console-status .dot.err { background: #e85d4c; }
.console-status .dot.soon { background: #7a8499; }
.console-play {
  margin-top: 1.15rem;
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.6rem;
  font: inherit;
  font-weight: 800;
  font-size: 1.02rem;
  background: #fff;
  color: #101522;
  box-shadow:
    0 12px 36px rgba(0, 0, 0, 0.35),
    0 0 28px color-mix(in srgb, var(--c-game) 30%, transparent);
  transition: transform 0.15s, filter 0.2s;
}
.console-play:hover { filter: brightness(1.05); }
.console-play:active { transform: translateY(1px); }
.console-play:disabled { opacity: 0.4; }

.console-hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.15rem;
  justify-content: center;
  padding: 0.85rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, transparent, var(--c-hint-bg));
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--c-muted);
}
.console-hint { display: inline-flex; align-items: center; gap: 0.35rem; }
.console-key {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
}

@media (max-width: 860px) {
  .console-rail { gap: 0.75rem; }
  .console-card { flex-basis: min(42vw, 170px); }
  .console-card.is-focus { transform: scale(1.06) translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .console-shell,
  .console-card,
  .console-detail,
  .console-bg::before {
    transition: none !important;
    animation: none !important;
  }
}
