/* Cute Components & Layout Styling */

/* Header / Top Bar */
.game-header {
  height: 60px;
  background-color: var(--bg-panel);
  border-bottom: 2px dashed var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  z-index: 10;
}

.header-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-logo {
  width: 24px;
  height: 24px;
}

.header-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent-yellow);
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.4);
}

.header-info-badge {
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  font-size: 11px;
  text-align: right;
  display: flex;
  flex-direction: column;
  color: var(--text-muted);
}

.header-info-badge span {
  color: var(--accent-yellow);
  font-weight: 600;
}

/* Base Layout for Scenes */
.scene-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px 20px;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
}

/* Cute Buttons (Bouncy Game Style) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 14px 24px;
  cursor: pointer;
  transition: all 0.1s ease;
  position: relative;
  text-align: center;
  border: 2px solid #0d120f;
  outline: none;
}

.btn-primary {
  background-color: var(--accent-yellow);
  color: var(--text-dark);
  box-shadow: var(--shadow-button);
}

.btn-primary:hover {
  background-color: var(--accent-yellow-hover);
}

.btn-primary:active {
  box-shadow: 0 2px 0 #c2a83e;
  transform: translateY(4px);
}

.btn-secondary {
  background-color: var(--accent-pink);
  color: var(--text-dark);
  box-shadow: var(--shadow-button-pink);
}

.btn-secondary:hover {
  background-color: var(--accent-pink-hover);
}

.btn-secondary:active {
  box-shadow: 0 2px 0 #cc828e;
  transform: translateY(4px);
}

/* Glassmorphic and Solid Panels */
.panel {
  background-color: var(--bg-glass);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-md);
}

.panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-yellow);
  margin-bottom: 12px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* Progress / Scan Bars */
.stat-row {
  margin-bottom: 12px;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  margin-bottom: 4px;
  font-weight: 600;
  color: var(--text-light);
}

.stat-bar {
  height: 16px;
  background-color: rgba(0, 0, 0, 0.4);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-round);
  overflow: hidden;
  position: relative;
}

.stat-bar-fill {
  height: 100%;
  border-radius: var(--radius-round);
  background-size: 30px 30px;
  background-image: linear-gradient(
    45deg,
    rgba(255, 255, 255, 0.15) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.15) 50%,
    rgba(255, 255, 255, 0.15) 75%,
    transparent 75%,
    transparent
  );
  animation: bar-stripes 1.5s linear infinite;
  transition: width 0.3s ease;
}

.fill-red { background-color: #ff6b6b; }
.fill-green { background-color: #51cf66; }
.fill-blue { background-color: #339af0; }
.fill-pink { background-color: #ffaab7; }
.fill-yellow { background-color: #fadc60; }

@keyframes bar-stripes {
  0% { background-position: 0 0; }
  100% { background-position: 30px 0; }
}

/* Scene 1: Scanning specific elements */
.scanning-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin: 20px 0;
  padding: 24px;
}

.scanning-avatar-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin-bottom: 16px;
}

.scanning-avatar-svg {
  width: 100%;
  height: 100%;
}

.scan-laser {
  position: absolute;
  left: 0;
  width: 100%;
  height: 4px;
  background-color: var(--accent-pink);
  box-shadow: 0 0 10px var(--accent-pink);
  animation: scan-sweep 3s ease-in-out infinite;
  opacity: 0;
}

.scanning-card.scanning .scan-laser {
  opacity: 1;
}

.scan-status-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-light);
  margin-bottom: 8px;
}

.scan-status-details {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  width: 100%;
  font-size: 13px;
  margin-top: 10px;
}

.scan-status-details p {
  display: flex;
  justify-content: space-between;
  margin: 4px 0;
}

.scan-status-details span {
  font-weight: 700;
  color: var(--accent-yellow);
}

/* Scene 2: Office specific elements */
.office-background {
  flex: 1;
  position: relative;
  background-color: #121814;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 16px;
  min-height: 280px;
}

.office-sky {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background: linear-gradient(to bottom, #090d0b, #152219);
}

.office-stars {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 40px),
    radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 30px);
  background-size: 120px 120px, 90px 90px;
  background-position: 0 0, 40px 60px;
  opacity: 0.5;
}

.office-moon {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fdf5d6;
  box-shadow: 0 0 15px #fdf5d6;
}

.office-desk {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 40%;
  background: #251c14; /* cozy brown wood desk */
  border-top: 6px solid #3d2f23;
  display: flex;
  justify-content: center;
}

.office-character {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 110px;
  z-index: 5;
}

/* Floating speech bubbles */
.speech-bubble {
  position: absolute;
  background: var(--card-bg);
  color: var(--text-dark);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  font-size: 11px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid #0d120f;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 8;
  max-width: 110px;
  text-align: center;
}

.speech-bubble::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 10px;
  height: 10px;
  background: var(--card-bg);
  border-right: 1.5px solid #0d120f;
  border-bottom: 1.5px solid #0d120f;
}

.speech-bubble.active {
  opacity: 1;
  transform: translateY(-4px);
}

.mission-panel {
  text-align: center;
  padding: 16px;
}

.mission-panel p {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-light);
  margin-top: 8px;
}

/* Scene 3: Mini-Game Layout */
.game-container {
  flex: 1;
  position: relative;
  background: linear-gradient(to bottom, #19251d, #0d1410);
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 16px;
}

.game-hud {
  position: absolute;
  top: 12px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 10;
  pointer-events: none;
}

.hud-item {
  background: var(--bg-glass);
  border: 1.5px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-sm);
}

.hud-item.timer-low {
  color: #ff6b6b;
  border-color: #ff6b6b;
  animation: stress-shiver 0.2s linear infinite;
}

.hud-item span {
  color: var(--accent-yellow);
}

.game-semangat-bar-wrap {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  z-index: 10;
}

.game-playfield {
  width: 100%;
  height: 100%;
  position: relative;
}

.catcher-character {
  position: absolute;
  bottom: 30px;
  left: calc(50% - 40px);
  width: 80px;
  height: 80px;
  touch-action: none;
  z-index: 6;
  transition: transform 0.05s ease;
}

.falling-item {
  position: absolute;
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.falling-item svg {
  width: 100%;
  height: 100%;
}

.floating-score {
  position: absolute;
  font-weight: 800;
  font-size: 16px;
  z-index: 8;
  pointer-events: none;
  animation: score-float 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes score-float {
  0% {
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  30% {
    opacity: 1;
    transform: translateY(-20px) scale(1.2);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px) scale(1);
  }
}

.game-flash-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9;
}

.game-flash-overlay.flash {
  animation: flash-red 0.15s ease-out 1;
}

/* Game controls overlay for screen tapping */
.game-controls-tap {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 4;
}

.game-controls-tap-left {
  left: 0;
}

.game-controls-tap-right {
  right: 0;
}

/* Scene 4: Sayang Lebih Baik */
.starry-stars {
  background-image: 
    radial-gradient(white, rgba(255,255,255,.4) 2.5px, transparent 40px),
    radial-gradient(white, rgba(255,255,255,.2) 1.5px, transparent 30px);
  opacity: 0.9;
}

/* Scene 5, 6, 7: Love Cards Carousel */
.cards-deck-container {
  flex: 1;
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 24px;
}

.love-card-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
  perspective: 1000px;
}

.love-card {
  position: absolute;
  width: 100%;
  height: 100%;
  background-color: var(--card-bg);
  border: 4px solid #0d120f;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(255, 255, 255, 0.05);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dark);
  text-align: center;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1), opacity 0.6s ease;
  opacity: 0;
  pointer-events: none;
  transform: translateX(100%) rotateY(20deg);
}

.love-card.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) rotateY(0deg);
  z-index: 5;
}

.love-card.prev {
  opacity: 0;
  transform: translateX(-100%) rotateY(-20deg);
  z-index: 4;
}

.love-card.next {
  opacity: 0;
  transform: translateX(100%) rotateY(20deg);
  z-index: 4;
}

.card-number {
  background: var(--accent-pink);
  color: var(--text-dark);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  border: 2px solid #0d120f;
  box-shadow: 0 2px 0 #0d120f;
}

.card-text {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text-dark);
  margin: 16px 0;
}

.card-text span.highlight-pink {
  color: #d6336c;
  background-color: rgba(255, 170, 183, 0.3);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

.card-illustration {
  width: 140px;
  height: 140px;
}

.card-illustration svg {
  width: 100%;
  height: 100%;
}

.card-decision-buttons {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  margin-top: 10px;
}

.card-decision-buttons .btn {
  flex: 1;
  font-size: 14px;
  padding: 10px 16px;
}

.cards-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0 10px;
}

.nav-arrow {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--bg-panel);
  border: 2px solid var(--border-color);
  color: var(--accent-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.nav-arrow:hover {
  background-color: var(--border-color);
  color: white;
}

.nav-arrow:active {
  transform: scale(0.9);
}

.nav-arrow.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.nav-indicators {
  display: flex;
  gap: 8px;
}

.indicator-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--border-color);
  transition: background-color 0.3s ease;
}

.indicator-dot.active {
  background-color: var(--accent-pink);
  box-shadow: 0 0 6px var(--accent-pink);
}

.swipe-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
}

/* Scene 8: Ending & Virtual Hug elements */
.ending-sky-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: auto;
}

.ending-letter-box {
  background: rgba(254, 252, 240, 0.92);
  border: 4px solid #0d120f;
  border-radius: var(--radius-lg);
  padding: 20px;
  color: var(--text-dark);
  z-index: 2;
  box-shadow: var(--shadow-lg);
  margin-bottom: 20px;
  max-height: 380px;
  overflow-y: auto;
  position: relative;
  text-align: center;
}

.ending-letter-box p {
  margin-bottom: 12px;
  font-size: 14px;
  line-height: 1.6;
  font-weight: 600;
}

.ending-letter-box p:last-child {
  margin-bottom: 0;
}

.ending-dino-couple {
  width: 100px;
  height: 70px;
  margin: 0 auto 12px auto;
}

.ending-dino-couple svg {
  width: 100%;
  height: 100%;
}

.ending-action-area {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Hug Alert Modal */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 18, 15, 0.85);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: 100%;
  max-width: 320px;
  background-color: var(--card-bg);
  border: 4px solid #0d120f;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 24px;
  color: var(--text-dark);
  text-align: center;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.active .modal-card {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg-panel);
  border: 2px solid #0d120f;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
}

.modal-hug-emoticon {
  font-size: 32px;
  margin-bottom: 8px;
  font-weight: 700;
  color: #d6336c;
}

.modal-avatar {
  width: 100px;
  height: 100px;
  margin: 12px auto;
}

.modal-avatar svg {
  width: 100%;
  height: 100%;
}

.modal-text {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 16px;
}

.modal-stat-list {
  background: rgba(0, 0, 0, 0.05);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.modal-stat-list p {
  font-size: 13px;
  margin: 4px 0;
  font-weight: 700;
  color: #3b7a57;
  display: flex;
  justify-content: space-between;
}

.modal-stat-list span {
  font-weight: 800;
  color: #27352b;
}

/* Floating Signpost */
.signpost {
  background: #3e2e21; /* retro wood sign */
  color: var(--accent-yellow);
  border: 3px solid #1a120b;
  border-radius: var(--radius-sm);
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow-sm), 0 4px 0 #1a120b;
  transform: rotate(-2deg);
  display: flex;
  align-items: center;
  gap: 6px;
}

.signpost::before {
  content: "";
  position: absolute;
  bottom: -15px;
  left: 50%;
  transform: translateX(-50%);
  width: 8px;
  height: 15px;
  background: #3e2e21;
  border: 3px solid #1a120b;
  border-top: none;
  z-index: -1;
}
