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

html, body {
  width: 100%;
  min-height: 100%;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 50% 0%, #1d3557, #0b1626 70%);
  color: #fff;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

#app {
  max-width: 1000px;
  margin: 0 auto;
  padding: 14px 14px 40px;
}

header h1 {
  text-align: center;
  font-size: 26px;
  letter-spacing: 2px;
  color: #ffd166;
  margin-bottom: 12px;
}

#stats {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 6px 14px;
  min-width: 74px;
}

.stat span {
  font-size: 10px;
  letter-spacing: 2px;
  opacity: 0.7;
}

.stat strong {
  font-size: 20px;
  font-weight: 800;
}

#score { color: #7ef29a; }
#combo { color: #ffd166; }
#level { color: #7fb3ff; }
#best { color: #f8b4ff; }
#lives { color: #ff6b6b; letter-spacing: 2px; }

#question {
  text-align: center;
  margin-bottom: 14px;
}

.q-label {
  font-size: 12px;
  letter-spacing: 4px;
  opacity: 0.75;
  margin-bottom: 4px;
}

#country-name {
  font-size: 34px;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 3px 14px rgba(0, 0, 0, 0.6);
  min-height: 46px;
  margin-bottom: 10px;
}

#map-holder {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
  border: 2px solid rgba(255, 255, 255, 0.15);
  background: #8ecae6;
}

#map {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

#map-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 6;
}

#map-tools button {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(10, 20, 35, 0.78);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
}

#map-tools button:active {
  transform: scale(0.92);
}

#hint-btn {
  font-size: 20px;
}

#hint-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#msg {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 20px;
  font-weight: 900;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

#msg.show {
  opacity: 1;
  transform: translateY(0);
}

#msg.good { color: #7ef29a; }
#msg.bad { color: #ff6b6b; }

/* floating score text */
.float-text {
  position: absolute;
  font-weight: 900;
  font-size: 22px;
  color: #ffd166;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  animation: floatUp 1s ease-out forwards;
}

@keyframes floatUp {
  to {
    transform: translateY(-46px);
    opacity: 0;
  }
}

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 20, 0.85);
  backdrop-filter: blur(4px);
  z-index: 20;
}

#overlay.hidden {
  display: none;
}

.panel {
  text-align: center;
  background: linear-gradient(160deg, #24364a, #14202e);
  border: 2px solid #3d5a80;
  border-radius: 18px;
  padding: 30px 34px;
  max-width: 440px;
  width: 88%;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}

.panel h2 {
  font-size: 34px;
  margin-bottom: 10px;
  color: #ffd166;
}

#overlay.gameover .panel {
  border-color: #e63946;
}

#overlay.gameover h2 {
  color: #ff6b6b;
}

#overlay-sub {
  font-size: 15px;
  line-height: 1.6;
  opacity: 0.9;
  margin-bottom: 14px;
}

#overlay-score {
  font-size: 22px;
  font-weight: 800;
  color: #7ef29a;
  margin-bottom: 18px;
  min-height: 28px;
}

#start-btn {
  width: 100%;
  padding: 15px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #0b1420;
  background: linear-gradient(180deg, #ffd166, #ff9f43);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 6px 0 #b96a1e, 0 10px 20px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

#start-btn:active {
  transform: translateY(5px);
  box-shadow: 0 1px 0 #b96a1e;
}
