/* Francie pro Kiki – mobilně první */

:root {
  --bg: #f7fafc;
  --card: #fff;
  --primary: #2c5282;
  --primary-light: #4299e1;
  --accent: #ed8936;
  --text: #2d3748;
  --text-muted: #718096;
  --correct: #38a169;
  --wrong: #e53e3e;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.12);
  --touch-min: 44px;
}

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

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  padding-bottom: max(1rem, env(safe-area-inset-bottom));
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 1.25rem;
}
.header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.02em;
}
.subtitle {
  margin: 0.25rem 0 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Screens */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 28rem;
  margin: 0 auto;
  width: 100%;
}
.screen.hidden {
  display: none !important;
}

.prompt {
  margin: 0 0 1rem;
  font-size: 1.1rem;
  color: var(--text);
}

/* Category buttons */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}
.btn {
  min-height: var(--touch-min);
  padding: 0.75rem 1.25rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active {
  transform: scale(0.98);
}
.btn-category {
  background: var(--card);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.btn-category:hover,
.btn-category:focus-visible {
  box-shadow: var(--shadow-lg);
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover,
.btn-primary:focus-visible {
  background: #2b6cb0;
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}
.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 2px solid var(--text-muted);
}
.btn-secondary:hover,
.btn-secondary:focus-visible {
  border-color: var(--primary);
  color: var(--primary);
}

/* Quiz screen */
.score {
  align-self: flex-end;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.map-container {
  width: 100%;
  max-height: 52vh;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: #e8eef5;
  touch-action: none;
  position: relative;
}
.map-container svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 52vh;
  object-fit: contain;
}
.map-container path {
  fill: #c5d4e8;
  stroke: #7a9bc4;
  stroke-width: 0.8;
}
.map-container .highlight-correct {
  fill: var(--correct);
  stroke: #2f8558;
}
.map-container .highlight-wrong {
  fill: var(--wrong);
  stroke: #c53030;
}
.map-container .marker-dot {
  fill: var(--primary);
  stroke: #fff;
  stroke-width: 2;
  pointer-events: none;
}

.question-text {
  margin: 1rem 0 0.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
  min-height: 2rem;
}

.feedback {
  margin: 0.5rem 0;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-align: center;
  min-height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.feedback.correct {
  background: #c6f6d5;
  color: #276749;
}
.feedback.wrong {
  background: #fed7d7;
  color: #c53030;
}

.quiz-actions {
  margin-top: 1rem;
  width: 100%;
  max-width: 20rem;
}
.quiz-actions .btn {
  width: 100%;
}

/* Result screen */
#screen-result h2 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
  color: var(--primary);
}
.result-summary {
  font-size: 1.25rem;
  margin: 0 0 1.5rem;
  text-align: center;
  color: var(--text);
}
#screen-result .btn {
  width: 100%;
  max-width: 20rem;
  margin-bottom: 0.75rem;
}
#screen-result .btn:last-of-type {
  margin-bottom: 0;
}

/* Larger touch targets and spacing on small devices */
@media (max-width: 380px) {
  .category-buttons {
    gap: 0.5rem;
  }
  .btn-category {
    flex: 1 1 45%;
  }
}

@media (min-width: 600px) {
  .header h1 {
    font-size: 2rem;
  }
  .map-container {
    max-height: 55vh;
  }
  .map-container svg {
    max-height: 55vh;
  }
}
