html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #5e8e3e;
  color: #2b2b2b;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  font-family: "Courier New", Courier, monospace;
}

body {
  position: fixed;
  inset: 0;
}

#game-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  background: #5e8e3e;
  display: grid;
  place-items: center;
}

#game-canvas {
  width: 100vw;
  height: 100vh;
  display: block;
  cursor: crosshair;
  image-rendering: auto;
}

#hud-overlay {
  position: fixed;
  top: max(10px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: min(940px, calc(100vw - 24px));
  z-index: 2;
  pointer-events: none;
}

.flight-board {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  background: linear-gradient(180deg, #fff4d3 0%, #f5e9c9 52%, #deca96 100%);
  border: 2px solid rgba(43, 43, 43, 0.9);
  box-shadow: 0 5px 0 rgba(43, 43, 43, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  border-radius: 4px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-group {
  display: flex;
  align-items: baseline;
  gap: 9px;
  white-space: nowrap;
}

.board-label {
  font-size: clamp(11px, 1.8vw, 18px);
  font-weight: 900;
  opacity: 0.82;
}

.board-value {
  font-size: clamp(18px, 4.4vw, 38px);
  font-weight: 900;
  line-height: 1;
  color: #2b2b2b;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.55);
}

#controls {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  gap: 10px;
  z-index: 4;
}

.control-button {
  min-width: 48px;
  height: 44px;
  border-radius: 4px;
  border: 2px solid rgba(43, 43, 43, 0.9);
  background: linear-gradient(180deg, #fff4d3, #d8bf82);
  color: #2b2b2b;
  font: 900 18px/1 "Courier New", Courier, monospace;
  box-shadow: 0 4px 0 rgba(43, 43, 43, 0.23);
  cursor: pointer;
  touch-action: manipulation;
}

.control-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(43, 43, 43, 0.23);
}

#help-card,
#game-over-card {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 36px));
  padding: 22px;
  z-index: 5;
  border: 3px solid rgba(43, 43, 43, 0.92);
  border-radius: 5px;
  background: linear-gradient(180deg, #fff4d3 0%, #f5e9c9 60%, #dcc58c 100%);
  box-shadow: 0 12px 0 rgba(43, 43, 43, 0.22), 0 18px 28px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  text-align: center;
}

.card-hidden {
  display: none;
}

.card-title {
  margin: 0 0 10px;
  font: 900 clamp(26px, 8vw, 48px)/0.95 "Courier New", Courier, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card-copy {
  margin: 8px auto 16px;
  max-width: 440px;
  font: 700 14px/1.45 Georgia, serif;
}

.card-stats {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 14px 0;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.primary-button {
  border: 2px solid #2b2b2b;
  background: #d9342b;
  color: #fff4d3;
  padding: 12px 20px;
  border-radius: 4px;
  font: 900 17px/1 "Courier New", Courier, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(43, 43, 43, 0.24);
}

.primary-button:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 rgba(43, 43, 43, 0.24);
}

#privacy-note {
  position: fixed;
  left: max(12px, env(safe-area-inset-left));
  bottom: max(12px, env(safe-area-inset-bottom));
  z-index: 3;
  color: rgba(245, 233, 201, 0.85);
  font: 700 11px/1.2 "Courier New", Courier, monospace;
  text-shadow: 1px 1px 0 rgba(43, 43, 43, 0.45);
  pointer-events: none;
}

@media (orientation: portrait) and (max-width: 760px) {
  #landscape-hint {
    display: inline;
  }

  .flight-board {
    padding: 8px;
    gap: 6px;
  }
}

@media (orientation: landscape) {
  #landscape-hint {
    display: none;
  }
}
