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

:root {
  --bg-dark: #e8eef2;
  --bg-card: #ffffff;
  --accent: #d62828;
  --accent-dim: #b71c1c;
  --gold: #e07c24;
  --text: #1a1d21;
  --text-muted: #5a6268;
  --border: #c5d0d9;
  --shadow: rgba(0, 0, 0, 0.08);
}

body {
  font-family: "Outfit", sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

/* Screens */
.screen {
  display: none;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 900px;
  animation: fadeIn 0.3s ease;
}

#screen-game {
  max-width: 100%;
  padding-left: 1rem;
  padding-right: 1rem;
}

.screen.active {
  display: flex;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.title {
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(2.2rem, 6vw, 3.5rem);
  letter-spacing: 0.08em;
  color: var(--gold);
  text-shadow: 0 1px 2px var(--shadow);
  margin-bottom: 0.25rem;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
}

/* Continent grid */
.choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  width: 100%;
}

.continent-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  cursor: pointer;
  text-align: center;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.continent-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(214, 40, 40, 0.2);
}

.continent-card .icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  display: block;
}

.continent-card .name {
  font-weight: 600;
  font-size: 1rem;
}

/* Country selection */
.country-actions {
  width: 100%;
  margin-bottom: 1rem;
}

#country-search {
  width: 100%;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  color: var(--text);
}

#country-search::placeholder {
  color: var(--text-muted);
}

#country-search:focus {
  outline: none;
  border-color: var(--accent);
}

.country-list {
  width: 100%;
  max-height: 60vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.country-chip {
  padding: 0.6rem 0.9rem;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  text-align: center;
  transition: border-color 0.2s, background 0.2s;
}

.country-chip:hover {
  border-color: var(--accent);
  background: rgba(214, 40, 40, 0.08);
}

.btn-back {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-muted);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.9rem;
}

.btn-back:hover {
  border-color: var(--text);
  color: var(--text);
  background: var(--bg-card);
}

/* Game screen */
#screen-game .game-ui {
  width: 100%;
  max-width: 1400px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.game-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.player-badge {
  background: var(--accent);
  color: white;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.95rem;
}

.countdown {
  font-family: "Bebas Neue", sans-serif;
  font-size: 2.5rem;
  color: var(--gold);
  min-width: 3rem;
  text-align: center;
}

.countdown.locked {
  color: var(--accent);
}

.countdown-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.player-weapon-wrap {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.player-weapon-wrap strong {
  color: var(--gold);
}

.hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.hint kbd {
  display: inline-block;
  padding: 0.15rem 0.4rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--text);
}

.alive-wrap {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.alive-wrap strong {
  color: var(--accent);
}

#game-canvas {
  display: block;
  background: #2d6b36;
  border: 3px solid var(--border);
  border-radius: 8px;
  max-width: 100%;
  width: 100%;
  min-width: 800px;
  min-height: 400px;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 4px 16px var(--shadow);
}
