:root {
  --bg-night: #05020a;
  --bg-deep: #13081f;
  --panel: rgba(14, 8, 28, 0.9);
  --panel-strong: rgba(12, 8, 24, 0.97);
  --panel-border: #44f2ff;
  --panel-shadow: rgba(255, 78, 177, 0.18);
  --text-main: #f8ebff;
  --text-soft: #d8bff2;
  --neon-cyan: #44f2ff;
  --neon-pink: #ff4eb1;
  --neon-orange: #ffb06c;
  --neon-gold: #ffca72;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(255, 78, 177, 0.1), transparent 26%),
    linear-gradient(180deg, var(--bg-night), var(--bg-deep));
  color: var(--text-main);
  font-family: 'Chakra Petch', sans-serif;
}

body::before,
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.022) 0 2px,
    transparent 2px 5px
  );
  opacity: 0.16;
}

body::after {
  background:
    radial-gradient(circle at 50% 12%, rgba(255, 176, 108, 0.06), transparent 16%),
    radial-gradient(circle at 50% 88%, rgba(68, 242, 255, 0.05), transparent 24%);
}

.hub-page {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.hub-stage {
  position: relative;
  width: min(100vh, 100vw);
  height: min(100vh, 100vw);
}

.hub-game-root {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background: #05020a;
}

.hub-game-root canvas {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  image-rendering: pixelated;
}

.hub-ui-layer,
.dialog-overlay {
  position: absolute;
  inset: 0;
}

.hub-ui-layer {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  pointer-events: none;
}

.hud-row {
  display: flex;
  gap: 12px;
}

.hub-chip-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.top-row {
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: wrap;
}

.bottom-row {
  justify-content: center;
}

.pixel-chip,
.prompt-box,
.pixel-dialog,
.jukebox-panel {
  border: 3px solid var(--panel-border);
  background: var(--panel);
  box-shadow:
    0 0 0 3px rgba(8, 4, 16, 0.9),
    0 0 20px var(--panel-shadow);
}

.pixel-chip {
  padding: 10px 14px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
  background:
    linear-gradient(180deg, rgba(68, 242, 255, 0.08), rgba(8, 6, 18, 0.96)),
    var(--panel-strong);
}

.pixel-chip.accent {
  color: #ffe8f5;
  border-color: var(--neon-pink);
  box-shadow:
    0 0 0 3px rgba(8, 4, 16, 0.9),
    0 0 20px rgba(255, 78, 177, 0.24);
}

.radio-chip {
  color: #fff4d6;
  border-color: var(--neon-gold);
  box-shadow:
    0 0 0 3px rgba(8, 4, 16, 0.9),
    0 0 20px rgba(255, 176, 108, 0.2);
}

.hub-switch-chip {
  pointer-events: auto;
  text-decoration: none;
  color: #ffe8f5;
  border-color: var(--neon-pink);
  box-shadow:
    0 0 0 3px rgba(8, 4, 16, 0.9),
    0 0 20px rgba(255, 78, 177, 0.24);
}

.hub-switch-chip:hover,
.hub-switch-chip:focus-visible {
  outline: none;
  color: #fffafc;
  border-color: var(--neon-orange);
  transform: translateY(-1px);
}

.hub-floating-switch {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 18;
}

.prompt-box {
  width: min(760px, calc(100% - 32px));
  padding: 14px 16px 16px;
  pointer-events: auto;
  background:
    linear-gradient(180deg, rgba(255, 78, 177, 0.08), rgba(9, 6, 19, 0.98)),
    var(--panel-strong);
}

.prompt-title,
.dialog-header,
.jukebox-source {
  font-family: 'Silkscreen', monospace;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--neon-cyan);
}

.prompt-box p,
.pixel-dialog p,
.jukebox-track {
  margin: 10px 0 0;
  color: var(--text-soft);
  line-height: 1.5;
  font-size: 18px;
}

.jukebox-panel {
  position: absolute;
  left: 16px;
  bottom: 132px;
  z-index: 15;
  width: min(360px, calc(100% - 32px));
  padding: 14px 16px 16px;
  background:
    linear-gradient(180deg, rgba(255, 190, 110, 0.08), rgba(9, 6, 19, 0.98)),
    var(--panel-strong);
}

.jukebox-panel.hidden {
  display: none;
}

.jukebox-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.jukebox-source {
  margin-top: 6px;
  color: var(--neon-gold);
}

.jukebox-actions,
.dialog-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.icon-button,
.pixel-button {
  min-height: 44px;
  border: 3px solid rgba(68, 242, 255, 0.32);
  background: linear-gradient(180deg, rgba(18, 11, 33, 1), rgba(7, 4, 14, 1));
  color: var(--text-main);
  font-family: 'Silkscreen', monospace;
  font-size: 12px;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.03);
}

.icon-button {
  min-width: 44px;
  padding: 0 10px;
}

.pixel-button {
  flex: 1;
}

.pixel-button.primary {
  border-color: var(--neon-pink);
}

.icon-button:hover,
.icon-button:focus-visible,
.pixel-button:hover,
.pixel-button:focus-visible {
  outline: none;
  color: #fff5fb;
  border-color: var(--neon-orange);
  transform: translateY(-1px);
}

.dialog-overlay {
  display: grid;
  place-items: center;
  background: rgba(3, 2, 8, 0.76);
  z-index: 20;
}

.dialog-overlay.hidden {
  display: none;
}

.pixel-dialog {
  width: min(430px, calc(100% - 40px));
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(68, 242, 255, 0.08), rgba(10, 6, 20, 0.98)),
    var(--panel-strong);
}

.soundcloud-widget-frame {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: -9999px;
  top: -9999px;
  border: 0;
}

@media (max-width: 900px) {
  .top-row {
    justify-content: flex-start;
  }

  .hub-floating-switch {
    width: fit-content;
  }

  .pixel-chip {
    max-width: 100%;
  }
}

@media (max-width: 720px) {
  .hub-ui-layer {
    padding: 12px;
  }

  .hub-floating-switch {
    top: 12px;
    right: 12px;
  }

  .pixel-chip,
  .prompt-box,
  .jukebox-panel {
    width: 100%;
  }

  .jukebox-panel {
    left: 12px;
    right: 12px;
    bottom: 124px;
    width: auto;
  }

  .dialog-actions,
  .jukebox-actions {
    flex-direction: column;
  }
}
