/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

body {
  background-color: #f0f0f0;
}

svg {
  max-width: 100%;
  height: auto;
}

svg [class*="land"],
svg [class*="circle"] {
  cursor: pointer;
}

/* Enlarge the tap target for small island nations (Cap-Vert, Comores, Maurice,
   Seychelles, Sao Tomé-et-Principe...) using the marker circles the source SVG
   already ships but hides by default (opacity: 0 in its own embedded stylesheet). */
svg .circle {
  opacity: 0.5 !important;
  transition: opacity 0.15s ease;
}

/* Applied via JS (quiz_controller#setHoveredRegion) rather than :hover, so that
   hovering any one shape of a country highlights all of its shapes together
   (mainland, islands, exclaves, the small-nation tap-target circle). */
svg .land.hovered {
  fill: #6c9bd1 !important;
}

svg .circle.hovered {
  opacity: 0.85 !important;
  fill: #6c9bd1 !important;
}

.answer-item {
  list-style: none;
}

/* The per-country list still exists (it's what tracks each country's
   answered/correct state and drives the fullscreen prompt below) but is
   never shown on screen — only one country is ever surfaced at a time. */
#answers_list {
  display: none;
}

.quiz-layout {
  position: relative;
}

.quiz-map {
  position: fixed;
  inset: 0;
}

.quiz-map-inner {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: white;
  cursor: grab;
  touch-action: none;
}

.quiz-map-inner:active {
  cursor: grabbing;
}

.quiz-map-inner svg {
  width: 100%;
  height: 100%;
  max-width: none;
}

.quiz-map-controls {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.quiz-map-controls button {
  width: 2rem;
  height: 2rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: white;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.quiz-map-controls button:hover {
  background: #f0f0f0;
}

.quiz-map-controls button.quiz-map-preset {
  width: auto;
  padding: 0 0.5rem;
  font-size: 0.8rem;
  white-space: nowrap;
}

#quiz_round_score {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  z-index: 2;
  background: white;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 0.4rem 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.quiz-prompt {
  position: fixed;
  bottom: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: white;
  border: 1px solid #ccc;
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
  max-width: calc(100vw - 1.5rem);
}

.quiz-prompt-nav {
  flex: 0 0 auto;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #ccc;
  border-radius: 50%;
  background: white;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

.quiz-prompt-nav:hover:not(:disabled) {
  background: #f0f0f0;
}

.quiz-prompt-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.quiz-prompt-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 8rem;
}

.quiz-prompt-progress {
  font-size: 0.75rem;
  color: #666;
}

.quiz-prompt-name {
  font-size: 1.1rem;
  font-weight: bold;
  white-space: nowrap;
}

.quiz-prompt-name.correct {
  color: #155724;
}

.quiz-prompt-name.incorrect {
  color: #721c24;
}

#quiz_round_completed:not(:empty) {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  background: white;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
  max-width: 90vw;
  text-align: center;
}

.region-label {
  font-size: 10px;
  font-weight: bold;
  pointer-events: none;
}

.region-label.correct {
  fill: #155724;
}

.region-label.revealed {
  fill: #721c24;
}

.flash {
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin: 0 0 1rem;
}

.flash-alert {
  background-color: #f8d7da;
  color: #721c24;
}

.flash-notice {
  background-color: #d4edda;
  color: #155724;
}
