* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #dfe6e9;
  color: #222;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 10px 20px;
  background: #2c3e50;
  color: #fff;
}
.topbar h1 { font-size: 1.2rem; margin: 0; white-space: nowrap; }
.turn-label { font-weight: bold; font-size: 1.1rem; background: #fff; padding: 4px 12px; border-radius: 6px; white-space: nowrap; }
.btn--small { width: auto; padding: 6px 12px; font-size: 0.82rem; flex-shrink: 0; margin-left: auto; }

.layout {
  display: flex;
  height: calc(100vh - 52px);
}

.board-wrapper {
  position: relative;
  flex: 1;
  overflow: hidden;
}
#board { display: block; width: 100%; height: 100%; cursor: pointer; }

.sidebar {
  width: 260px;
  background: #f7f9fa;
  border-left: 1px solid #ccc;
  padding: 16px;
  overflow-y: auto;
}
.sidebar h2 { font-size: 0.95rem; margin: 18px 0 6px; color: #555; }

.resources-label { font-weight: bold; margin-bottom: 10px; }

.btn {
  display: inline-block;
  padding: 8px 14px;
  background: #2c3e50;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.9rem;
  width: 100%;
}
.btn:hover { background: #1a252f; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--secondary { background: #95a5a6; }
.btn--secondary:hover { background: #7f8c8d; }

.log-list, .help-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.82rem;
  line-height: 1.4;
}
.log-list li { padding: 3px 0; border-bottom: 1px solid #e6e6e6; }
.help-list li { padding: 3px 0; color: #555; }

.build-menu {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 10px;
  padding: 16px;
  gap: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
  z-index: 10;
}
.build-option {
  width: auto;
  min-width: 90px;
  text-align: center;
}

.winner-banner {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #f5c542;
  color: #222;
  padding: 16px 28px;
  border-radius: 10px;
  font-weight: bold;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  z-index: 10;
}
.winner-banner .btn { width: auto; }

.help-cycle {
  font-size: 0.8rem;
  color: #444;
  line-height: 1.5;
  margin: 0;
}

/* Écran de menu */
.menu-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #2c3e50, #4a6278);
  padding: 20px;
}
.menu-screen[hidden], .game-screen[hidden] { display: none; }
.menu-box {
  background: #fff;
  border-radius: 14px;
  padding: 32px 36px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}
.menu-box h1 { margin: 0 0 4px; color: #2c3e50; }
.menu-subtitle { margin: 0 0 20px; color: #666; font-size: 0.9rem; }
.menu-box h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: #888; margin: 20px 0 10px; }

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.choice-btn {
  padding: 12px 10px;
  background: #f0f2f5;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  text-align: center;
  line-height: 1.4;
}
.choice-btn:hover { background: #e4e8ec; }
.choice-btn small { color: #777; font-weight: normal; }
.choice-btn.selected { border-color: #2c3e50; background: #e8edf1; }

.btn--start { margin-top: 24px; background: #27ae60; }
.btn--start:hover { background: #1e8449; }
.btn--start:disabled { background: #95a5a6; }
