@font-face {
  font-family: 'Press Start 2P';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url('press-start-2p.woff2') format('woff2');
}

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

body {
  background: #0a0a0a;
  overflow: hidden;
  font-family: 'Press Start 2P', monospace;
  cursor: crosshair;
  -webkit-user-select: none;
  user-select: none;
}

canvas#game-canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hidden {
  display: none !important;
}

/* ========== START SCREEN ========== */
#start-screen {
  position: fixed;
  inset: 0;
  background: #0a0a0a;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#start-content {
  text-align: center;
}

#logo h1 {
  font-size: 48px;
  color: #ecf0f1;
  letter-spacing: 4px;
  margin-bottom: 8px;
  text-shadow: 4px 4px 0 #2c3e50;
}

#logo h1 .accent {
  color: #e74c3c;
}

.subtitle {
  font-size: 12px;
  color: #7f8c8d;
  letter-spacing: 6px;
  margin-bottom: 40px;
}

/* Pixel tank animation */
.pixel-tank {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  background: #3498db;
  position: relative;
  image-rendering: pixelated;
  animation: tank-bounce 1s ease-in-out infinite;
  box-shadow:
    /* Treads */
    -24px 8px 0 0 #555,
    -24px -8px 0 0 #555,
    24px 8px 0 0 #555,
    24px -8px 0 0 #555,
    /* Turret */
    0px -12px 0 0 #2980b9;
}

.pixel-tank::after {
  content: '';
  position: absolute;
  width: 48px;
  height: 12px;
  background: #2980b9;
  top: 50%;
  left: 60%;
  transform: translateY(-50%);
  box-shadow: 4px 0 0 0 #ecf0f1;
}

@keyframes tank-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

#name-form {
  margin: 30px 0;
}

#name-input {
  font-family: 'Press Start 2P', monospace;
  font-size: 14px;
  padding: 14px 20px;
  background: #1a1a2e;
  border: 3px solid #3498db;
  color: #ecf0f1;
  outline: none;
  width: 300px;
  text-align: center;
  display: block;
  margin: 0 auto 16px;
}

#name-input::placeholder {
  color: #555;
}

#name-input:focus {
  border-color: #e74c3c;
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.3);
}

#play-btn, #respawn-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 18px;
  padding: 16px 48px;
  background: #e74c3c;
  color: #ecf0f1;
  border: none;
  cursor: pointer;
  letter-spacing: 4px;
  transition: all 0.1s;
  text-shadow: 2px 2px 0 #c0392b;
}

#play-btn:hover, #respawn-btn:hover {
  background: #c0392b;
  transform: scale(1.05);
}

#play-btn:active, #respawn-btn:active {
  transform: scale(0.95);
}

/* Room Code UI */
#player-count {
  font-size: 9px;
  color: #7f8c8d;
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.online-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: #2ecc71;
  border-radius: 50%;
  animation: dotPulse 2s ease-in-out infinite;
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

#room-section {
  margin-top: 20px;
}

#room-options {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.room-or {
  font-size: 9px;
  color: #555;
}

.room-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  padding: 10px 16px;
  background: #1a1a2e;
  border: 2px solid #3498db;
  color: #3498db;
  cursor: pointer;
  transition: all 0.1s;
}

.room-btn:hover {
  background: #3498db;
  color: #0a0a0a;
}

.room-btn-small {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 4px 8px;
  background: #1a1a2e;
  border: 1px solid #3498db;
  color: #3498db;
  cursor: pointer;
  margin-left: 8px;
}

.room-btn-small:hover {
  background: #3498db;
  color: #0a0a0a;
}

#room-code-input {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 10px 14px;
  background: #1a1a2e;
  border: 2px solid #3498db;
  color: #ecf0f1;
  outline: none;
  width: 120px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 4px;
}

#room-code-input::placeholder {
  color: #555;
  letter-spacing: 2px;
  font-size: 9px;
}

#room-code-input:focus {
  border-color: #f39c12;
}

#room-settings {
  margin-top: 12px;
  display: flex;
  justify-content: center;
}

#bots-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 9px;
  color: #bdc3c7;
}

#bots-toggle input[type="checkbox"] {
  appearance: none;
  width: 16px;
  height: 16px;
  border: 2px solid #555;
  background: #1a1a2e;
  cursor: pointer;
  position: relative;
}

#bots-toggle input[type="checkbox"]:checked {
  border-color: #3498db;
  background: #3498db;
}

#bots-toggle input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  inset: 2px;
  background: #0a0a0a;
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

#room-code-display {
  margin-top: 12px;
  font-size: 10px;
  color: #ecf0f1;
}

#room-code-value {
  color: #f39c12;
  font-size: 16px;
  letter-spacing: 6px;
}

#controls-hint {
  font-size: 10px;
  color: #555;
  margin-top: 24px;
}

#controls-hint span {
  color: #e74c3c;
  font-size: 11px;
}

#branding {
  margin-top: 40px;
  font-size: 10px;
  color: #444;
}

#branding a {
  color: #f39c12;
  text-decoration: none;
}

#branding a:hover {
  text-decoration: underline;
}

#legal-links {
  margin-top: 12px;
  font-size: 8px;
}

#legal-links a {
  color: #555;
  text-decoration: none;
  margin: 0 8px;
}

#legal-links a:hover {
  color: #7f8c8d;
  text-decoration: underline;
}

/* ========== DEATH SCREEN ========== */
#death-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 10, 0.92);
  border: 3px solid #e74c3c;
  padding: 40px 60px;
  text-align: center;
  z-index: 50;
}

#death-screen h2 {
  font-size: 32px;
  color: #e74c3c;
  margin-bottom: 20px;
  text-shadow: 2px 2px 0 #000;
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.stat-row {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  font-size: 14px;
  color: #ecf0f1;
  margin: 8px 0;
}

#killed-by {
  margin-top: 16px;
  text-align: center;
}

.killed-by-label {
  font-size: 8px;
  color: #7f8c8d;
  display: block;
  margin-bottom: 4px;
}

#killer-name {
  font-size: 12px;
  color: #e74c3c;
}

#killer-health-bar {
  width: 120px;
  height: 8px;
  background: #333;
  margin: 8px auto 0;
  border: 1px solid #555;
}

#killer-health-fill {
  height: 100%;
  background: #2ecc71;
  transition: width 0.3s;
}

#death-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

#respawn-btn {
  font-size: 14px;
  padding: 12px 36px;
}

#share-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 12px 20px;
  background: #1a1a2e;
  border: 2px solid #3498db;
  color: #3498db;
  cursor: pointer;
  transition: all 0.1s;
}

#share-btn:hover {
  background: #3498db;
  color: #0a0a0a;
}

#spectate-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  padding: 12px 20px;
  background: #1a1a2e;
  border: 2px solid #9b59b6;
  color: #9b59b6;
  cursor: pointer;
  transition: all 0.1s;
}

#spectate-btn:hover {
  background: #9b59b6;
  color: #0a0a0a;
}

#spectate-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(10, 10, 10, 0.9);
  border-bottom: 2px solid #9b59b6;
  padding: 8px 16px;
  font-family: 'Press Start 2P', monospace;
  font-size: 9px;
  color: #9b59b6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 55;
}

#spectate-name {
  color: #ecf0f1;
}

#stop-spectate-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 7px;
  padding: 4px 10px;
  background: #1a1a2e;
  border: 1px solid #9b59b6;
  color: #9b59b6;
  cursor: pointer;
}

#stop-spectate-btn:hover {
  background: #9b59b6;
  color: #0a0a0a;
}

/* ========== UPGRADE SCREEN ========== */
#upgrade-screen {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.9);
  border: 2px solid #f39c12;
  padding: 16px 20px;
  z-index: 40;
  text-align: center;
}

#upgrade-screen h3 {
  font-size: 10px;
  color: #f39c12;
  margin-bottom: 12px;
}

#upgrade-options {
  display: flex;
  gap: 8px;
}

.upgrade-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 10px 12px;
  background: #1a1a2e;
  border: 2px solid #444;
  color: #ecf0f1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
  min-width: 80px;
}

.upgrade-btn:hover {
  border-color: #f39c12;
  background: #2a2a3e;
  transform: scale(1.05);
}

.upgrade-icon {
  font-size: 16px;
}

.upgrade-level {
  font-size: 7px;
  color: #7f8c8d;
}

/* ========== HUD ========== */
#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 30;
}

#health-bar-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 24px;
  background: #1a1a2e;
  border: 2px solid #555;
}

#health-bar {
  height: 100%;
  background: #e74c3c;
  transition: width 0.2s;
  width: 100%;
}

#health-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  color: #ecf0f1;
  text-shadow: 1px 1px 0 #000;
}

#xp-bar-container {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  height: 14px;
  background: #1a1a2e;
  border: 2px solid #555;
}

#xp-bar {
  height: 100%;
  background: #f39c12;
  transition: width 0.2s;
  width: 0%;
}

#xp-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 7px;
  color: #ecf0f1;
  text-shadow: 1px 1px 0 #000;
}

/* Leaderboard */
#leaderboard {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(10, 10, 10, 0.8);
  border: 2px solid #555;
  padding: 10px 14px;
  min-width: 200px;
}

#leaderboard h4 {
  font-size: 9px;
  color: #f39c12;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

#leaderboard-list {
  list-style: none;
  padding: 0;
}

#leaderboard-list li {
  font-size: 8px;
  color: #bdc3c7;
  padding: 3px 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#leaderboard-list li.me {
  color: #f39c12;
}

/* Kill Feed */
#kill-feed {
  position: absolute;
  top: 12px;
  left: 12px;
  max-width: 400px;
}

#kill-feed .kill-msg {
  font-size: 8px;
  color: #ecf0f1;
  background: rgba(10, 10, 10, 0.7);
  padding: 4px 8px;
  margin-bottom: 4px;
  border-left: 3px solid #e74c3c;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Kill streak messages */
.streak-msg {
  border-left-color: #f39c12 !important;
  color: #f39c12 !important;
  font-weight: bold;
}

/* Streak announcement overlay */
#streak-announce {
  position: fixed;
  top: 30%;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 24px;
  color: #f39c12;
  text-shadow: 3px 3px 0 #000, -1px -1px 0 #000;
  z-index: 45;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#streak-announce.streak-announce-show {
  opacity: 1;
  animation: streakPulse 0.5s ease-out;
}

@keyframes streakPulse {
  0% { transform: translateX(-50%) scale(1.5); opacity: 0; }
  50% { transform: translateX(-50%) scale(1.1); opacity: 1; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

/* Minimap */
#minimap {
  position: absolute;
  bottom: 80px;
  right: 12px;
  border: 2px solid #555;
  background: rgba(10, 10, 10, 0.8);
  image-rendering: pixelated;
}

/* Death Timer */
#death-timer-container {
  margin-top: 12px;
  font-size: 9px;
  color: #7f8c8d;
}

#death-timer {
  color: #e74c3c;
  font-size: 12px;
}

/* Notification Toast */
#notification {
  position: fixed;
  top: 40px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.95);
  border: 2px solid #e74c3c;
  padding: 14px 28px;
  font-family: 'Press Start 2P', monospace;
  font-size: 10px;
  color: #ecf0f1;
  z-index: 200;
  text-align: center;
  animation: slideDown 0.3s ease-out;
}

/* ========== CLASS SELECTION ========== */
#class-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 10, 0.95);
  border: 3px solid #9b59b6;
  padding: 24px 30px;
  text-align: center;
  z-index: 42;
}

#class-screen h3 {
  font-size: 12px;
  color: #9b59b6;
  margin-bottom: 16px;
  letter-spacing: 2px;
}

#class-options {
  display: flex;
  gap: 10px;
}

.class-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 14px 12px;
  background: #1a1a2e;
  border: 2px solid #555;
  color: #ecf0f1;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transition: all 0.1s;
  min-width: 90px;
}

.class-btn:hover {
  border-color: #9b59b6;
  background: #2a2a3e;
  transform: scale(1.05);
}

.class-icon {
  font-size: 20px;
}

.class-name {
  font-size: 9px;
  color: #9b59b6;
}

.class-desc {
  font-size: 6px;
  color: #7f8c8d;
}

/* ========== LEAVE CONFIRMATION ========== */
#leave-confirm {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 10, 0.95);
  border: 3px solid #e74c3c;
  padding: 30px 50px;
  text-align: center;
  z-index: 60;
}

#leave-confirm h3 {
  font-size: 18px;
  color: #e74c3c;
  margin-bottom: 12px;
}

#leave-confirm p {
  font-size: 9px;
  color: #7f8c8d;
  margin-bottom: 20px;
}

#leave-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.leave-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  padding: 12px 28px;
  border: 2px solid #e74c3c;
  background: #e74c3c;
  color: #ecf0f1;
  cursor: pointer;
  transition: all 0.1s;
}

.leave-btn:hover {
  background: #c0392b;
}

.leave-btn-cancel {
  background: #1a1a2e;
  border-color: #555;
  color: #bdc3c7;
}

.leave-btn-cancel:hover {
  border-color: #3498db;
  color: #3498db;
}

.leave-hint {
  margin-top: 16px;
  font-size: 7px;
  color: #555;
}

/* Match Timer */
#match-timer {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 12px;
  color: #ecf0f1;
  text-shadow: 2px 2px 0 #000;
  z-index: 31;
  pointer-events: none;
}

#match-timer.warning {
  color: #e74c3c;
  animation: timerPulse 1s ease-in-out infinite;
}

@keyframes timerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Match End Screen */
#match-end-screen {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(10, 10, 10, 0.95);
  border: 3px solid #f39c12;
  padding: 40px 60px;
  text-align: center;
  z-index: 55;
}

#match-end-screen h2 {
  font-size: 28px;
  color: #f39c12;
  margin-bottom: 16px;
  text-shadow: 2px 2px 0 #000;
}

#match-winner {
  font-size: 14px;
  color: #ecf0f1;
  margin-bottom: 12px;
}

.match-hint {
  font-size: 8px;
  color: #7f8c8d;
  margin-top: 16px;
}

.scoreboard-table {
  text-align: left;
  margin: 12px 0;
}

.scoreboard-row {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  font-size: 8px;
  color: #bdc3c7;
  border-bottom: 1px solid #1a1a2e;
}

.scoreboard-winner {
  color: #f39c12;
  font-size: 9px;
}

.sb-rank {
  width: 28px;
  color: #7f8c8d;
}

.scoreboard-winner .sb-rank {
  color: #f39c12;
}

.sb-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sb-stats {
  color: #7f8c8d;
  white-space: nowrap;
}

/* Mute Button */
#mute-btn {
  position: absolute;
  top: 32px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 6px 12px;
  background: rgba(10, 10, 10, 0.8);
  border: 2px solid #555;
  color: #bdc3c7;
  cursor: pointer;
  pointer-events: auto;
  z-index: 31;
}

#mute-btn:hover {
  border-color: #f39c12;
  color: #f39c12;
}

#autofire-btn {
  position: absolute;
  top: 56px;
  left: 50%;
  transform: translateX(-50%);
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 6px 12px;
  background: rgba(10, 10, 10, 0.8);
  border: 2px solid #555;
  color: #bdc3c7;
  cursor: pointer;
  pointer-events: auto;
  z-index: 31;
}

#autofire-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
}

#autofire-btn.active {
  border-color: #e74c3c;
  color: #e74c3c;
}

/* ========== AD SLOTS ========== */
.ad-slot {
  margin: 20px auto;
  text-align: center;
  overflow: hidden;
}

.ad-interstitial {
  margin: 16px auto;
  min-height: 50px;
}

/* In-game banner — top of screen, doesn't block gameplay */
#ad-game-banner {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 10, 10, 0.85);
  border-bottom: 2px solid #555;
  padding: 8px 40px 8px 16px;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateX(-50%) translateY(-100%); }
  to { transform: translateX(-50%) translateY(0); }
}

#ad-game-banner-slot {
  min-width: 320px;
  min-height: 50px;
  background: #1a1a2e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: #555;
}

#ad-dismiss-btn {
  position: absolute;
  top: 4px;
  right: 8px;
  background: none;
  border: none;
  color: #7f8c8d;
  font-size: 18px;
  cursor: pointer;
  pointer-events: auto;
  line-height: 1;
}

#ad-dismiss-btn:hover {
  color: #e74c3c;
}

#ad-countdown {
  font-size: 10px;
  color: #7f8c8d;
  margin-top: 10px;
}

#ad-countdown span {
  color: #e74c3c;
}

/* Rewarded Ad Button */
#ad-reward-btn {
  position: absolute;
  bottom: 74px;
  left: 12px;
  pointer-events: auto;
}

#watch-ad-btn {
  font-family: 'Press Start 2P', monospace;
  font-size: 8px;
  padding: 8px 14px;
  background: #1a1a2e;
  border: 2px solid #2ecc71;
  color: #2ecc71;
  cursor: pointer;
  transition: all 0.1s;
  animation: pulse 2s ease-in-out infinite;
}

#watch-ad-btn:hover {
  background: #2ecc71;
  color: #0a0a0a;
}

#watch-ad-btn:disabled {
  opacity: 0.5;
  cursor: default;
  animation: none;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4); }
  50% { box-shadow: 0 0 12px 4px rgba(46, 204, 113, 0.2); }
}

/* ========== MOBILE / RESPONSIVE ========== */
@media (max-width: 768px) {
  #logo h1 {
    font-size: 24px;
    letter-spacing: 2px;
  }

  .subtitle {
    font-size: 8px;
    letter-spacing: 3px;
    margin-bottom: 20px;
  }

  #name-input {
    width: 80vw;
    max-width: 300px;
    font-size: 12px;
    padding: 12px 16px;
  }

  #play-btn, #respawn-btn {
    font-size: 14px;
    padding: 14px 36px;
  }

  #room-options {
    flex-direction: column;
    gap: 8px;
  }

  .room-or { display: none; }

  #room-code-input {
    width: 80vw;
    max-width: 200px;
  }

  #controls-hint {
    font-size: 8px;
  }

  /* HUD adjustments */
  #health-bar-container {
    width: 60vw;
    max-width: 300px;
    bottom: 12px;
  }

  #xp-bar-container {
    width: 60vw;
    max-width: 300px;
    bottom: 40px;
  }

  #leaderboard {
    display: none;
  }

  #kill-feed {
    max-width: 200px;
  }

  #kill-feed .kill-msg {
    font-size: 6px;
    padding: 2px 6px;
  }

  #minimap {
    width: 80px !important;
    height: 80px !important;
    bottom: 60px;
  }

  #mute-btn, #autofire-btn {
    font-size: 7px;
    padding: 5px 8px;
  }

  #autofire-btn {
    top: 36px;
  }

  #upgrade-screen {
    bottom: 60px;
    padding: 10px 12px;
  }

  #upgrade-options {
    flex-wrap: wrap;
    justify-content: center;
  }

  .upgrade-btn {
    font-size: 7px;
    padding: 8px;
    min-width: 60px;
  }

  .upgrade-icon {
    font-size: 12px;
  }

  #death-screen {
    padding: 24px 30px;
  }

  #death-screen h2 {
    font-size: 20px;
  }

  .stat-row {
    font-size: 10px;
    gap: 20px;
  }

  #leave-confirm {
    padding: 20px 30px;
  }

  #leave-confirm h3 {
    font-size: 14px;
  }

  #ad-game-banner {
    padding: 6px 30px 6px 10px;
  }

  #ad-game-banner-slot {
    min-width: 200px;
    min-height: 40px;
  }

  #ad-reward-btn {
    bottom: 54px;
  }

  #class-screen {
    padding: 16px 14px;
  }

  #class-options {
    flex-wrap: wrap;
    justify-content: center;
  }

  .class-btn {
    min-width: 70px;
    padding: 10px 8px;
  }
}

/* Show/hide controls hints based on device */
.mobile-controls { display: none !important; }
.desktop-controls { display: block; }

@media (pointer: coarse) {
  .mobile-controls { display: block !important; }
  .desktop-controls { display: none !important; }
}

/* Touch-specific: prevent long-press menus, ensure tap targets */
@media (pointer: coarse) {
  body {
    cursor: default;
    -webkit-touch-callout: none;
  }

  button, .upgrade-btn, .room-btn {
    min-height: 44px;
  }
}
