/* ===========================
   Map Quiz Minigame – Styles
   =========================== */

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ── Header ──────────────────────────────── */
#game-header {
  text-align: center;
  padding: 16px 8px 8px;
  width: 100%;
  max-width: 900px;
}

#game-header h1 {
  font-size: 1.8rem;
  letter-spacing: 1px;
  color: #e2b96f;
}

#game-header p {
  font-size: 0.9rem;
  color: #aaa;
  margin-top: 4px;
}

/* ── Progress bar ────────────────────────── */
#progress-bar-wrap {
  width: 100%;
  max-width: 900px;
  padding: 8px 12px 0;
}

#progress-label {
  font-size: 0.8rem;
  color: #aaa;
  margin-bottom: 4px;
}

#progress-bar {
  height: 8px;
  background: #333;
  border-radius: 4px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e2b96f, #f0d080);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* ── Map Wrapper ──────────────────────────── */
#map-wrapper {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 12px auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  user-select: none;
}

#map-wrapper img {
  display: block;
  width: 100%;
  height: auto;
}

/* Map overlay shown before game start */
#map-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 10, 30, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  border-radius: 12px;
}

/* ── Start Button ────────────────────────── */
#btn-start {
  background: linear-gradient(135deg, #e2b96f, #c98e3a);
  color: #1a1a2e;
  border: none;
  padding: 14px 40px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 1px;
  box-shadow: 0 4px 20px rgba(226,185,111,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}

#btn-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(226,185,111,0.6);
}

#btn-start:active {
  transform: translateY(0);
}

/* ── Map Points ──────────────────────────── */
.map-point {
  position: absolute;
  width: 36px;
  height: 36px;
  transform: translate(-50%, -50%);
  cursor: default;
  z-index: 5;
}

.map-point .point-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #555;
  border: 3px solid #777;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  color: #ccc;
  transition: transform 0.2s, background 0.3s, border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

/* Locked state */
.map-point.locked .point-inner {
  background: #2a2a3a;
  border-color: #444;
  color: #555;
}

/* Active state (current question) */
.map-point.active {
  cursor: pointer;
  z-index: 6;
}

.map-point.active .point-inner {
  background: #e2b96f;
  border-color: #f0d080;
  color: #1a1a2e;
  box-shadow: 0 0 0 0 rgba(226,185,111,0.7);
  animation: pulse 1.6s infinite;
}

.map-point.active:hover .point-inner {
  transform: scale(1.2);
}

/* Completed state */
.map-point.completed .point-inner {
  background: #3cb371;
  border-color: #5dd891;
  color: #fff;
  animation: none;
}

/* Pulse animation */
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(226,185,111,0.7); }
  70%  { box-shadow: 0 0 0 14px rgba(226,185,111,0); }
  100% { box-shadow: 0 0 0 0 rgba(226,185,111,0); }
}

/* Point tooltip label */
.map-point .point-label {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.7rem;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.map-point.active:hover .point-label,
.map-point.completed:hover .point-label {
  opacity: 1;
}

/* ── Question Panel ───────────────────────── */
#question-panel {
  display: none;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(20, 20, 40, 0.97);
  backdrop-filter: blur(6px);
  padding: 20px 24px 24px;
  z-index: 8;
  border-top: 2px solid #e2b96f;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

#question-number {
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #e2b96f;
  margin-bottom: 8px;
}

#question-text {
  font-size: 1.05rem;
  margin-bottom: 14px;
  line-height: 1.5;
}

#options-list {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

#options-list li label {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #2a2a3a;
  border: 1px solid #444;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  font-size: 0.9rem;
}

#options-list li label:hover {
  background: #3a3a50;
  border-color: #e2b96f;
}

#options-list li input[type="radio"] {
  accent-color: #e2b96f;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

#options-list li.correct label {
  background: #1a4a2a;
  border-color: #3cb371;
  color: #5dd891;
}

#options-list li.wrong label {
  background: #4a1a1a;
  border-color: #c0392b;
  color: #e74c3c;
}

/* Panel actions */
#panel-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

#btn-submit {
  background: linear-gradient(135deg, #e2b96f, #c98e3a);
  color: #1a1a2e;
  border: none;
  padding: 10px 28px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s, opacity 0.15s;
}

#btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
}

#btn-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#feedback-msg {
  font-size: 0.9rem;
  font-weight: 600;
}

#feedback-msg.success { color: #3cb371; }
#feedback-msg.error   { color: #e74c3c; }

/* ── Completion Modal ────────────────────── */
#completion-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
}

#completion-modal.visible {
  display: flex;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal-box {
  background: #1e1e38;
  border: 2px solid #e2b96f;
  border-radius: 16px;
  padding: 40px 48px;
  text-align: center;
  max-width: 420px;
  width: 90%;
  box-shadow: 0 12px 48px rgba(0,0,0,0.7);
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.modal-box .trophy {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.modal-box h2 {
  font-size: 1.5rem;
  color: #e2b96f;
  margin-bottom: 8px;
}

.modal-box p {
  color: #aaa;
  font-size: 0.95rem;
  margin-bottom: 24px;
}

#btn-play-again {
  background: linear-gradient(135deg, #e2b96f, #c98e3a);
  color: #1a1a2e;
  border: none;
  padding: 12px 36px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 4px 16px rgba(226,185,111,0.35);
}

#btn-play-again:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(226,185,111,0.55);
}

/* ── Responsive ──────────────────────────── */
@media (max-width: 600px) {
  #game-header h1 { font-size: 1.3rem; }
  #options-list { grid-template-columns: 1fr; }
  .modal-box { padding: 28px 24px; }
  .map-point { width: 28px; height: 28px; }
  #question-panel { padding: 14px 14px 18px; }
}
