body {
  margin: 0;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: #ffffff;
  background: #000000;
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.game-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px;
}

.exit-button {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  border-radius: 2px;
  transition: all 0.2s ease;
  z-index: 10;
  line-height: 1;
}

.exit-button:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.exit-button:active {
  transform: scale(0.9);
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  margin-bottom: 8px;
  margin-left: 32px;
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.stats {
  display: flex;
  gap: 12px;
}

.stats span {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.controls {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  margin-bottom: 8px;
  margin-left: 32px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}

.control-group label {
  color: rgba(255, 255, 255, 0.8);
  min-width: 50px;
  font-weight: 500;
}

.control-group input[type="range"] {
  flex: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.control-group input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-group input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #ffffff;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.control-group span {
  color: #ffffff;
  min-width: 40px;
  text-align: right;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.game-area {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  width: 100%;
  max-width: 375px;
  height: auto;
  max-height: 812px;
  background: #2a2a2a;
  border: 2px solid #808080;
  border-radius: 12px;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  border-radius: 12px;
}

.overlay.hidden {
  display: none;
}

.start-screen {
  text-align: center;
  color: #ffffff;
  max-width: 360px;
}

.start-screen h1 {
  margin: 0 0 8px;
  font-size: 48px;
  font-weight: 300;
  letter-spacing: 0.1em;
}

.start-screen .subtitle {
  margin: 0 0 24px;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 300;
}

.start-screen .instructions {
  margin: 0 0 32px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
}

.start-screen button {
  appearance: none;
  border: none;
  cursor: pointer;
  background: #808080;
  color: #000000;
  padding: 16px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  width: 100%;
  transition: all 0.2s ease;
}

.start-screen button:hover {
  background: #a0a0a0;
  transform: translateY(-1px);
}

.start-screen button:active {
  transform: translateY(0);
}

/* iPhone 13 Pro Max optimizations */
@media (min-width: 375px) {
  .game-container {
    max-width: 375px;
    margin: 0 auto;
  }
  
  #gameCanvas {
    width: 375px;
    height: 812px;
  }
}
