:root {
  --bg: #0c0c12;
  --panel: rgba(0, 0, 0, 0.65);
  --accent: #f6c344;
  --text: #e8e8ef;
  --muted: #9aa0b5;
  --success: #5bc17f;
  --danger: #e05b5b;
  --radius: 12px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --transition: 180ms ease;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

@font-face {
  font-family: 'Aller';
  src: url('../../assets/fonts/aller.woff2') format('woff2'),
       url('../../assets/fonts/aller.woff') format('woff'),
       url('../../assets/fonts/aller.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'Riffic';
  src: url('../../assets/fonts/riffic.woff2') format('woff2'),
       url('../../assets/fonts/riffic.woff') format('woff'),
       url('../../assets/fonts/riffic.ttf') format('truetype');
  font-weight: bold;
  font-style: normal;
}

@font-face {
  font-family: 'Dymon';
  src: url('../../assets/fonts/Dymon-ShouXieTi.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background: radial-gradient(circle at 20% 20%, #1a1a26, #07070d 55%);
  color: var(--text);
  min-height: 100vh;
}

.app {
  position: relative;
  overflow: hidden;
  min-height: 100vh;
  width: 100vw;
  height: 100vh;
}

/* Character layer */
.character-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.character {
  position: absolute;
  bottom: 0;
  width: 450px;
  height: 75vh;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: bottom center;
  transition: left 500ms ease, opacity 300ms ease, transform 300ms ease;
  transform-origin: bottom center;
  display: none;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
  transform: translateX(-50%);
}

.background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: #000;
  z-index: 1;
}

@keyframes fadeToBlack {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeFromBlack {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.fade-layer {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 999;
  transition: opacity 400ms ease-in-out;
}

.hidden {
  display: none !important;
}

.ui-layer {
  position: absolute;
  inset: 0;
  z-index: 10;
  padding: 0;
  pointer-events: none;
}

.ui-layer > * {
  pointer-events: auto;
}

/* Start screen */
.start-screen {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
}

.start-button {
  font-family: 'Dymon', sans-serif;
  font-size: 36px;
  padding: 30px 60px;
  background: #ffb3d9;
  color: #000;
  border: 4px solid #d67db8;
  border-radius: 0;
  font-weight: normal;
  cursor: pointer;
  transition: all 200ms ease;
  text-align: center;
  line-height: 1.5;
}

.start-button:hover {
  background: #ffc9e6;
  transform: scale(1.05);
}

/* DDLC-style dialogue box */
.dialogue-box {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 816px;
  max-width: 95vw;
  background-image: url('../../assets/images/textbox.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  padding: 44px 38px 20px 38px;
  min-height: 146px;
  border: none;
  box-shadow: none;
  border-radius: 0;
  z-index: 20;
}

.dialogue-box .speaker {
  position: absolute;
  top: -39px;
  left: 34px;
  width: 168px;
  height: 39px;
  background-image: url('../../assets/images/namebox.png');
  background-size: contain;
  background-repeat: no-repeat;
  font-family: 'Riffic', sans-serif;
  font-size: 24px;
  font-weight: bold;
  color: white;
  text-shadow: 
    -3px -3px 0 #ffbde1,
    3px -3px 0 #ffbde1,
    -3px 3px 0 #ffbde1,
    3px 3px 0 #ffbde1,
    -3px 0 0 #ffbde1,
    3px 0 0 #ffbde1,
    0 -3px 0 #ffbde1,
    0 3px 0 #ffbde1;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 1px;
  padding-top: 5px;
  margin: 0;
}

.dialogue-box .text {
  font-family: 'Dymon', sans-serif;
  font-size: 26px;
  color: white;
  line-height: 1.4;
  margin: 0;
  text-shadow: 
    -1px -1px 0 #000,
    1px -1px 0 #000,
    -1px 1px 0 #000,
    1px 1px 0 #000,
    -1.5px 0 0 #000,
    1.5px 0 0 #000,
    0 -1.5px 0 #000,
    0 1.5px 0 #000;
}

.choice-box,
.quiz-box,
.input-box {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 16px;
  z-index: 15;
  max-width: 600px;
  width: 90vw;
}

.choice-box .choice,
.quiz-choices .choice {
  display: block;
  width: 100%;
  text-align: center;
  margin: 12px 0;
  padding: 16px 20px;
  border-radius: 0;
  border: 3px solid #d67db8;
  background: #ffb3d9;
  color: #000;
  cursor: pointer;
  transition: color 200ms ease, background 200ms ease;
  font-family: 'Dymon', sans-serif;
  font-size: 30px;
  font-weight: normal;
  text-shadow: none;
}

.choice:hover,
.quiz-choices .choice:hover {
  color: #ff69b4;
  background: #ffb3d9;
}

.choice.correct,
.quiz-choices .choice.correct {
  border-color: var(--success);
  background: rgba(91, 193, 127, 0.12);
}

.choice.incorrect,
.quiz-choices .choice.incorrect {
  border-color: var(--danger);
  background: rgba(224, 91, 91, 0.14);
}

#play-audio {
  display: none !important;
}

.btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 14px;
  background: var(--accent);
  color: #1a1302;
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 8px 16px rgba(246, 195, 68, 0.24);
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* Input box styles */
.input-wrapper {
  background: rgba(0, 0, 0, 0.8);
  padding: 30px;
  border: 3px solid #d67db8;
  text-align: center;
}

.input-prompt {
  font-family: 'Dymon', sans-serif;
  font-size: 30px;
  color: white;
  margin-bottom: 20px;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  font-weight: normal;
}

.text-input {
  width: 100%;
  padding: 12px 16px;
  font-family: 'Dymon', sans-serif;
  font-size: 30px;
  border: 3px solid #d67db8;
  background: #ffb3d9;
  color: #000;
  text-align: center;
  margin-bottom: 15px;
  outline: none;
  font-weight: normal;
}

.text-input:focus {
  border-color: #ff69b4;
  background: #ffc9e6;
}

.submit-btn {
  font-family: 'Dymon', sans-serif;
  font-size: 30px;
  padding: 12px 30px;
  background: #ffb3d9;
  color: #000;
  border: 3px solid #d67db8;
  border-radius: 0;
  font-weight: normal;
  cursor: pointer;
  transition: background 200ms ease;
}

.submit-btn:hover {
  background: #ffc9e6;
  transform: none;
}

.quiz-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

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

  .dialogue-box .text {
    font-size: 1rem;
  }
}
