/* ==========================================================================
   DOODLE JUMP - GÓC GIẢI LAO LEARNINGEZ UNIVERSITY
   Styles Scoped dưới .doodle-game-wrapper để không xung đột Bootstrap
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka+One&family=Nunito:wght@600;700;800&display=swap');

.doodle-game-wrapper {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(22, 50, 75, 0.2), 0 0 0 3px rgba(43, 91, 132, 0.15);
  background: #16213e;
  font-family: 'Nunito', sans-serif;
  user-select: none;
  -webkit-user-select: none;
}

.doodle-game-wrapper * {
  box-sizing: border-box;
}

#doodleCanvas {
  display: block;
  width: 100%;
  aspect-ratio: 480 / 600;
  max-height: 72vh;
  height: auto;
  background: linear-gradient(180deg, #74b9ff 0%, #dff9fb 45%, #a8e6cf 75%, #88d49e 100%);
  cursor: pointer;
  touch-action: none;
}

/* Top UI Bar */
.doodle-ui {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(15, 32, 67, 0.65), transparent);
  z-index: 5;
}

.doodle-ui-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.doodle-score-label,
.doodle-high-score-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.85);
}

.doodle-score-val,
.doodle-high-score-val {
  font-family: 'Fredoka One', cursive;
  font-size: 24px;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.doodle-high-score-val {
  color: #ffda79;
}

/* Pause Badge */
.doodle-pause-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 999px;
  display: none;
  pointer-events: none;
}
.doodle-pause-badge.show {
  display: inline-block;
}

/* Overlays (Start & Game Over) */
.doodle-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(16, 28, 48, 0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  padding: 24px;
  text-align: center;
  z-index: 10;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.doodle-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.doodle-overlay h1 {
  font-family: 'Fredoka One', cursive;
  font-size: 2.4rem;
  color: #ffffff;
  margin: 0 0 12px;
  text-shadow: 0 4px 0 #2ed573, 0 6px 16px rgba(0, 0, 0, 0.4);
}

.doodle-overlay p {
  color: rgba(255, 255, 255, 0.92);
  margin: 6px 0;
  font-size: 0.95rem;
}

.doodle-overlay kbd {
  display: inline-block;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.9em;
  color: #ffffff;
}

.doodle-btn-start {
  margin-top: 20px;
  padding: 12px 36px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.25rem;
  color: #0f2438;
  background: linear-gradient(180deg, #2ed573 0%, #10ac84 100%);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 5px 0 #0b755a, 0 8px 20px rgba(0, 0, 0, 0.35);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.doodle-btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 0 #0b755a, 0 10px 24px rgba(0, 0, 0, 0.4);
  color: #0a1826;
}

.doodle-btn-start:active {
  transform: translateY(2px);
  box-shadow: 0 3px 0 #0b755a, 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Game Over Overlay Specific */
.doodle-overlay-gameover h2 {
  font-family: 'Fredoka One', cursive;
  font-size: 2.2rem;
  color: #ff4757;
  margin: 0 0 10px;
  text-shadow: 0 3px 0 #b32a35, 0 4px 12px rgba(0, 0, 0, 0.4);
}

.doodle-overlay-gameover .final-score-box {
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 24px;
  border-radius: 14px;
  margin: 8px 0 16px;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.doodle-overlay-gameover #doodleFinalScore {
  font-family: 'Fredoka One', cursive;
  font-size: 2.2rem;
  color: #ffd32a;
}

/* Mobile Controls */
.doodle-mobile-controls {
  position: absolute;
  bottom: 12px;
  left: 0;
  right: 0;
  padding: 0 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 6;
}

.doodle-ctrl-btn {
  pointer-events: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(22, 50, 75, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 24px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s ease, background 0.1s ease;
}

.doodle-ctrl-btn:active,
.doodle-ctrl-btn.active {
  background: rgba(46, 213, 115, 0.85);
  color: #0f2438;
  transform: scale(0.92);
}

@media (hover: hover) {
  .doodle-ctrl-btn:hover {
    background: rgba(22, 50, 75, 0.7);
  }
}

/* Quick Tool Buttons on top-right of wrapper */
.doodle-quick-actions {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 8px;
  z-index: 7;
  pointer-events: auto;
}

.doodle-mini-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.doodle-mini-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: translateY(-1px);
}

/* ==========================================================================
   LOFI & CHILL MUSIC PLAYER (YOUTUBE INTEGRATION)
   ========================================================================== */
.lofi-player-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 220px;
  background: #0f172a;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lofi-player-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.lofi-preset-btn {
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  text-decoration: none !important;
}

.lofi-preset-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #0f172a;
  transform: translateY(-1px);
}

.lofi-preset-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

/* Sound Wave Animation */
.sound-wave {
  display: inline-flex;
  align-items: flex-end;
  gap: 2.5px;
  height: 14px;
}
.sound-bar {
  width: 3px;
  background-color: #22c55e;
  border-radius: 2px;
  animation: soundWaveAnim 0.8s ease-in-out infinite alternate;
}
.sound-bar:nth-child(1) { height: 4px; animation-delay: 0.1s; }
.sound-bar:nth-child(2) { height: 14px; animation-delay: 0.3s; }
.sound-bar:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.sound-bar:nth-child(4) { height: 12px; animation-delay: 0.4s; }

@keyframes soundWaveAnim {
  0% { height: 3px; }
  100% { height: 14px; }
}

.sound-wave.paused .sound-bar {
  animation: none !important;
  height: 3px !important;
  background-color: #94a3b8 !important;
}

