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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.screen {
  display: none;
  width: 100%;
  max-width: 900px;
  padding: 2rem;
  text-align: center;
}

.screen.active {
  display: block;
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: #f8fafc;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #94a3b8;
}

p {
  font-size: 1.1rem;
  color: #94a3b8;
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 0.95rem;
  color: #64748b;
  margin-bottom: 2rem;
}

button {
  background: #3b82f6;
  color: white;
  border: none;
  padding: 0.8rem 2.5rem;
  font-size: 1.1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

button:hover {
  background: #2563eb;
}

/* Score bar */
#score-bar {
  display: flex;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  background: #1e293b;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 1rem;
  color: #cbd5e1;
}

/* Country cards container */
#countries {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.vs {
  font-size: 1.5rem;
  font-weight: bold;
  color: #475569;
  padding: 0 0.5rem;
}

/* Country card */
.country-card {
  flex: 1;
  max-width: 380px;
  background: #1e293b;
  border-radius: 16px;
  padding: 1.5rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.3s;
  border: 3px solid transparent;
}

.country-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  border-color: #3b82f6;
}

.country-card.disabled {
  pointer-events: none;
}

.country-card.correct {
  border-color: #22c55e;
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.country-card.wrong {
  border-color: #ef4444;
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.country-card.actual-bigger {
  border-color: #22c55e;
}

/* Flag */
.flag {
  width: 80px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* SVG container */
.svg-container {
  width: 280px;
  height: 280px;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: center center;
}

.svg-container svg {
  width: 100%;
  height: 100%;
}

.svg-container svg path {
  fill: #3b82f6;
  stroke: #1e40af;
  stroke-width: 0.5;
}

.country-card.correct .svg-container svg path,
.country-card.actual-bigger .svg-container svg path {
  fill: #22c55e;
  stroke: #15803d;
}

.country-card.wrong .svg-container svg path {
  fill: #ef4444;
  stroke: #b91c1c;
}

/* Country name */
.country-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: #f1f5f9;
}

/* Area label (shown after guess) */
.area-label {
  font-size: 0.95rem;
  color: #94a3b8;
  margin-top: 0.3rem;
  min-height: 1.4em;
}

/* Result bar */
.result-bar {
  margin-top: 1.5rem;
  padding: 1rem;
  border-radius: 8px;
  background: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  font-size: 1.1rem;
}

.result-bar.hidden {
  display: none;
}

.result-bar.correct-result {
  background: rgba(34, 197, 94, 0.15);
  color: #4ade80;
}

.result-bar.wrong-result {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

/* Game over screen */
.final-score {
  font-size: 1.5rem;
  color: #e2e8f0;
  margin-bottom: 1rem;
}

#final-message {
  font-size: 1.2rem;
  margin-bottom: 2rem;
  color: #94a3b8;
}

.name-input-group {
  margin-bottom: 1.5rem;
}

.name-input-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #94a3b8;
}

.name-input-group input {
  padding: 0.6rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 2px solid #334155;
  background: #1e293b;
  color: #f1f5f9;
  margin-right: 0.5rem;
  width: 200px;
}

.name-input-group input:focus {
  outline: none;
  border-color: #3b82f6;
}

#submit-status {
  margin-bottom: 1rem;
  color: #94a3b8;
}

.submit-success {
  color: #4ade80 !important;
}

.gameover-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
}

.link-btn {
  color: #94a3b8;
  text-decoration: none;
  font-size: 1rem;
  padding: 0.6rem 1.5rem;
  border: 2px solid #334155;
  border-radius: 8px;
  transition: border-color 0.2s, color 0.2s;
  display: inline-block;
  margin-top: 1rem;
}

.link-btn:hover {
  border-color: #3b82f6;
  color: #e2e8f0;
}

/* Highscores table */
table {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border-collapse: collapse;
}

th, td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid #1e293b;
}

th {
  color: #94a3b8;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  color: #e2e8f0;
}

tr.top-1 td { color: #fbbf24; font-weight: 700; }
tr.top-2 td { color: #d1d5db; font-weight: 600; }
tr.top-3 td { color: #cd7f32; font-weight: 600; }

/* Responsive */
@media (max-width: 700px) {
  #countries {
    flex-direction: column;
  }

  .vs {
    padding: 0.3rem 0;
  }

  .country-card {
    max-width: 100%;
  }

  .svg-container {
    width: 200px;
    height: 200px;
  }

  h1 {
    font-size: 1.8rem;
  }
}
