@import url('https://fonts.googleapis.com/css2?family=Zen+Maru+Gothic:wght@400;700;900&family=Noto+Sans+JP:wght@300;400;700&display=swap');

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

:root {
  --pink-primary: #ff69b4;
  --pink-dark: #db4898;
  --purple-deep: #2d1b4e;
  --purple-light: #6b4c9a;
  --blue-midnight: #1a1a2e;
  --cyan-accent: #00ffff;
  --cherry: #ffb6c1;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: linear-gradient(135deg, var(--purple-deep) 0%, var(--blue-midnight) 100%);
  min-height: 100vh;
  overflow-x: hidden;
  color: #fff;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main Menu */
.main-menu {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.menu-background {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #1a1a2e 0%, #2d1b4e 50%, #1a1a2e 100%);
}

.cherry-blossoms {
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, var(--cherry) 2px, transparent 2px),
    radial-gradient(circle at 80% 20%, var(--pink-primary) 3px, transparent 3px),
    radial-gradient(circle at 60% 70%, var(--cherry) 2px, transparent 2px),
    radial-gradient(circle at 10% 80%, var(--pink-primary) 2px, transparent 2px);
  background-size: 100% 100%;
  animation: float 20s ease-in-out infinite;
  opacity: 0.4;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(20px) rotate(5deg); }
}

.drone-silhouettes {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 45 L55 40 L60 45 L55 50 Z' fill='rgba(255,105,180,0.1)'/%3E%3C/svg%3E");
  background-size: 50px 50px;
  animation: drones 30s linear infinite;
  opacity: 0.3;
}

@keyframes drones {
  0% { background-position: 0 0; }
  100% { background-position: 100px 100px; }
}

.menu-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 2rem;
}

.title-container {
  margin-bottom: 3rem;
}

.propeller-icon {
  font-size: 4rem;
  animation: spin 3s linear infinite;
  display: inline-block;
  margin-bottom: 1rem;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.game-title-main {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 3.5rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--pink-primary), var(--cherry), var(--cyan-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(255, 105, 180, 0.5);
  animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
  from { filter: drop-shadow(0 0 10px var(--pink-primary)); }
  to { filter: drop-shadow(0 0 20px var(--cherry)); }
}

.game-subtitle {
  font-size: 1.5rem;
  color: var(--cherry);
  font-weight: 300;
  letter-spacing: 0.3em;
  margin-top: 0.5rem;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  margin-bottom: 2rem;
}

.menu-btn {
  padding: 1rem 3rem;
  font-size: 1.2rem;
  font-family: 'Zen Maru Gothic', sans-serif;
  border: 2px solid var(--pink-primary);
  background: rgba(255, 105, 180, 0.1);
  color: var(--cherry);
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 250px;
}

.menu-btn:hover {
  background: var(--pink-primary);
  color: white;
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 105, 180, 0.5);
}

.menu-btn.start {
  background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
  color: white;
}

.character-preview {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.preview-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid;
  transition: transform 0.3s ease;
}

.preview-avatar:hover {
  transform: scale(1.2);
}

.preview-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Credits Overlay */
.credits-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.credits-box {
  background: linear-gradient(135deg, var(--purple-deep), var(--blue-midnight));
  padding: 2rem;
  border-radius: 20px;
  border: 2px solid var(--pink-primary);
  max-width: 400px;
  text-align: center;
}

.credits-box h3 {
  color: var(--pink-primary);
  margin-bottom: 1rem;
}

.credits-box .warning {
  color: #fbbf24;
  font-style: italic;
  margin-top: 1rem;
}

.credits-box button {
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  background: var(--pink-primary);
  border: none;
  border-radius: 25px;
  color: white;
  cursor: pointer;
}

/* Game Screen */
.game-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 100vh;
}

.scene-background {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.7);
}

.scene-background::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(26, 26, 46, 0.9) 100%);
}

.game-header {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(26, 26, 46, 0.8);
  backdrop-filter: blur(10px);
}

.day-indicator {
  background: var(--pink-primary);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-weight: bold;
}

.phase-indicator {
  color: var(--cherry);
  font-size: 0.9rem;
  text-transform: capitalize;
}

.rel-btn, .save-btn {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--pink-primary);
  color: var(--pink-primary);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  transition: all 0.3s ease;
}

.save-btn {
  margin-left: 0.5rem;
}

.rel-btn:hover, .save-btn:hover {
  background: var(--pink-primary);
  color: white;
}

/* Character Display */
.character-display {
  position: relative;
  z-index: 10;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 200px;
}

.character-portrait {
  animation: fadeIn 0.5s ease;
}

.character-portrait.large {
  max-width: 350px;
  max-height: 500px;
}

.character-portrait.large img {
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.character-portrait.small {
  width: 80px;
  height: 80px;
}

.character-portrait.small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.portrait-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-size: 2rem;
  font-weight: bold;
}

.portrait-placeholder.large {
  width: 200px;
  height: 300px;
  border-radius: 10px;
}

.portrait-placeholder.small {
  width: 60px;
  height: 60px;
}

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

/* Dialogue Container */
.dialogue-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(26, 26, 46, 0.9), rgba(45, 27, 78, 0.95));
  backdrop-filter: blur(20px);
  padding: 1.5rem;
  min-height: 180px;
  border-top: 2px solid var(--pink-primary);
  cursor: pointer;
}

.speaker-name {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.2rem;
  font-weight: bold;
  margin-bottom: 0.5rem;
  text-shadow: 0 0 10px currentColor;
}

.dialogue-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #f0f0f0;
  max-width: 800px;
}

.typing-cursor {
  animation: blink 0.7s infinite;
  color: var(--pink-primary);
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

.advance-hint {
  position: absolute;
  bottom: 0.5rem;
  right: 1rem;
  color: var(--cherry);
  font-size: 0.9rem;
  animation: bounce 1s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(5px); }
}

/* Choices */
.choices-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1rem;
}

.choice-button {
  padding: 1rem 1.5rem;
  background: rgba(255, 105, 180, 0.2);
  border: 2px solid var(--pink-primary);
  border-radius: 10px;
  color: white;
  font-size: 1rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.3s ease;
}

.choice-button:hover {
  background: var(--pink-primary);
  transform: translateX(10px);
  box-shadow: 0 0 20px rgba(255, 105, 180, 0.5);
}

/* Character Select */
.character-select {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  position: relative;
}

.select-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.4);
}

.character-select h2 {
  position: relative;
  z-index: 10;
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 2rem;
  color: var(--pink-primary);
  margin-bottom: 0.5rem;
}

.character-select > p {
  position: relative;
  z-index: 10;
  color: var(--cherry);
  margin-bottom: 2rem;
}

.character-options {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1.5rem;
  max-width: 800px;
  width: 100%;
}

.character-option {
  background: rgba(26, 26, 46, 0.9);
  border: 2px solid;
  border-radius: 15px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.character-option:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.option-info h4 {
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.option-info p {
  font-size: 0.75rem;
  color: #888;
}

/* Relationship Screen */
.relationship-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(26, 26, 46, 0.95);
  padding: 2rem;
  overflow-y: auto;
}

.relationship-screen h2 {
  text-align: center;
  color: var(--pink-primary);
  font-family: 'Zen Maru Gothic', sans-serif;
  margin-bottom: 2rem;
}

.character-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  max-width: 1000px;
  margin: 0 auto;
}

.char-card {
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid;
  border-radius: 15px;
  padding: 1.5rem;
  display: flex;
  gap: 1rem;
  align-items: center;
}

.char-info h4 {
  color: white;
  font-size: 1rem;
}

.char-info p {
  color: #888;
  font-size: 0.85rem;
}

.hearts {
  margin-top: 0.5rem;
}

.heart {
  font-size: 1.2rem;
  color: #444;
}

.heart.filled {
  color: var(--pink-primary);
}

.suspicion-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #888;
}

.meter {
  flex: 1;
  height: 6px;
  background: #333;
  border-radius: 3px;
  overflow: hidden;
}

.meter .fill {
  height: 100%;
  transition: width 0.3s ease;
}

.close-btn {
  display: block;
  margin: 2rem auto 0;
  padding: 0.75rem 2rem;
  background: var(--pink-primary);
  border: none;
  border-radius: 25px;
  color: white;
  cursor: pointer;
}

/* Propeller Game */
.propeller-game {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--blue-midnight) 0%, var(--purple-deep) 100%);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}

.propeller-game .game-title {
  text-align: center;
  color: var(--pink-primary);
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.game-layout {
  display: flex;
  gap: 2rem;
  flex: 1;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
}

.canvas-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.propeller-canvas {
  border: 2px solid var(--pink-primary);
  border-radius: 15px;
  background: var(--blue-midnight);
}

.efficiency-display {
  text-align: center;
  width: 100%;
}

.efficiency-display span {
  color: var(--cherry);
  font-size: 0.9rem;
}

.efficiency-bar {
  height: 20px;
  background: #333;
  border-radius: 10px;
  overflow: hidden;
  margin: 0.5rem 0;
}

.efficiency-fill {
  height: 100%;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.efficiency-value {
  font-size: 1.2rem !important;
  font-weight: bold;
}

.controls-panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--purple-light);
  border-radius: 15px;
  padding: 1.5rem;
  min-width: 280px;
}

.control-group {
  margin-bottom: 1.5rem;
}

.control-group label {
  display: block;
  color: var(--cherry);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.control-group input[type="range"] {
  width: 100%;
  accent-color: var(--pink-primary);
}

.control-group select {
  width: 100%;
  padding: 0.75rem;
  background: var(--blue-midnight);
  border: 1px solid var(--purple-light);
  border-radius: 8px;
  color: white;
}

.submit-design {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--pink-primary), var(--pink-dark));
  border: none;
  border-radius: 25px;
  color: white;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
}

.submit-design:hover:not(:disabled) {
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(255, 105, 180, 0.5);
}

.submit-design:disabled {
  opacity: 0.7;
}

.design-tips {
  text-align: center;
  padding: 1rem;
  color: #888;
  font-size: 0.9rem;
}

/* Ending Tease */
.ending-tease {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--purple-deep), var(--blue-midnight));
  padding: 2rem;
}

.tease-content {
  text-align: center;
  max-width: 500px;
}

.tease-content h2 {
  font-family: 'Zen Maru Gothic', sans-serif;
  font-size: 2.5rem;
  color: var(--pink-primary);
  margin-bottom: 1rem;
}

.tease-content p {
  color: var(--cherry);
  margin-bottom: 1rem;
}

.relationship-summary {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  padding: 1.5rem;
  margin: 1.5rem 0;
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item:last-child {
  border-bottom: none;
}

.route-hint {
  font-style: italic;
  color: var(--pink-primary) !important;
}

.restart-btn {
  margin-top: 2rem;
  padding: 1rem 2.5rem;
  background: var(--pink-primary);
  border: none;
  border-radius: 25px;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.restart-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(255, 105, 180, 0.5);
}

/* Footer */
.game-footer {
  position: fixed;
  bottom: 200px;
  right: 1rem;
  z-index: 30;
}

.game-footer a {
  color: rgba(255, 182, 193, 0.5);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.3s ease;
}

.game-footer a:hover {
  color: var(--pink-primary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .game-title-main {
    font-size: 2rem;
  }
  
  .game-subtitle {
    font-size: 1rem;
    letter-spacing: 0.1em;
  }
  
  .menu-btn {
    min-width: 200px;
    padding: 0.75rem 2rem;
  }
  
  .character-display {
    padding-bottom: 220px;
  }
  
  .character-portrait.large {
    max-width: 250px;
  }
  
  .dialogue-container {
    min-height: 200px;
  }
  
  .game-layout {
    flex-direction: column;
    align-items: center;
  }
  
  .propeller-canvas {
    width: 250px;
    height: 250px;
  }
  
  .controls-panel {
    width: 100%;
    max-width: 350px;
  }
  
  .character-options {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .game-footer {
    bottom: 220px;
    right: 0.5rem;
  }
}