/* ==========================================
   Start Screen Styles (Vertical Format)
   ========================================== */

.start-screen {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    rgba(47, 41, 41, 0.95) 0%,
    rgba(71, 113, 76, 0.9) 50%,
    rgba(47, 41, 41, 0.95) 100%
  );
  animation: fadeIn 0.5s ease-out;
}

.start-screen.hidden {
  display: none;
}

.start-screen__background {
  position: absolute;
  inset: 0;
  overflow: hidden;
  opacity: 0.3;
}

.start-screen__portal-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(1px);
}

.start-screen__content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem;
  animation: slideUp 0.8s ease-out 0.3s both;
}

.start-screen__logo {
  width: clamp(120px, 25vw, 200px);
  height: auto;
  margin-bottom: 1.5rem;
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.4));
  border-radius: 20px;
  animation: pulse 2s ease-in-out infinite;
}

.start-screen__title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  color: var(--color-accent-strong);
  margin: 0 0 0.5rem;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.start-screen__subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
  color: var(--color-text-on-dark);
  margin: 0 0 3rem;
  opacity: 0.9;
}

.start-screen__buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 320px;
  margin: 0 auto;
}

.start-screen__button {
  font-family: "Platypi", serif;
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.start-screen__button--primary {
  background: linear-gradient(135deg, var(--color-accent-strong), var(--color-accent));
  color: var(--color-bg-dark);
  box-shadow: 0 6px 20px rgba(167, 216, 60, 0.4);
}

.start-screen__button--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(167, 216, 60, 0.6);
}

.start-screen__button--primary:active {
  transform: translateY(0);
}

.start-screen__button--secondary {
  background: transparent;
  color: var(--color-text-on-dark);
  border: 2px solid var(--color-accent);
  box-shadow: 0 4px 12px rgba(113, 207, 175, 0.2);
}

.start-screen__button--secondary:hover {
  background: rgba(113, 207, 175, 0.1);
  border-color: var(--color-accent-strong);
  transform: translateY(-2px);
}

/* ==========================================
   Visual Novel Styles (Vertical Format)
   ========================================== */

.visual-novel {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  flex-direction: column;
  background: #000;
  animation: fadeIn 0.4s ease-out;
  overflow: hidden;
}

.visual-novel.hidden {
  display: none;
}

/* Background Layer - Full Screen */
.visual-novel__background {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.visual-novel__background-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Character Layer - 70% of screen (top) */
.visual-novel__characters {
  position: relative;
  z-index: 2;
  height: 70vh;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 5vw;
  pointer-events: none;
}

.visual-novel__character {
  position: absolute;
  bottom: 0;
  height: 100%;
  display: flex;
  align-items: flex-end;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.visual-novel__character.active {
  opacity: 1;
  transform: translateY(0);
}

.visual-novel__character.speaking {
  filter: brightness(1.1);
}

.visual-novel__character:not(.speaking) {
  filter: brightness(0.6);
}

.visual-novel__character--left {
  left: 5%;
}

.visual-novel__character--center {
  left: 50%;
  transform: translateX(-50%) translateY(20px);
}

.visual-novel__character--center.active {
  transform: translateX(-50%) translateY(0);
}

.visual-novel__character--right {
  right: 5%;
}

.visual-novel__character-img {
  max-height: 95%;
  width: auto;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.5));
}

/* Text Panel - 30% of screen (bottom) */
.visual-novel__text-panel {
  position: relative;
  z-index: 3;
  height: 30vh;
  background: linear-gradient(
    to top,
    rgba(47, 41, 41, 0.95) 0%,
    rgba(47, 41, 41, 0.92) 50%,
    rgba(47, 41, 41, 0.85) 100%
  );
  backdrop-filter: blur(8px);
  border-top: 3px solid var(--color-accent);
  display: flex;
  flex-direction: column;
  padding: 1rem;
  animation: slideUpPanel 0.5s ease-out;
}

.visual-novel__name-plate {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-deep));
  color: var(--color-bg-dark);
  padding: 0.5rem 1.5rem;
  border-radius: 8px 8px 0 0;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: -3px;
  align-self: flex-start;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  min-width: 120px;
  text-align: center;
}

.visual-novel__text-container {
  background: rgba(253, 251, 238, 0.98);
  border-radius: 0 12px 12px 12px;
  padding: 0.8rem 1.2rem;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  margin-bottom: 0.5rem;
  height: 4rem; /* Fixed height for ~2 lines */
  position: relative;
}

.visual-novel__text {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--color-text);
  margin: 0;
  white-space: pre-wrap;
  position: absolute;
  top: 0.8rem;
  left: 1.2rem;
  right: 1.2rem;
  transition: top 0.3s ease;
}

.visual-novel__choices {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0;
}

.visual-novel__choice {
  font-family: "Platypi", serif;
  font-size: 0.95rem;
  padding: 0.8rem 1.2rem;
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-deep));
  color: var(--color-bg-dark);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  box-shadow: 0 3px 10px rgba(113, 207, 175, 0.3);
}

.visual-novel__choice:hover {
  transform: translateX(8px);
  box-shadow: 0 4px 14px rgba(113, 207, 175, 0.5);
}

.visual-novel__choice:active {
  transform: translateX(4px);
}

.visual-novel__choice.selected {
  background: linear-gradient(135deg, var(--color-warm), var(--color-earth));
  box-shadow: 0 4px 14px rgba(239, 158, 41, 0.5);
}

/* Navigation Controls */
.visual-novel__navigation {
  position: absolute;
  bottom: calc(30vh + 1rem);
  left: 0;
  right: 0;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  padding: 0 1rem;
  pointer-events: none;
}

.visual-novel__nav-button {
  pointer-events: auto;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(113, 207, 175, 0.9);
  color: var(--color-bg-dark);
  border: 2px solid var(--color-accent-strong);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.visual-novel__nav-button:hover {
  background: var(--color-accent-strong);
  transform: scale(1.1);
}

.visual-novel__nav-button:active {
  transform: scale(0.95);
}

.visual-novel__nav-button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

.visual-novel__nav-button.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Top Controls */
.visual-novel__top-controls {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 5;
  display: flex;
  gap: 0.5rem;
}

.visual-novel__skip,
.visual-novel__menu {
  padding: 0.5rem 1rem;
  background: rgba(47, 41, 41, 0.8);
  color: var(--color-text-on-dark);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-family: "Platypi", serif;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
}

.visual-novel__skip:hover,
.visual-novel__menu:hover {
  background: rgba(47, 41, 41, 0.95);
  border-color: var(--color-accent);
}

.visual-novel__menu {
  width: 40px;
  height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Reward Popup */
.visual-novel__reward {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 6;
  animation: rewardPop 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.visual-novel__reward-content {
  background: linear-gradient(135deg, var(--color-warm), var(--color-accent-strong));
  color: var(--color-bg-dark);
  padding: 2rem;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(239, 158, 41, 0.6);
  border: 3px solid var(--color-accent-strong);
  text-align: center;
  min-width: 280px;
}

.visual-novel__reward-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  animation: pulse 1s ease-in-out infinite;
}

.visual-novel__reward-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ==========================================
   Portal Animation Styles (Vertical Format)
   ========================================== */

.portal-animation {
  position: fixed;
  inset: 0;
  z-index: 2800;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  animation: fadeIn 0.3s ease-out;
}

.portal-animation.hidden {
  display: none;
}

.portal-animation__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================
   Animations
   ========================================== */

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

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(40px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideUpPanel {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

@keyframes rewardPop {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ==========================================
   Responsive Adjustments (Vertical Priority)
   ========================================== */

@media (max-width: 600px) {
  .visual-novel__text-panel {
    padding: 0.8rem;
  }

  .visual-novel__text-container {
    padding: 1rem;
  }

  .visual-novel__text {
    font-size: 1rem;
  }

  .visual-novel__choice {
    font-size: 0.9rem;
    padding: 0.7rem 1rem;
  }

  .visual-novel__nav-button {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .visual-novel__reward-content {
    padding: 1.5rem;
    min-width: 240px;
  }

  .visual-novel__reward-icon {
    font-size: 3rem;
  }

  .visual-novel__reward-text {
    font-size: 1.1rem;
  }
}

/* Landscape orientation warning (game designed for portrait) */
@media (orientation: landscape) and (max-height: 600px) {
  .visual-novel__characters {
    height: 60vh;
  }

  .visual-novel__text-panel {
    height: 40vh;
  }

  .visual-novel__navigation {
    bottom: calc(40vh + 0.5rem);
  }
}
