/* ============================================================
   RESET & BASE
   ============================================================ */
* { margin:0; padding:0; box-sizing:border-box; }

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #0a1628;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 20px;
  color: #f0f8ff;
}

.hidden { display: none !important; }

.page-wrapper { max-width: 860px; width: 100%; }

/* ============================================================
   GAME FRAME
   ============================================================ */
.game-frame {
  background: #132043;
  border-radius: 30px;
  padding: 25px 25px 20px;
  border: 2px solid #2a4a7f;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  margin-bottom: 10px;
}

/* ============================================================
   SOURCE
   ============================================================ */
.source-area { text-align: center; margin-bottom: 14px; }
.source-label {
  font-size: 0.85rem;
  color: #9bbce0;
  font-weight: 600;
  margin-bottom: 6px;
}
.source-label .flag { font-size: 1.1rem; }
.source-phrase {
  display: inline-block;
  background: #0b1a33;
  color: #ffffff;
  padding: 12px 30px;
  border-radius: 60px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 1px;
  border: 2px solid #2a5a9a;
  box-shadow: 0 6px 0 #08142a;
  text-shadow: 0 0 20px rgba(100,180,255,0.2);
  min-width: 180px;
  text-align: center;
}
.btn-listen-source {
  display: block;
  margin: 10px auto 0;
  background: transparent;
  border: 1px solid #3a6a8a;
  color: #aac8e8;
  padding: 5px 20px;
  border-radius: 30px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: 0.2s;
  font-weight: 600;
}
.btn-listen-source:hover {
  background: #1a3a5a;
  border-color: #5a9aff;
  color: #ffffff;
}

/* ============================================================
   OPTIONS
   ============================================================ */
.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.option-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #0d2140;
  border: 2px solid #2a5a8a;
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #f0f8ff;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 4px 0 #08142a;
  text-align: left;
  min-height: 56px;
  position: relative;
}
.option-btn:hover:not(:disabled) {
  transform: scale(1.02);
  border-color: #5a9aff;
  background: #1a3a6a;
}
.option-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #08142a;
}
.option-btn:disabled { cursor: not-allowed; opacity: 0.75; }

.option-btn.correct {
  background: #1a6a3a;
  border-color: #4ad87a;
  box-shadow: 0 4px 0 #0d4a2a;
  animation: pulse-green 0.5s ease;
}
.option-btn.wrong {
  background: #6a1a2a;
  border-color: #ff4a5a;
  box-shadow: 0 4px 0 #4a0d1a;
  animation: shake 0.4s ease;
}

.opt-flag { font-size: 1.3rem; flex-shrink: 0; }
.opt-text { flex: 1; }

.btn-listen-option {
  background: transparent;
  border: none;
  color: #8ac8f0;
  font-size: 1rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: 0.2s;
  flex-shrink: 0;
}
.btn-listen-option:hover {
  background: #1a3a5a;
  color: #ffffff;
}

@keyframes pulse-green {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ============================================================
   FEEDBACK
   ============================================================ */
.feedback {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 10px 14px;
  border-radius: 16px;
  background: #0b1a33;
  border: 1px solid #1e3a6b;
  font-size: 0.95rem;
  line-height: 1.4;
  margin-bottom: 14px;
}
.feedback-correct {
  background: #0d2a1a;
  border-color: #2a8a5a;
  color: #b8f0d0;
}
.feedback-wrong {
  background: #2a0d1a;
  border-color: #8a2a3a;
  color: #f0b8c8;
}

/* ============================================================
   CONTROLS
   ============================================================ */
.controls-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 14px;
}
.btn-control {
  background: #1a3a6a;
  color: white;
  border: 1px solid #3a6aaa;
  padding: 10px 28px;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
  box-shadow: 0 4px 0 #0a1a3a;
  min-width: 110px;
}
.btn-control:hover:not(:disabled) {
  background: #2a5a8a;
  transform: scale(1.02);
}
.btn-control:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #0a1a3a;
}
.btn-control:disabled { opacity: 0.45; cursor: not-allowed; }
.reset-btn { background: #2a3a5a; border-color: #4a6a8a; }
.reset-btn:hover { background: #3a5a7a; }

/* ============================================================
   SCORE
   ============================================================ */
.score-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.85rem;
  color: #9ab8d8;
  border-top: 1px solid #1a2a4a;
  padding-top: 12px;
}
.score-row span { white-space: nowrap; }

/* ============================================================
   PROGRESS FRAME (separate, dark navy, small)
   ============================================================ */
.progress-frame {
  background: #060d18;
  border: 1px solid #14233a;
  border-radius: 10px;
  padding: 6px 14px 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.progress-track {
  width: 100%;
  height: 5px;
  background: #0b1a33;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #1e3a6b;
  margin-bottom: 4px;
}
.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #4a9eff, #00d4ff);
  border-radius: 10px;
  transition: width 0.4s ease;
}
.progress-label {
  font-size: 0.65rem;
  color: #6a8aaa;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ============================================================
   TITLE UNDER GAME
   ============================================================ */
.title-under-game {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #c0d8f0;
  letter-spacing: 1px;
  margin-bottom: 18px;
  padding: 8px 0;
  border-bottom: 1px solid #1a2a4a;
}
.title-emoji { margin: 0 6px; }

/* ============================================================
   RESULTS SCREEN
   ============================================================ */
.results-screen {
  background: #132043;
  border-radius: 30px;
  padding: 30px 25px;
  border: 2px solid #2a4a7f;
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  text-align: center;
  margin-bottom: 18px;
}
.results-title {
  font-size: 1.6rem;
  color: #ffffff;
  margin-bottom: 22px;
}
.results-grid {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.result-card {
  background: #0d1f3a;
  border: 1px solid #2a4a6a;
  border-radius: 18px;
  padding: 18px 28px;
  min-width: 110px;
}
.result-number {
  font-size: 2rem;
  font-weight: 700;
  color: #8ac8f0;
}
.result-label {
  font-size: 0.8rem;
  color: #9ab8d8;
  margin-top: 4px;
}
.results-message {
  font-size: 1rem;
  color: #d4e8ff;
  margin-bottom: 22px;
  line-height: 1.5;
}

/* ============================================================
   INFO FRAMES (small, elegant, professional)
   ============================================================ */
.info-frame {
  background: #0d1f3a;
  border: 1px solid #1a3a5a;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.info-flag { font-size: 1rem; }
.info-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: #b8d4f0;
  letter-spacing: 0.5px;
  flex: 1;
}
.btn-listen-info {
  background: transparent;
  border: 1px solid #3a6a8a;
  color: #aac8e8;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: 0.2s;
}
.btn-listen-info:hover {
  background: #1a3a5a;
  border-color: #5a9aff;
  color: #ffffff;
}
.info-body {
  font-size: 0.8rem;
  color: #9ab8d8;
  line-height: 1.6;
}
.info-body p { margin-bottom: 6px; }
.info-body p:last-child { margin-bottom: 0; }

/* Mini nav */
.mini-nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
}
.mini-nav-link {
  color: #8aaac8;
  text-decoration: none;
  font-size: 0.7rem;
  transition: 0.2s;
  white-space: nowrap;
}
.mini-nav-link:hover { color: #ffffff; text-decoration: underline; }
.mini-nav-dot { color: #4a6a8a; font-size: 0.6rem; }

/* Gift buttons */
.gift-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.btn-small {
  display: inline-block;
  background: #1a3a6a;
  color: #d4e8ff;
  border: 1px solid #3a6aaa;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.7rem;
  text-decoration: none;
  transition: 0.2s;
  cursor: pointer;
}
.btn-small:hover {
  background: #2a5a8a;
  color: #ffffff;
}

/* Notebook */
.notebook-area {
  width: 100%;
  background: #0b1a33;
  border: 1px solid #1a3a5a;
  border-radius: 10px;
  padding: 8px 10px;
  color: #e0f0ff;
  font-size: 0.8rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  margin-bottom: 6px;
}
.notebook-area:focus {
  outline: none;
  border-color: #4a8aff;
}
.notebook-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}
.notebook-note {
  font-size: 0.65rem;
  color: #6a8aaa;
}

/* Image */
.image-wrapper {
  margin-top: 8px;
  text-align: center;
}
.image-wrapper img {
  max-width: 200px;
  width: 100%;
  border-radius: 10px;
  border: 1px solid #1a3a5a;
  object-fit: cover;
}

/* ============================================================
   FOOTER
   ============================================================ */
.final-footer {
  text-align: center;
  font-size: 0.7rem;
  color: #5a7a9a;
  padding: 12px 0 4px;
  border-top: 1px solid #1a2a4a;
  margin-top: 10px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 600px) {
  .game-frame { padding: 18px 12px 16px; }
  .options-grid { grid-template-columns: 1fr; gap: 8px; }
  .option-btn { font-size: 0.85rem; padding: 10px 12px; min-height: 48px; }
  .source-phrase { font-size: 1.5rem; padding: 8px 18px; min-width: 120px; }
  .btn-control { padding: 8px 16px; font-size: 0.85rem; min-width: 80px; }
  .results-title { font-size: 1.3rem; }
  .result-card { padding: 12px 18px; min-width: 90px; }
  .result-number { font-size: 1.5rem; }
  .title-under-game { font-size: 1.1rem; }
  .info-body { font-size: 0.75rem; }
}

@media (max-width: 400px) {
  .option-btn { font-size: 0.75rem; padding: 8px 10px; min-height: 42px; }
  .source-phrase { font-size: 1.2rem; padding: 6px 14px; min-width: 100px; }
  .opt-flag { font-size: 1.1rem; }
  .btn-listen-option { font-size: 0.85rem; }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
