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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#root {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}

/*
 * 9:16 mobile frame — fills height, constrains width to 9/16 of height.
 * On a real phone WebView this collapses to 100vw × 100vh because the
 * WebView itself is already 9:16.
 */
.app {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: calc(100vh * 9 / 16);   /* enforce 9:16 */
  max-height: 100vh;
  overflow: hidden;
  /*
   * transform trick: causes all position:fixed descendants to be
   * relative to this container instead of the viewport, keeping
   * every overlay inside the 9:16 frame.
   */
  transform: translate(0);
}

.block-party-container {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.game-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 100;
}

.game-overlay > * {
  pointer-events: auto;
}

.phase-banner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 3rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 20px rgba(0, 210, 255, 0.8);
  animation: phaseFadeIn 0.5s ease-out, phaseFadeOut 0.5s ease-in 2.5s;
  pointer-events: none;
  z-index: 200;
}

@keyframes phaseFadeIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes phaseFadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.hud-overlay {
  position: absolute;
  top: calc(10px + var(--sat, 0px));
  left: 10px;
  right: 10px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 100;
}

.timer-display {
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(0, 210, 255, 0.4);
  border-radius: 8px;
  padding: 8px 16px;
  color: #fff;
  font-size: 1.4rem;
  font-weight: bold;
  text-align: center;
}

.timer-display.warning {
  border-color: #ff4444;
  color: #ff4444;
  animation: timerPulse 1s infinite;
}

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

.role-badge {
  background: rgba(0, 0, 0, 0.8);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.role-badge.engineer {
  color: #00ccff;
  border: 1px solid #00ccff;
}

.role-badge.glitch {
  color: #ff3333;
  border: 1px solid #ff3333;
}

.crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  pointer-events: none;
  z-index: 150;
}

.crosshair::before,
.crosshair::after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.6);
}

.crosshair::before {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 100%;
}

.crosshair::after {
  top: 50%;
  left: 0;
  transform: translateY(-50%);
  width: 100%;
  height: 2px;
}
