@import url('https://fonts.googleapis.com/css2?family=Archivo+Black&family=DM+Mono:wght@400;500&display=swap');

:root {
  --ink: #070713;
  --ink-2: #0c0b22;
  --panel: rgba(18, 5, 29, 0.9);
  --panel-solid: #0b0a1f;
  --pink: #42ddff;
  --hot-pink: #25cfff;
  --baby-pink: #ddd2ff;
  --lavender: #9b5cff;
  --baby-blue: #76e8ff;
  --white: #fff9fd;
  --muted: #d8c8dc;
  --danger: #ae62ff;
  --border: rgba(66, 221, 255, 0.55);
  --shadow: 0 0 24px rgba(155, 92, 255, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top, #271236 0, #070713 45%),
    var(--ink);
  color: var(--white);
  font-family: "DM Mono", monospace;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
}

.game-shell {
  min-height: 100vh;
}

.scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  isolation: isolate;
}

.scene__background,
.scene__overlay,
.scene__scanlines {
  position: absolute;
  inset: 0;
}

.scene__background {
  z-index: -4;
  background:
    linear-gradient(135deg, rgba(66, 221, 255, 0.16), rgba(118, 232, 255, 0.08)),
    radial-gradient(circle at 80% 20%, rgba(155, 92, 255, 0.22), transparent 35%),
    #0b0a1f;
  background-size: cover;
  background-position: center;
  transition: background-image 350ms ease, filter 350ms ease;
}

.scene__overlay {
  z-index: -3;
  background:
    linear-gradient(to bottom, rgba(0, 0, 0, 0.05), rgba(7, 7, 19, 0.4)),
    radial-gradient(circle at center, transparent 50%, rgba(0, 0, 0, 0.45) 100%);
}

.scene__scanlines {
  z-index: 10;
  pointer-events: none;
  opacity: 0.12;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.08) 0px,
    rgba(255,255,255,0.08) 1px,
    transparent 2px,
    transparent 4px
  );
  mix-blend-mode: soft-light;
}

.topbar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 7, 19, 0.82);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  text-decoration: none;
}

.brand__eyebrow,
.eyebrow {
  color: var(--baby-pink);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.brand__title {
  font-family: "Archivo Black", sans-serif;
  letter-spacing: 0.04em;
  color: var(--pink);
  text-shadow: 0 0 14px rgba(66, 221, 255, 0.45);
}

.status {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--muted);
  font-size: 0.75rem;
}

.status__dot {
  color: var(--pink);
  animation: pulse 1.2s infinite;
}

.icon-button {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  border-radius: 999px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}

.stage {
  position: relative;
  min-height: 58vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 2rem 1rem 1rem;
}

.character-layer {
  width: min(680px, 92vw);
  min-height: 50vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.character-sprite {
  max-height: 54vh;
  max-width: 72vw;
  object-fit: contain;
  filter: drop-shadow(0 15px 28px rgba(0, 0, 0, 0.42));
  animation: idleFloat 2.8s ease-in-out infinite;
}

.character-sprite.enter {
  animation: spriteEnter 300ms ease-out, idleFloat 2.8s 300ms ease-in-out infinite;
}

.character-sprite.shake {
  animation: shake 250ms linear 1;
}

.character-sprite.glitch {
  animation: glitchSprite 280ms steps(2, end) 2;
}

.objective-card {
  position: absolute;
  left: 1rem;
  top: 1rem;
  width: min(310px, calc(100vw - 2rem));
  padding: 0.85rem 1rem;
  border: 1px solid rgba(118, 232, 255, 0.55);
  background: rgba(7, 11, 22, 0.72);
  box-shadow: 0 0 18px rgba(118, 232, 255, 0.1);
  backdrop-filter: blur(10px);
}

.objective-card__label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  color: var(--baby-blue);
}

.glitch-message {
  position: absolute;
  inset: 35% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  font-family: "Archivo Black", sans-serif;
  font-size: clamp(1.3rem, 5vw, 3.5rem);
  color: var(--white);
  text-align: center;
  text-shadow:
    -3px 0 var(--baby-blue),
    3px 0 var(--pink);
  animation: glitchText 120ms steps(2, end) infinite;
}

.dialogue-panel {
  position: relative;
  z-index: 20;
  width: min(940px, calc(100% - 2rem));
  margin: 0 auto 1.25rem;
  padding: 1rem;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.dialogue-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.7rem;
}

.speaker-name {
  font-family: "Archivo Black", sans-serif;
  color: var(--pink);
  text-transform: uppercase;
}

.scene-counter {
  color: var(--muted);
  font-size: 0.72rem;
}

.dialogue-text {
  min-height: 3.6em;
  margin: 0;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  line-height: 1.65;
}

.choices {
  display: grid;
  gap: 0.65rem;
  margin-top: 1rem;
}

.choice-button,
.primary-button,
.secondary-button {
  border: 1px solid var(--border);
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 150ms ease,
    border-color 150ms ease,
    background 150ms ease;
}

.choice-button {
  width: 100%;
  padding: 0.85rem 1rem;
  text-align: left;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(155, 92, 255, 0.16), rgba(155, 92, 255, 0.08)),
    rgba(255,255,255,0.025);
}

.choice-button:hover,
.choice-button:focus-visible,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
  border-color: var(--baby-pink);
}

.choice-button::before {
  content: ">";
  margin-right: 0.6rem;
  color: var(--pink);
}

.fragment-screen,
.festival-screen {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(3, 0, 8, 0.92);
  backdrop-filter: blur(14px);
}

.fragment-screen[hidden],
.festival-screen[hidden] {
  display: none;
}

.fragment-screen__inner {
  width: min(540px, 100%);
  padding: 2rem;
  text-align: center;
  border: 1px solid var(--border);
  background:
    radial-gradient(circle at center, rgba(155, 92, 255, 0.16), transparent 48%),
    var(--panel-solid);
  box-shadow: 0 0 60px rgba(155, 92, 255, 0.24);
}

.fragment-icon {
  font-size: 5rem;
  color: var(--pink);
  text-shadow: 0 0 30px rgba(155, 92, 255, 0.8);
  animation: pulse 1.1s infinite;
}

.fragment-screen h2,
.festival-card h1 {
  margin: 0.25rem 0;
  font-family: "Archivo Black", sans-serif;
  color: var(--pink);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1rem;
}

.primary-button {
  background: var(--pink);
  color: #0b0a1f;
  border-color: var(--pink);
  font-weight: 700;
}

.secondary-button {
  background: transparent;
  color: var(--white);
}

.festival-card {
  display: grid;
  grid-template-columns: 1fr 0.9fr;
  gap: 1.25rem;
  width: min(1040px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  background: var(--panel-solid);
  box-shadow: 0 0 60px rgba(155, 92, 255, 0.22);
}

.festival-card__copy {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.festival-card__poster img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 76vh;
  object-fit: contain;
  background: rgba(255,255,255,0.03);
}

.festival-actions {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.4rem;
}

body.corrupted .scene__background {
  filter: saturate(1.35) contrast(1.08) hue-rotate(8deg);
}

body.corrupted .dialogue-panel {
  box-shadow:
    -8px 0 0 rgba(118, 232, 255, 0.08),
    8px 0 0 rgba(155, 92, 255, 0.08);
}

@keyframes idleFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes spriteEnter {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(8px); }
  75% { transform: translateX(-5px); }
}

@keyframes glitchSprite {
  0% { transform: translate(0,0); filter: none; }
  25% { transform: translate(-5px,2px); filter: hue-rotate(45deg); }
  50% { transform: translate(5px,-2px); filter: contrast(1.6); }
  75% { transform: translate(-2px,-3px); filter: hue-rotate(-45deg); }
  100% { transform: translate(0,0); filter: none; }
}

@keyframes glitchText {
  0% { transform: translate(-50%, -50%) translate(0,0); }
  33% { transform: translate(-50%, -50%) translate(-3px,1px); }
  66% { transform: translate(-50%, -50%) translate(3px,-1px); }
  100% { transform: translate(-50%, -50%) translate(0,0); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
  }

  .status {
    flex-direction: column;
    align-items: flex-end;
  }

  .stage {
    min-height: 50vh;
    padding-top: 5.4rem;
  }

  .character-sprite {
    max-height: 43vh;
    max-width: 88vw;
  }

  .festival-card {
    grid-template-columns: 1fr;
  }

  .festival-card__poster {
    order: -1;
  }

  .festival-card__poster img {
    max-height: 46vh;
  }
}

/* ===== PRINCESS RED: NEON BLUE + ELECTRIC PURPLE REFRESH ===== */
.scene__background {
  background:
    linear-gradient(135deg, rgba(66, 221, 255, 0.17), rgba(155, 92, 255, 0.12)),
    radial-gradient(circle at 82% 18%, rgba(155, 92, 255, 0.24), transparent 35%),
    radial-gradient(circle at 18% 78%, rgba(66, 221, 255, 0.12), transparent 30%),
    #0b0a1f;
}

.choice-button {
  background:
    linear-gradient(90deg, rgba(66, 221, 255, 0.15), rgba(155, 92, 255, 0.10)),
    rgba(255,255,255,0.025);
}

.choice-button::before {
  color: #42ddff;
}

.speaker-name,
.brand__title {
  color: #42ddff;
  text-shadow: 0 0 14px rgba(66,221,255,.38);
}

.glitch-message {
  text-shadow:
    -3px 0 #42ddff,
    3px 0 #9b5cff;
}

.objective-card {
  border-color: rgba(66,221,255,.55);
  background: rgba(6,8,24,.76);
  box-shadow: 0 0 18px rgba(66,221,255,.12);
}