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

body {
  background: #0f1117;
  font-family: 'Segoe UI', sans-serif;
  color: #e8e8e8;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.screen { display: none; width: 100%; height: 100vh; align-items: center; justify-content: center; }
.screen.active { display: flex; }

.cs-box {
  background: #16181f;
  border: 1px solid #2a3550;
  border-radius: 20px;
  padding: 2.5rem 3rem;
  text-align: center;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}

.cs-box h1 { font-size: 2rem; color: #fff; margin-bottom: .4rem; }
.cs-sub { color: #8a96aa; margin-bottom: 1.8rem; font-size: 1rem; }

.char-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 2rem;
}

.char-card {
  background: #1e2130;
  border: 2px solid #2a3550;
  border-radius: 14px;
  padding: 1.2rem .8rem;
  cursor: pointer;
  transition: border-color .2s, transform .15s;
}
.char-card:hover { border-color: #4a90e2; transform: translateY(-2px); }
.char-card.selected { border-color: #2a6dd9; background: #1a2540; }

.char-emoji { font-size: 2.8rem; margin-bottom: .4rem; }
.char-name { font-size: .85rem; color: #b0b8c8; font-weight: 600; }

button {
  background: #2a6dd9;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: .8rem 2.2rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}
button:hover { background: #3a7de9; }

.back-link { color: #4a90e2; text-decoration: none; font-size: .85rem; }
.back-link:hover { text-decoration: underline; }

.go-btns { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.go-btns button { flex: 1; min-width: 130px; }

#game-screen { flex-direction: column; background: #0f1117; }

#hud {
  width: 100%;
  max-width: 600px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: .6rem 1rem;
}

.hud-back { color: #4a90e2; text-decoration: none; font-size: .9rem; font-weight: 600; }
#score-display { font-size: 1.1rem; font-weight: 700; color: #fff; }

#game-canvas {
  border-radius: 12px;
  border: 2px solid #2a3550;
  display: block;
}

#mobile-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  margin-top: .8rem;
}
.mb-row { display: flex; gap: .3rem; }
.mb-btn {
  width: 54px;
  height: 54px;
  font-size: 1.2rem;
  padding: 0;
  border-radius: 10px;
  background: #1e2130;
  border: 1px solid #2a3550;
}
.mb-btn:hover { background: #2a3550; }
