* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: #0a0a0a;
  touch-action: none;
  font-family: 'Space Grotesk', sans-serif;
  user-select: none;
  -webkit-user-select: none;
}
canvas {
  display: block;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
}
.screen {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.hidden { display: none !important; }

/* Fullscreen button */
#fullscreen-btn {
  position: fixed;
  top: 12px; right: 12px;
  z-index: 100;
  width: 40px; height: 40px;
  background: rgba(0,0,0,0.6);
  border: 2px solid #F1FAEE;
  color: #F1FAEE;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 0.2s;
}
#fullscreen-btn:hover { background: rgba(241,250,238,0.2); }

/* Menu */
#menu {
  background: rgba(10,10,10,0.85);
  flex-direction: column;
  gap: 20px;
}
.menu-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.title-line {
  font-size: clamp(28px, 8vw, 64px);
  font-weight: 900;
  letter-spacing: 6px;
  text-transform: uppercase;
  line-height: 1;
}
.menu-subtitle {
  font-size: clamp(10px, 2vw, 14px);
  color: #F1FAEE;
  letter-spacing: 8px;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: -8px;
}
.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}
.menu-btn {
  background: transparent;
  border: 2px solid #F1FAEE;
  color: #F1FAEE;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(14px, 2.5vw, 18px);
  font-weight: 700;
  padding: 12px 36px;
  cursor: pointer;
  letter-spacing: 4px;
  transition: all 0.15s;
  min-width: 240px;
  text-align: center;
}
.menu-btn:hover {
  background: #F1FAEE;
  color: #1D3557;
}
.menu-btn:active {
  transform: scale(0.96);
}
.menu-footer {
  color: #F1FAEE;
  font-size: 11px;
  opacity: 0.4;
  letter-spacing: 2px;
  margin-top: 8px;
}

/* HUD */
#hud {
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 14px 20px;
  z-index: 5;
  pointer-events: none;
}
.hud-left, .hud-right {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hud-label {
  font-size: 10px;
  letter-spacing: 3px;
  color: #F1FAEE;
  opacity: 0.5;
}
#score-display {
  font-size: 32px;
  font-weight: 900;
  color: #F4A261;
  line-height: 1;
}
#timer-display {
  font-size: 32px;
  font-weight: 900;
  color: #F1FAEE;
  line-height: 1;
}
#combo-display {
  font-size: 14px;
  font-weight: 700;
  color: #E63946;
  letter-spacing: 2px;
  margin-top: 4px;
  height: 20px;
}

/* Bird label popup */
#bird-label {
  position: fixed;
  z-index: 6;
  pointer-events: none;
  transform: translate(-50%, -50%);
  text-align: center;
}
#bird-label-text {
  font-size: 16px;
  font-weight: 700;
  color: #F1FAEE;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
  letter-spacing: 2px;
}
#bird-label-pts {
  font-size: 13px;
  font-weight: 400;
  color: #F4A261;
  text-shadow: 0 0 10px rgba(0,0,0,0.8);
}

/* Cable modal */
#cable-modal {
  background: rgba(10,10,10,0.9);
}
.cable-window {
  background: #1D3557;
  border: 3px solid #F1FAEE;
  padding: 30px;
  max-width: 480px;
  width: 90%;
  text-align: center;
}
.cable-tape {
  font-size: 12px;
  letter-spacing: 4px;
  color: #E63946;
  margin-bottom: 16px;
}
.cable-sender {
  font-size: 18px;
  font-weight: 700;
  color: #F4A261;
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.cable-message {
  font-size: 16px;
  color: #F1FAEE;
  line-height: 1.5;
  margin-bottom: 24px;
  font-style: italic;
}
.cable-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cable-choices .menu-btn {
  font-size: 13px;
  padding: 10px 20px;
  min-width: 200px;
}

/* Game Over */
#gameover {
  background: rgba(10,10,10,0.88);
}
.gameover-box {
  text-align: center;
  max-width: 500px;
  width: 90%;
}
.gameover-title {
  font-size: clamp(20px, 5vw, 36px);
  font-weight: 900;
  color: #F1FAEE;
  letter-spacing: 6px;
  margin-bottom: 20px;
}
.gameover-score {
  margin-bottom: 20px;
}
.go-label {
  display: block;
  font-size: 11px;
  letter-spacing: 4px;
  color: #F1FAEE;
  opacity: 0.5;
}
.go-value {
  font-size: 52px;
  font-weight: 900;
  color: #F4A261;
  line-height: 1;
}
.ending-text {
  font-size: 16px;
  color: #F1FAEE;
  line-height: 1.6;
  margin-bottom: 24px;
  font-style: italic;
  padding: 0 20px;
}
.gameover-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

/* Leaderboard */
#leaderboard-screen {
  background: rgba(10,10,10,0.88);
}
.lb-box {
  text-align: center;
  max-width: 400px;
  width: 90%;
}
.lb-title {
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
  color: #F4A261;
  letter-spacing: 6px;
  margin-bottom: 20px;
}
.lb-list {
  margin-bottom: 20px;
}
.lb-entry {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(241,250,238,0.1);
  color: #F1FAEE;
  font-size: 15px;
  letter-spacing: 1px;
}
.lb-entry.highlight {
  color: #F4A261;
  font-weight: 700;
}
.lb-rank { width: 30px; text-align: left; }
.lb-name { flex: 1; text-align: left; }
.lb-score { width: 80px; text-align: right; }

/* Tutorial */
#tutorial-screen {
  background: rgba(10,10,10,0.88);
}
.tut-box {
  text-align: center;
  max-width: 500px;
  width: 90%;
}
.tut-title {
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
  color: #457B9D;
  letter-spacing: 6px;
  margin-bottom: 20px;
}
.tut-content {
  text-align: left;
  margin-bottom: 24px;
}
.tut-step {
  color: #F1FAEE;
  font-size: 15px;
  padding: 8px 0;
  line-height: 1.5;
  border-bottom: 1px solid rgba(241,250,238,0.08);
}

/* Name entry */
#name-entry {
  background: rgba(10,10,10,0.88);
}
.name-box {
  text-align: center;
  max-width: 360px;
  width: 90%;
}
.name-title {
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 900;
  color: #F4A261;
  letter-spacing: 6px;
  margin-bottom: 12px;
}
.name-prompt {
  font-size: 13px;
  color: #F1FAEE;
  opacity: 0.6;
  letter-spacing: 3px;
  margin-bottom: 16px;
}
.name-input {
  background: transparent;
  border: 2px solid #F1FAEE;
  color: #F1FAEE;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 8px;
  width: 140px;
  padding: 8px;
  margin-bottom: 20px;
  text-transform: uppercase;
  outline: none;
}
.name-input:focus {
  border-color: #F4A261;
}

/* Mobile Controls */
#mobile-controls {
  position: fixed;
  bottom: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 4;
  pointer-events: none;
}
