* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: #f2f2f2;
  color: #111;
}

.game-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 12px;
  padding: 10px;
  min-height: 100vh;
}

.sidebar {
  background: #ffffff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  overflow-y: auto;
}

.sidebar h1 { font-size: 26px; margin: 0 0 14px; }
.sidebar h2 { font-size: 20px; margin: 14px 0 8px; }
.sidebar p, .sidebar li { font-size: 16px; line-height: 1.35; }

.palette {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 10px;
  flex-wrap: wrap;
}

.color-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px solid #111;
  cursor: pointer;
  background: white;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.color-btn.selected {
  outline: 5px solid #111;
  outline-offset: 3px;
}

.eraser-btn { background: #ffffff !important; }

.eraser-icon {
  width: 28px;
  height: 16px;
  display: inline-block;
  background: linear-gradient(135deg, #ff8fa3 0 48%, #f5f5f5 48% 100%);
  border: 2px solid #111;
  border-radius: 4px;
  transform: rotate(-18deg);
  box-shadow: inset 10px 0 0 rgba(255,255,255,.25);
}

.selected-color { margin-top: 6px; }

hr { border: none; border-top: 1px solid #ddd; margin: 18px 0; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; }

.actions button {
  border: none;
  border-radius: 7px;
  background: #333;
  color: #fff;
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
}

.actions button:hover { background: #111; }

.ok { color: green; font-weight: bold; }
.error { color: #d32f2f; font-weight: bold; }
.warning { color: #b26a00; font-weight: bold; }

.map-panel {
  background: #e3f2fd;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  min-height: calc(100vh - 20px);
}

#mapSvg {
  width: 100%;
  height: calc(100vh - 20px);
  max-height: 96vh;
  display: block;
  touch-action: manipulation;
}

.country {
  fill: #f7f7f7;
  stroke: #222;
  stroke-width: 1.1;
  cursor: pointer;
  transition: fill .12s ease, stroke-width .12s ease;
  outline: none;
}

.country:hover, .country.hovered {
  stroke: #000;
  stroke-width: 2.6;
}

.country.conflict {
  stroke: #d32f2f;
  stroke-width: 3.2;
}

.country-label {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
  pointer-events: auto;
  cursor: pointer;
  fill: #111;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
  user-select: none;
}

.label-line {
  stroke: #111;
  stroke-width: 1;
  pointer-events: none;
}

@media (max-width: 900px) {
  .game-layout { grid-template-columns: 1fr; }
  .map-panel { min-height: 70vh; }
  #mapSvg { height: 72vh; }
}
