@import "tailwindcss";

:root {
  --bg-deep: #07060a;
  --bg-panel: #12100e;
  --bg-elevated: #1c1814;
  --fg: #f3ebe0;
  --fg-muted: #9a8f82;
  --accent: #f0a030;
  --accent-hot: #ff6b4a;
  --amber: #f0a030;
  --crt-green: #8cffb0;
  --line: rgba(243, 235, 224, 0.1);
  --scanline: rgba(0, 0, 0, 0.28);
  --glow: rgba(240, 160, 48, 0.28);
}

@theme inline {
  --color-background: var(--bg-deep);
  --color-foreground: var(--fg);
  --color-panel: var(--bg-panel);
  --color-elevated: var(--bg-elevated);
  --color-muted: var(--fg-muted);
  --color-accent: var(--accent);
  --color-accent-hot: var(--accent-hot);
  --color-amber: var(--amber);
  --color-crt: var(--crt-green);
  --color-line: var(--line);
  --font-sans: var(--font-body);
  --font-display: var(--font-display);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg-deep);
  color: var(--fg);
  font-family: var(--font-body), system-ui, sans-serif;
  min-height: 100%;
}

body::before {
  content: "";
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      var(--scanline) 3px,
      var(--scanline) 4px
    ),
    radial-gradient(ellipse at 15% 10%, rgba(240, 160, 48, 0.07), transparent 45%),
    radial-gradient(ellipse at 85% 90%, rgba(140, 255, 176, 0.04), transparent 40%);
  opacity: 0.35;
}

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

::selection {
  background: var(--accent);
  color: #1a1008;
}

.font-display {
  font-family: var(--font-display), sans-serif;
}

.text-amber {
  color: var(--amber);
}

.hc-hero {
  background:
    radial-gradient(ellipse 80% 60% at 70% 20%, rgba(240, 160, 48, 0.14), transparent 55%),
    linear-gradient(165deg, #1a120c 0%, #07060a 55%, #0c1010 100%);
}

.hc-hero-glow {
  position: absolute;
  inset: -10% 20% auto auto;
  width: min(60vw, 520px);
  height: min(60vw, 520px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(240, 160, 48, 0.2), transparent 70%);
  filter: blur(8px);
  animation: hc-pulse 6s ease-in-out infinite;
}

.hc-hero-scan {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.12) 2px,
    rgba(0, 0, 0, 0.12) 3px
  );
  opacity: 0.4;
  pointer-events: none;
}

.hc-eyebrow {
  opacity: 0.85;
}

.hc-library {
  border-top: 1px solid var(--line);
}

.noise-bg {
  background-color: var(--bg-deep);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.9rem 1.5rem;
  background: linear-gradient(180deg, #ffc060, var(--accent));
  color: #1a1008;
  font-family: var(--font-display), sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 28px var(--glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 36px var(--glow);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1.1rem;
  border: 1px solid var(--line);
  color: var(--fg);
  font-family: var(--font-display), sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--amber);
  background: rgba(240, 160, 48, 0.06);
}

.system-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  font-family: var(--font-display), sans-serif;
  font-size: 0.55rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--fg-muted);
  transition: all 0.15s ease;
}

.system-chip:hover,
.system-chip[data-active="true"] {
  color: var(--fg);
  border-color: var(--accent);
  background: rgba(240, 160, 48, 0.1);
}

.game-tile {
  position: relative;
  display: block;
  overflow: hidden;
  background: transparent;
  border: none;
  transition: transform 0.25s ease;
}

.game-tile:hover {
  transform: translateY(-4px);
}

.game-tile img,
.game-tile .cover-fallback {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: linear-gradient(145deg, #2a2218, #0f0d0b);
  border: 1px solid var(--line);
}

.game-tile:hover img,
.game-tile:hover .cover-fallback {
  border-color: rgba(240, 160, 48, 0.45);
}

.cover-fallback {
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  font-family: var(--font-display), sans-serif;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--fg);
}

.settings-panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(28, 24, 20, 0.9), rgba(12, 10, 8, 0.95));
  padding: 1.35rem 1.25rem;
}

.settings-heading {
  font-family: var(--font-display), sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-label {
  display: block;
  font-family: var(--font-display), sans-serif;
  font-size: 0.5rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-muted);
  margin-bottom: 0.35rem;
}

.settings-input {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--bg-elevated);
  padding: 0.65rem 0.75rem;
  color: var(--fg);
  font-size: 0.9rem;
  outline: none;
}

.settings-input:focus {
  border-color: var(--accent);
}

.avatar-swatch {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: 2px solid transparent;
  cursor: pointer;
}

.avatar-swatch-on {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--accent);
}

.ui-skin-card {
  border: 1px solid var(--line);
  background: var(--bg-panel);
  overflow: hidden;
}

.ui-skin-card:hover {
  border-color: rgba(240, 160, 48, 0.4);
}

.ui-skin-card-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.ui-skin-preview {
  height: 7rem;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0.85rem 1rem;
  font-family: var(--font-display), sans-serif;
  font-size: 1.4rem;
  letter-spacing: 0.08em;
}

.cabinet-home {
  background: #000;
}

.cabinet-home-stage {
  inset: 0;
}

.cabinet-home-stage > * {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

/* Console shells fill the viewport when used as home */
.cabinet-home-stage .xmb-shell,
.cabinet-home-stage .cart-shell,
.cabinet-home-stage .hh-shell,
.cabinet-home-stage .arcade-shell,
.cabinet-home-stage .psp-device,
.cabinet-home-stage .console-boot {
  min-height: 100% !important;
  height: 100% !important;
  max-height: none;
}

.cabinet-home-dock {
  position: absolute;
  z-index: 60;
  left: 50%;
  bottom: 0.85rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.65rem 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  pointer-events: auto;
}

.cabinet-home-dock-brand {
  margin: 0;
  font-family: var(--font-display), sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  white-space: nowrap;
}

/* Fullscreen cabinet / UI picker — hide site chrome */
html.cabinet-home-mode .browse-chrome,
html.ui-picker-mode .browse-chrome,
html.cabinet-home-mode .site-footer,
html.ui-picker-mode .site-footer {
  display: none !important;
}

/* Profile / settings themed shells hide the legal footer (shell has its own nav) */
.browse-shell.profile-skin-mode .site-footer,
.profile-skin-mode .site-footer {
  display: none !important;
}

/* Classic library keeps header + legal footer visible */

.hc-classic-full {
  background:
    radial-gradient(ellipse 70% 40% at 80% 0%, rgba(240, 160, 48, 0.08), transparent 50%),
    var(--bg-deep);
}

.hc-bottom-brand {
  background: linear-gradient(180deg, transparent, rgba(26, 18, 12, 0.85));
}

.ui-picker-full {
  min-height: 100dvh;
}

.ui-picker-stage {
  min-height: 0;
}

@keyframes power-pulse {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes hc-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.08);
    opacity: 1;
  }
}

@keyframes disc-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes crt-flicker {
  0%,
  100% {
    opacity: 0.08;
  }
  50% {
    opacity: 0.2;
  }
}

.boot-stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #050607;
  overflow: hidden;
}
