:root {
  --charcoal: #1a1a2e;
  --midnight: #16213e;
  --blood: #e63946;
  --gold: #f4a261;
  --cream: #edf2f4;
  --green-cash: #2ecc71;
  --purple-mafia: #2d1b4e;
  --burgundy: #6b2737;
  --team-blue: #1e3a5f;
  --team-green: #264d3b;
}

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

body {
  background: var(--charcoal);
  color: var(--cream);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--charcoal); }
::-webkit-scrollbar-thumb { background: var(--blood); border-radius: 3px; }

/* Newspaper clipping modal */
@keyframes slideIn {
  from { transform: translateY(-40px) rotate(-2deg); opacity: 0; }
  to { transform: translateY(0) rotate(0deg); opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

@keyframes cashPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

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

.animate-slide-in { animation: slideIn 0.4s ease-out; }
.animate-pulse-heat { animation: pulse 1.2s ease-in-out infinite; }
.animate-cash-pop { animation: cashPop 0.3s ease-out; }
.animate-fade-in { animation: fadeIn 0.3s ease-out; }

.newspaper-bg {
  background: linear-gradient(135deg, #f5f0e1 0%, #e8dcc8 50%, #f5f0e1 100%);
  color: #1a1a1a;
}

.paper-texture {
  background: linear-gradient(135deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%);
  border: 1px solid rgba(255,255,255,0.08);
}

.tab-active {
  border-bottom: 3px solid var(--gold);
  background: rgba(255,255,255,0.08);
}

.typewriter-btn {
  font-family: 'Special Elite', cursive;
  background: linear-gradient(180deg, #4a4a4a 0%, #2a2a2a 50%, #1a1a1a 100%);
  border: 2px solid #666;
  border-radius: 6px;
  box-shadow: 0 4px 0 #111, 0 6px 10px rgba(0,0,0,0.4);
  transition: all 0.15s ease-out;
  text-transform: uppercase;
  letter-spacing: 2px;
  transform: translateY(0);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
}
@media (hover: hover) {
  .typewriter-btn:hover { transform: translateY(1px); box-shadow: 0 3px 0 #111, 0 4px 8px rgba(0,0,0,0.4); }
}
.typewriter-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 #111, 0 2px 6px rgba(0,0,0,0.4); }

/* Reset all buttons on touch to prevent stuck states */
button {
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  cursor: pointer;
  outline: none;
}

button:focus {
  outline: none;
}

button:focus:not(:focus-visible) {
  outline: none;
  box-shadow: inherit;
  transform: none;
}

/* Only apply hover styles on devices that support hover */
@media (hover: hover) {
  button:hover {
    transition: all 0.15s ease-out;
  }
}

/* On touch devices, don't persist hover styles */
@media (hover: none) {
  button:hover {
    background-color: inherit;
    border-color: inherit;
  }
  button:active {
    transition: all 0.05s ease-out;
  }
}

.heat-bar {
  transition: width 0.5s ease, background-color 0.5s ease;
}

.game-over-bg {
  background: radial-gradient(ellipse at center, rgba(230,57,70,0.2) 0%, rgba(26,26,46,0.95) 70%);
}

/* NYC Map styles */
.territory-zone {
  transition: all 0.3s ease;
  cursor: pointer;
}
.territory-zone:hover {
  filter: brightness(1.3);
}

.gang-icon {
  image-rendering: pixelated;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .hud-bar { flex-wrap: wrap; gap: 4px; }
  .tab-bar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
}