* {
  box-sizing: border-box;
}

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

.game-layout {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 8px;
  padding: 8px;
  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 - 16px);
}

#mapObject {
  width: 100%;
  height: calc(100vh - 16px);
  max-height: 98vh;
  display: block;
  border: none;
  touch-action: manipulation;
}

@media (max-width: 900px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .map-panel {
    min-height: 70vh;
  }

  #mapObject {
    height: 72vh;
  }
}
