/* ==========================================================================
   ASPI DIGITAL PAYMENTS WORLD TOUR - GAME STYLES
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --primary-navy: #0b2559;
  --primary-blue: #0077c8;
  --primary-light-blue: #00a0e9;
  --ocean-deep: #053b6f;
  --ocean-surface: #1fa3f2;
  --ocean-foam: #e0f4ff;
  --gold: #f59e0b;
  --gold-light: #fde047;
  --gold-dark: #b45309;
  --green-success: #10b981;
  --green-dark: #047857;
  --red-wrong: #ef4444;
  --red-dark: #b91c1c;
  --card-bg: rgba(255, 255, 255, 0.95);
  --glass-bg: rgba(11, 37, 89, 0.82);
  --glass-border: rgba(255, 255, 255, 0.22);
  --text-dark: #0f172a;
  --text-muted: #64748b;
  --font-display: 'Fredoka', -apple-system, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-body);
  background: #062b53;
  color: #fff;
  user-select: none;
}

/* App Background: Animated ocean gradient */
.app-container {
  width: 100vw;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  background: radial-gradient(circle at 50% 30%, #1e6ea8 0%, #0c3e6b 50%, #05213d 100%);
  overflow: hidden;
}

/* Ocean waves ambient backdrop */
.ocean-ambient {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.25;
  background-image: radial-gradient(rgba(255,255,255,0.15) 1px, transparent 0);
  background-size: 28px 28px;
}

/* ==========================================================================
   GAME BOARD CONTAINER
   Aspect Ratio: 1024 x 1536 (0.6667)
   ========================================================================== */
.board-wrapper {
  position: relative;
  height: 98vh;
  max-height: 1000px;
  aspect-ratio: 1024 / 1536;
  max-width: 98vw;
  border-radius: 28px;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.6),
    0 0 0 3px rgba(255, 255, 255, 0.2),
    0 0 40px rgba(0, 160, 233, 0.35);
  overflow: hidden;
  background: #0284c7;
  display: flex;
  flex-direction: column;
}

/* Map Board Surface */
.board-surface {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-image: url('assets/board_clean.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Canvas Overlay for ripples, footprints, effects */
#effects-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 5;
}

/* ==========================================================================
   TOP HUD
   ========================================================================== */
.hud-top {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 30;
  pointer-events: auto;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  background: rgba(255, 255, 255, 0.95);
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  border: 2px solid rgba(255, 255, 255, 0.8);
}

.brand-logo-img {
  height: 26px;
  object-fit: contain;
}

.player-chip {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-score-badge {
  background: linear-gradient(135deg, #0284c7, #034891);
  border: 2.5px solid #ffffff;
  border-radius: 22px;
  padding: 4px 16px 4px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(2, 72, 145, 0.45);
}

.score-star {
  font-size: 1.3rem;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.25));
  animation: starPulse 2s ease-in-out infinite;
}

@keyframes starPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15) rotate(8deg); }
}

.score-info {
  display: flex;
  flex-direction: column;
}

.score-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #bae6fd;
  line-height: 1;
}

.score-number {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.hud-btn {
  background: var(--glass-bg);
  border: 1.5px solid var(--glass-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
}

.hud-btn:hover {
  transform: scale(1.08);
  background: rgba(14, 165, 233, 0.85);
}

/* ==========================================================================
   DESTINATION PROGRESS STRIP
   ========================================================================== */
.destination-tracker {
  position: absolute;
  top: 135px;
  left: 20px;
  right: 20px;
  background: rgba(11, 37, 89, 0.88);
  backdrop-filter: blur(12px);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 6px 12px;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 25;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}

.tracker-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  opacity: 0.65;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  cursor: pointer;
}

.tracker-node.unlocked {
  opacity: 0.95;
}

.tracker-node.current {
  opacity: 1;
  transform: scale(1.18);
}

.tracker-node.current .tracker-flag-ring {
  box-shadow: 0 0 14px #fbbf24, 0 0 22px #f59e0b;
  border-color: #fbbf24;
  animation: currentBounce 1.2s ease-in-out infinite alternate;
}

@keyframes currentBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

.tracker-node.completed {
  opacity: 1;
}

.tracker-node.completed .tracker-flag-ring {
  border-color: #10b981;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
}

.tracker-flag-ring {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tracker-flag-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tracker-check-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #10b981;
  color: white;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  border: 1.5px solid white;
}

.tracker-node.completed .tracker-check-badge {
  display: flex;
}

.tracker-label {
  font-size: 0.62rem;
  font-weight: 700;
  color: #f0f9ff;
  text-align: center;
  max-width: 52px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   ISLAND HOTSPOTS & TARGET INDICATORS
   ========================================================================== */
.island-zone {
  position: absolute;
  pointer-events: auto;
  cursor: pointer;
  z-index: 12;
  border-radius: 24px;
  transition: all 0.3s ease;
}

/* Target Pointer Badge */
.island-target-beacon {
  position: absolute;
  transform: translate(-50%, -100%);
  display: none;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  z-index: 15;
  animation: beaconBob 1.2s ease-in-out infinite alternate;
}

@keyframes beaconBob {
  from { transform: translate(-50%, -105%); }
  to { transform: translate(-50%, -125%); }
}

.island-target-beacon.active {
  display: flex;
}

.beacon-bubble {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #ffffff;
  border: 2px solid #fef08a;
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.7);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.beacon-bubble-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 7px solid #d97706;
  margin-top: -1px;
}

/* Completed Visa Stamp on Island */
.island-cleared-seal {
  position: absolute;
  transform: translate(-50%, -50%) rotate(-10deg) scale(0);
  background: rgba(16, 185, 129, 0.92);
  backdrop-filter: blur(4px);
  color: #ffffff;
  border: 2px solid #a7f3d0;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
  z-index: 14;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.island-cleared-seal.visible {
  transform: translate(-50%, -50%) rotate(-10deg) scale(1);
}

/* ==========================================================================
   TRAVELER CHARACTER SPRITE
   ========================================================================== */
.traveler-character {
  position: absolute;
  width: 110px;
  height: 195px;
  pointer-events: none;
  z-index: 20;
  transform: translate(-50%, -85%);
  transition: filter 0.3s ease;
  filter: drop-shadow(0 8px 12px rgba(0, 20, 50, 0.45));
}

.traveler-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Walking Bobbing Animation */
.traveler-character.walking {
  animation: walkBob 0.32s ease-in-out infinite alternate;
}

@keyframes walkBob {
  0% { transform: translate(-50%, -88%) rotate(-2deg) scale(0.98); }
  100% { transform: translate(-50%, -82%) rotate(2deg) scale(1.02); }
}

.traveler-character.idle {
  animation: idleBreathe 3s ease-in-out infinite alternate;
}

@keyframes idleBreathe {
  0% { transform: translate(-50%, -85%) scale(1); }
  100% { transform: translate(-50%, -87%) scale(1.01); }
}

/* Golden Arrival Aura */
.traveler-character.arrived {
  animation: arriveGlow 1s ease-out;
}

@keyframes arriveGlow {
  0% { filter: drop-shadow(0 0 30px #fbbf24) brightness(1.3); }
  100% { filter: drop-shadow(0 8px 12px rgba(0, 20, 50, 0.45)) brightness(1); }
}

/* ==========================================================================
   BOTTOM INTERACTIVE CONTROLS (DICE & ACTIONS)
   ========================================================================== */
.hud-bottom {
  position: absolute;
  bottom: 18px;
  left: 14px;
  right: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  z-index: 30;
  pointer-events: auto;
}

/* Dynamic Notification Toast */
.announcement-toast {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1.5px solid var(--glass-border);
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  pointer-events: none;
}

.announcement-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Dice Bar */
.dice-action-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(11, 37, 89, 0.88);
  backdrop-filter: blur(14px);
  padding: 8px 14px 8px 10px;
  border-radius: 34px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: 
    0 10px 30px rgba(0, 0, 0, 0.4),
    0 0 25px rgba(2, 132, 199, 0.4);
}

/* 3D Dice Sphere / Cube */
.dice-box {
  width: 54px;
  height: 54px;
  perspective: 600px;
  cursor: pointer;
  position: relative;
}

.dice-cube {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.dice-cube.rolling {
  animation: roll3D 0.8s infinite linear;
}

@keyframes roll3D {
  0% { transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg); }
  100% { transform: rotateX(720deg) rotateY(1080deg) rotateZ(360deg); }
}

.dice-face {
  position: absolute;
  width: 54px;
  height: 54px;
  background: #ffffff;
  border: 2px solid #0284c7;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 10px rgba(0, 119, 200, 0.2);
  backface-visibility: hidden;
}

.dice-face img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.dice-face.face-1 { transform: rotateY(0deg) translateZ(27px); }
.dice-face.face-2 { transform: rotateY(90deg) translateZ(27px); }
.dice-face.face-3 { transform: rotateY(180deg) translateZ(27px); }
.dice-face.face-4 { transform: rotateY(-90deg) translateZ(27px); }
.dice-face.face-5 { transform: rotateX(90deg) translateZ(27px); }
.dice-face.face-6 { transform: rotateX(-90deg) translateZ(27px); }

/* Roll Destination Button */
.btn-roll {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #fff;
  border: 2px solid #fde047;
  padding: 10px 22px;
  border-radius: 26px;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 
    0 6px 20px rgba(245, 158, 11, 0.45),
    inset 0 1px 0 rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.btn-roll:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.6);
}

.btn-roll:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.btn-roll:disabled {
  background: #64748b;
  border-color: #94a3b8;
  opacity: 0.65;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-roll .btn-icon {
  font-size: 1.25rem;
}

/* ==========================================================================
   MODALS (WELCOME, QUIZ, STAMP, CERTIFICATE)
   ========================================================================== */
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 20, 45, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 16px;
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: #ffffff;
  color: var(--text-dark);
  border-radius: 28px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
  transform: scale(0.9) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}

.modal-backdrop.open .modal-card {
  transform: scale(1) translateY(0);
}

/* Custom Scrollbar */
.modal-card::-webkit-scrollbar {
  width: 6px;
}
.modal-card::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* ==========================================================================
   START / REGISTRATION MODAL
   ========================================================================== */
.welcome-hero {
  background: linear-gradient(135deg, #0077c8 0%, #034891 100%);
  color: #fff;
  padding: 24px 20px 20px;
  text-align: center;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  position: relative;
  overflow: hidden;
}

.welcome-logo {
  height: 38px;
  margin-bottom: 12px;
}

.welcome-title {
  font-family: var(--font-display);
  font-size: 1.45rem;
  line-height: 1.25;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.welcome-subtitle {
  font-size: 0.85rem;
  color: #bae6fd;
  line-height: 1.4;
}

.welcome-body {
  padding: 22px 22px 24px;
}

.rules-list {
  background: #f0f9ff;
  border: 1.5px solid #bae6fd;
  border-radius: 18px;
  padding: 14px 16px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rule-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.85rem;
  color: #0369a1;
  line-height: 1.4;
}

.rule-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: var(--font-body);
  border: 2px solid #cbd5e1;
  border-radius: 14px;
  outline: none;
  transition: all 0.2s ease;
}

.input-field:focus {
  border-color: #0077c8;
  box-shadow: 0 0 0 4px rgba(0, 119, 200, 0.15);
}

.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #0284c7 0%, #034891 100%);
  color: #fff;
  border: none;
  padding: 14px 20px;
  border-radius: 16px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(2, 72, 145, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 72, 145, 0.45);
}

/* ==========================================================================
   QUIZ MODAL (QUESTION INTERACTION)
   ========================================================================== */
.quiz-header {
  background: linear-gradient(135deg, #0077c8 0%, #0c3e6b 100%);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
}

.quiz-country-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.quiz-flag-disc {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #fff;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
  background: #fff;
}

.quiz-flag-disc img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.quiz-country-text {
  display: flex;
  flex-direction: column;
}

.quiz-country-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.quiz-category-tag {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 12px;
  align-self: flex-start;
  margin-top: 4px;
}

.quiz-progress-badge {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.quiz-q-count {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fbbf24;
}

.quiz-points-val {
  font-size: 0.75rem;
  color: #bae6fd;
  font-weight: 600;
}

.quiz-body {
  padding: 20px 22px 24px;
}

.quiz-question-card {
  margin-bottom: 18px;
}

.quiz-question-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.45;
}

/* Quiz Option Buttons */
.quiz-options-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.quiz-opt-btn {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.quiz-opt-btn:hover:not(:disabled) {
  border-color: #0284c7;
  background: #f0f9ff;
  transform: translateX(4px);
}

.quiz-opt-btn:disabled {
  cursor: default;
}

.opt-letter {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #e2e8f0;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.opt-text {
  flex-grow: 1;
  line-height: 1.35;
}

/* Option Selected State */
.quiz-opt-btn.correct {
  background: #ecfdf5 !important;
  border-color: #10b981 !important;
  color: #065f46 !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}

.quiz-opt-btn.correct .opt-letter {
  background: #10b981;
  color: #fff;
}

.quiz-opt-btn.wrong {
  background: #fef2f2 !important;
  border-color: #ef4444 !important;
  color: #991b1b !important;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.25);
}

.quiz-opt-btn.wrong .opt-letter {
  background: #ef4444;
  color: #fff;
}

.quiz-opt-btn.highlight-correct {
  background: #f0fdf4 !important;
  border-color: #34d399 !important;
  border-style: dashed;
}

/* Explanation Box */
.quiz-feedback-box {
  background: #f1f5f9;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 16px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.quiz-feedback-box.visible {
  display: block;
}

.quiz-feedback-box.correct {
  background: #ecfdf5;
  border-left: 4px solid #10b981;
  color: #065f46;
}

.quiz-feedback-box.wrong {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  color: #991b1b;
}

.feedback-headline {
  font-weight: 800;
  font-size: 0.85rem;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.feedback-desc {
  font-size: 0.82rem;
  line-height: 1.4;
  color: #334155;
}

/* Quiz Action / Next Bar */
.quiz-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auto-timer-track {
  flex-grow: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

.auto-timer-bar {
  height: 100%;
  width: 0%;
  background: #0284c7;
  transition: width linear;
}

.btn-next-question {
  background: linear-gradient(135deg, #0284c7 0%, #034891 100%);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 12px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.btn-next-question:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 12px rgba(2, 72, 145, 0.35);
}

/* ==========================================================================
   COUNTRY STAMP COMPLETION MODAL
   ========================================================================== */
.stamp-modal-content {
  text-align: center;
  padding: 30px 24px;
}

.stamp-island-preview {
  width: 130px;
  height: 100px;
  border-radius: 16px;
  object-fit: cover;
  margin: 0 auto 16px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  border: 3px solid #fff;
}

.stamp-badge-graphic {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px dashed #10b981;
  margin: 0 auto 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #10b981;
  font-family: var(--font-display);
  transform: rotate(-12deg) scale(0);
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: rgba(16, 185, 129, 0.08);
}

.stamp-badge-graphic.stamped {
  transform: rotate(-12deg) scale(1);
}

.stamp-badge-graphic .stamp-icon {
  font-size: 2rem;
}

.stamp-badge-graphic .stamp-text {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.stamp-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: #0f172a;
  margin-bottom: 8px;
}

.stamp-subtitle {
  font-size: 0.9rem;
  color: #64748b;
  margin-bottom: 20px;
}

.stamp-score-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  padding: 8px 18px;
  border-radius: 20px;
  color: #15803d;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 24px;
}

/* ==========================================================================
   FINAL PASSPORT / CERTIFICATE MODAL
   ========================================================================== */
.passport-card {
  padding: 0;
  background: #fafaf9;
}

.passport-header {
  background: linear-gradient(135deg, #0b2559 0%, #1e3a8a 100%);
  color: #fff;
  padding: 24px 20px 18px;
  text-align: center;
  border-top-left-radius: 28px;
  border-top-right-radius: 28px;
  position: relative;
}

.passport-gold-emblem {
  font-size: 2.2rem;
  margin-bottom: 6px;
  filter: drop-shadow(0 2px 8px rgba(251, 191, 36, 0.5));
}

.passport-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.passport-org {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #93c5fd;
  font-weight: 700;
}

.passport-body {
  padding: 22px 20px 24px;
}

.traveler-profile-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.traveler-avatar-box {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #e0f2fe;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  border: 2px solid #0284c7;
  flex-shrink: 0;
}

.traveler-stats {
  display: flex;
  flex-direction: column;
}

.traveler-name-val {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.traveler-rank-pill {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-size: 0.75rem;
  font-weight: 800;
  padding: 2px 10px;
  border-radius: 12px;
  margin-top: 4px;
  align-self: flex-start;
}

.score-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.stat-item-box {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 10px;
  text-align: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: #0284c7;
}

.stat-lbl {
  font-size: 0.68rem;
  color: #64748b;
  font-weight: 600;
  margin-top: 2px;
}

/* Passport 6 Stamps Grid */
.stamps-section-title {
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #475569;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.passport-stamps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}

.stamp-cell {
  background: #fff;
  border: 1.5px dashed #cbd5e1;
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.stamp-cell.verified {
  border-color: #10b981;
  background: #f0fdf4;
}

.stamp-cell-flag {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 4px;
  border: 1px solid #e2e8f0;
}

.stamp-cell-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.stamp-verified-seal {
  position: absolute;
  top: 2px;
  right: 2px;
  font-size: 0.65rem;
  background: #10b981;
  color: white;
  border-radius: 50%;
  width: 14px;
  height: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
}

.certificate-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-secondary {
  background: #f1f5f9;
  color: #334155;
  border: 1.5px solid #cbd5e1;
  padding: 12px 18px;
  border-radius: 14px;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

/* ==========================================================================
   PRINT STYLES FOR CERTIFICATE
   ========================================================================== */
@media print {
  body * {
    visibility: hidden;
  }
  #passport-modal, #passport-modal * {
    visibility: visible;
  }
  #passport-modal {
    position: absolute;
    inset: 0;
    background: #fff;
    padding: 0;
  }
  .modal-card {
    max-width: 100% !important;
    box-shadow: none !important;
    border: 2px solid #000;
  }
  .certificate-actions {
    display: none !important;
  }
}

/* ==========================================================================
   RESPONSIVE OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 640px) {
  .board-wrapper {
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  .brand-badge {
    padding: 4px 10px;
  }
  .brand-logo-img {
    height: 20px;
  }
  .player-chip {
    display: none;
  }
  .hud-score-badge {
    padding: 2px 12px;
  }
  .score-number {
    font-size: 1.1rem;
  }
  .traveler-character {
    width: 85px;
    height: 155px;
  }
  .btn-roll {
    font-size: 0.95rem;
    padding: 8px 16px;
  }
  .dice-box {
    width: 44px;
    height: 44px;
  }
  .dice-face {
    width: 44px;
    height: 44px;
  }
  .dice-face img {
    width: 30px;
    height: 30px;
  }
  .dice-face.face-1 { transform: rotateY(0deg) translateZ(22px); }
  .dice-face.face-2 { transform: rotateY(90deg) translateZ(22px); }
  .dice-face.face-3 { transform: rotateY(180deg) translateZ(22px); }
  .dice-face.face-4 { transform: rotateY(-90deg) translateZ(22px); }
  .dice-face.face-5 { transform: rotateX(90deg) translateZ(22px); }
  .dice-face.face-6 { transform: rotateX(-90deg) translateZ(22px); }
}

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