:root {
  --bg-deep: #0b1f1a;
  --bg-soft: #163a32;
  --accent: #f6c453;
  --accent-strong: #ffb627;
  --good: #69d27d;
  --bad: #ff6b6b;
  --text: #f5f3e8;
  --text-dim: #c8c5b3;
  --panel: rgba(8, 24, 20, 0.78);
  --panel-strong: rgba(8, 24, 20, 0.92);
  --eyepiece-radius: clamp(86px, 13vmin, 150px);
  --magnify: 4.2;
  --bird-size: clamp(22px, 3vmin, 44px);
  --scope-x: 50%;
  --scope-y: 45%;
  --tutorial-scope-x: 24%;
  --tutorial-scope-y: 58%;
  --tutorial-eyepiece-radius: clamp(70px, 10vmin, 110px);
  --tutorial-magnify: 3.5;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: radial-gradient(ellipse at top, #1a3a32 0%, #061311 100%);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

body {
  height: 100vh;
  height: 100dvh;
  display: flex;
}

.app {
  position: relative;
  flex: 1;
  height: 100vh;
  height: 100dvh;
  display: flex;
  overflow: hidden;
}

.screen {
  position: relative;
  flex: 1;
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.screen.is-active {
  display: flex;
}

/* ============== SPLASH ============== */
.screen-splash {
  align-items: stretch;
  justify-content: flex-end;
  overflow: hidden;
  background: #061311;
}

.splash-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  filter: brightness(1) saturate(1.05);
  z-index: 0;
}

.splash-bottom-bar {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: clamp(14px, 3.5vmin, 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.6vmin, 20px);
  background: linear-gradient(180deg, rgba(6, 19, 17, 0) 0%, rgba(6, 19, 17, 0.35) 22%, rgba(6, 19, 17, 0.82) 100%);
}

.splash-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  order: 2;
}

.install-prompt {
  width: min(100%, 560px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(8, 24, 20, 0.9), rgba(6, 19, 17, 0.98));
  border: 1px solid rgba(246, 196, 83, 0.22);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
  text-align: left;
  order: 3;
}

.install-prompt-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.install-prompt-kicker {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.install-prompt-copy strong {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.install-prompt-copy p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.74rem;
  line-height: 1.35;
}

.install-prompt-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.install-prompt-install {
  min-width: 120px;
  padding: 10px 14px;
  font-size: 0.86rem;
}

.install-prompt-dismiss {
  padding: 10px 14px;
  font-size: 0.86rem;
}

.mode-selector {
  display: flex;
  gap: 6px;
  padding: 5px;
  border-radius: 18px;
  background: rgba(6, 19, 17, 0.64);
  border: 1px solid rgba(246, 196, 83, 0.2);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
}

.mode-button,
.mode-option {
  min-width: clamp(124px, 18vw, 168px);
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 9px 12px;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 120ms ease;
}

.mode-button span,
.mode-option span {
  display: block;
  color: inherit;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.mode-button small {
  display: block;
  margin-top: 2px;
  color: currentColor;
  font-size: 0.66rem;
  font-weight: 700;
  line-height: 1.15;
  opacity: 0.76;
}

.mode-button strong,
.mode-option strong {
  display: block;
  margin-top: 3px;
  color: currentColor;
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.25;
}

.mode-button:hover,
.mode-option:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.mode-button.is-selected,
.mode-option.is-active {
  color: #1a1306;
  background:
    radial-gradient(circle at 18% 16%, rgba(255, 255, 255, 0.34), transparent 35%),
    linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: rgba(255, 233, 164, 0.86);
  box-shadow: 0 10px 24px rgba(246, 196, 83, 0.25);
}

.leaderboard-panel {
  color: var(--text);
  text-align: left;
}

.leaderboard-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.leaderboard-heading h2 {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.leaderboard-heading span {
  color: var(--text-dim);
  font-size: 0.7rem;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.leaderboard-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.leaderboard-entry {
  min-height: 38px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.065);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.leaderboard-rank {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(246, 196, 83, 0.15);
  color: var(--accent);
  font-weight: 800;
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
}

.leaderboard-detail {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.leaderboard-detail strong,
.leaderboard-detail small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leaderboard-detail strong {
  color: var(--text);
  font-size: 0.8rem;
  font-weight: 760;
}

.leaderboard-detail small {
  color: var(--text-dim);
  font-size: 0.68rem;
}

.leaderboard-score {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.leaderboard-status {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 0.76rem;
  text-align: center;
}

.leaderboard-status[hidden] { display: none; }
.splash-best {
  order: 4;
  margin: 0;
  font-size: 0.95rem;
  color: var(--accent);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
  min-height: 1.2em;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.score-records {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.score-record {
  min-width: 126px;
  padding: 7px 11px;
  display: inline-grid;
  gap: 1px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(6, 19, 17, 0.62);
  color: var(--text-dim);
  text-align: center;
  text-shadow: none;
}

.score-record strong {
  color: var(--text);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.record-mode {
  color: var(--accent);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.score-record span:last-child {
  font-size: 0.72rem;
}

.score-record.is-selected {
  border-color: rgba(246, 196, 83, 0.72);
  box-shadow: 0 0 0 1px rgba(246, 196, 83, 0.2), 0 10px 24px rgba(0, 0, 0, 0.22);
}

/* ============== TUTORIAL ============== */
.screen-tutorial {
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  background:
    radial-gradient(ellipse at top, rgba(246, 196, 83, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, #07211c 0%, #061311 100%);
  padding: clamp(16px, 4vmin, 40px);
}

.tutorial-card {
  background: var(--panel-strong);
  border: 1px solid rgba(246, 196, 83, 0.25);
  border-radius: 24px;
  padding: clamp(24px, 4vmin, 40px);
  max-width: 560px;
  width: 100%;
  max-height: calc(100dvh - clamp(16px, 4vmin, 40px) * 2);
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
}

.visual-tutorial {
  max-width: min(920px, calc(100vw - 32px));
}

.tutorial-card h2 {
  margin: 0 0 18px;
  font-size: clamp(1.4rem, 2.6vmin, 1.9rem);
  color: var(--accent);
  letter-spacing: 0.5px;
}

.tutorial-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.tutorial-steps li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: flex-start;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
}

.tutorial-steps strong { color: var(--accent); }

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1a1306;
  font-weight: 800;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.tutorial-actions {
  margin-top: 26px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.tutorial-demo {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 16 / 7;
  min-height: 220px;
  background: #0a1f1b;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.tutorial-demo.is-dragging { cursor: grabbing; }

.tutorial-demo-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.82) saturate(1.05);
}

.tutorial-demo-bird {
  position: absolute;
  left: 56%;
  top: 55%;
  width: clamp(34px, 4.8vmin, 56px);
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.45));
  pointer-events: none;
  z-index: 2;
}

.tutorial-demo-scope {
  position: absolute;
  left: var(--tutorial-scope-x);
  top: var(--tutorial-scope-y);
  width: calc(var(--tutorial-eyepiece-radius) * 2);
  height: calc(var(--tutorial-eyepiece-radius) * 2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.92),
    0 0 0 12px rgba(15, 12, 9, 0.96),
    0 0 0 17px rgba(80, 69, 50, 0.9),
    0 0 0 20px rgba(246, 196, 83, 0.36),
    0 0 90px 34px rgba(0, 0, 0, 0.58) inset,
    0 30px 60px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  cursor: grab;
  touch-action: none;
  transition: box-shadow 220ms ease, transform 180ms ease;
  z-index: 5;
}

.tutorial-demo.is-dragging .tutorial-demo-scope { cursor: grabbing; }

.tutorial-demo.is-on-target .tutorial-demo-scope {
  transform: translate(-50%, -50%);
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.92),
    0 0 0 12px rgba(15, 12, 9, 0.96),
    0 0 0 17px rgba(80, 69, 50, 0.9),
    0 0 0 21px rgba(246, 196, 83, 0.68),
    0 0 80px 28px rgba(0, 0, 0, 0.4) inset,
    0 0 60px rgba(246, 196, 83, 0.4);
}

.tutorial-magnified-clip {
  position: absolute;
  inset: 0;
  clip-path: circle(var(--tutorial-eyepiece-radius) at var(--tutorial-scope-x) var(--tutorial-scope-y));
  -webkit-clip-path: circle(var(--tutorial-eyepiece-radius) at var(--tutorial-scope-x) var(--tutorial-scope-y));
  pointer-events: none;
  will-change: clip-path;
  filter: saturate(1.15) contrast(1.08);
  z-index: 3;
}

.tutorial-magnified-clip::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--tutorial-scope-x) var(--tutorial-scope-y), rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 28%, rgba(0, 0, 0, 0.35) 72%, rgba(0, 0, 0, 0.65) 100%),
    repeating-radial-gradient(circle at var(--tutorial-scope-x) var(--tutorial-scope-y), rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 9px);
  pointer-events: none;
  mix-blend-mode: screen;
}

.tutorial-magnified-zoom {
  position: absolute;
  inset: 0;
  transform: scale(var(--tutorial-magnify));
  transform-origin: var(--tutorial-scope-x) var(--tutorial-scope-y);
  will-change: transform;
}

.tutorial-magnified-zoom .tutorial-demo-bird {
  width: var(--bird-size);
}

.tutorial-demo-tool {
  position: absolute;
  right: 0;
  bottom: -6%;
  width: clamp(190px, 30vmin, 320px);
  filter: drop-shadow(0 12px 28px rgba(0, 0, 0, 0.6));
  pointer-events: none;
  z-index: 4;
}

.tutorial-cues {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.tutorial-cue {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  font-size: 0.9rem;
}

.tutorial-cue .icon { color: var(--accent); }

.tutorial-demo-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.demo-button {
  min-height: 42px;
  color: var(--accent);
  border-color: rgba(246, 196, 83, 0.6);
}

.demo-button.is-highlighted:not(.is-found) {
  color: #1a1306;
  border-color: rgba(255, 216, 117, 0.95);
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.34), transparent 35%),
    linear-gradient(135deg, #ffe08a, var(--accent-strong));
  box-shadow: 0 12px 28px rgba(246, 196, 83, 0.32);
  transform: translateY(-1px);
}

.demo-button.is-found {
  color: #07211c;
  background: linear-gradient(135deg, var(--good), #a2f0b0);
  border-color: rgba(105, 210, 125, 0.75);
}

.demo-button.dim {
  color: var(--text-dim);
  opacity: 0.55;
  pointer-events: none;
}

/* ============== BUTTONS ============== */
.primary-action,
.ghost-action,
.bird-button,
.mode-button,
.zoom-button {
  font: inherit;
  border-radius: 999px;
  cursor: pointer;
  border: none;
  transition: transform 120ms ease, box-shadow 200ms ease, background 200ms ease, color 200ms ease, opacity 200ms ease, border-color 200ms ease;
  -webkit-tap-highlight-color: transparent;
}

.icon {
  width: 1.1em;
  height: 1.1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-action {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #1a1306;
  font-weight: 700;
  padding: 14px 28px;
  font-size: 1.05rem;
  box-shadow: 0 12px 30px rgba(246, 196, 83, 0.35);
  letter-spacing: 0.4px;
}
.primary-action:hover { transform: translateY(-2px); }
.primary-action:active { transform: translateY(0); }

.primary-action:disabled,
.primary-action.is-disabled {
  cursor: not-allowed;
  opacity: 0.56;
  filter: saturate(0.55);
  box-shadow: none;
}

.primary-action:disabled:hover,
.primary-action.is-disabled:hover {
  transform: none;
}

.ghost-action {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 12px 22px;
  font-size: 0.95rem;
}
.ghost-action:hover { background: rgba(255, 255, 255, 0.16); }

/* ============== INTRO VIDEO ============== */
.screen-intro {
  align-items: center;
  justify-content: center;
  background: #061311;
  overflow: hidden;
}

.intro-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.intro-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, transparent 0%, rgba(0, 0, 0, 0.22) 62%, rgba(0, 0, 0, 0.5) 100%),
    linear-gradient(180deg, rgba(6, 19, 17, 0.05) 0%, rgba(6, 19, 17, 0.38) 100%);
  pointer-events: none;
}

.intro-skip {
  position: absolute;
  right: clamp(14px, 3vmin, 34px);
  bottom: clamp(14px, 3vmin, 34px);
  z-index: 2;
  background: rgba(0, 0, 0, 0.48);
}

/* ============== GAME ============== */
.screen-game {
  background: linear-gradient(180deg, #07211c 0%, #051210 100%);
  padding: 0;
}

.orientation-guard {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 5vmin, 40px);
  background:
    radial-gradient(circle at top, rgba(246, 196, 83, 0.14) 0%, transparent 48%),
    linear-gradient(180deg, rgba(6, 19, 17, 0.42) 0%, rgba(6, 19, 17, 0.88) 100%);
  backdrop-filter: blur(14px);
}

.global-orientation-lock {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(18px, 5vmin, 40px);
  background:
    radial-gradient(circle at top, rgba(246, 196, 83, 0.14) 0%, transparent 48%),
    linear-gradient(180deg, rgba(6, 19, 17, 0.42) 0%, rgba(6, 19, 17, 0.88) 100%);
  backdrop-filter: blur(14px);
}

.orientation-guard-card {
  position: relative;
  overflow: hidden;
  width: min(100%, 380px);
  padding: clamp(24px, 5vmin, 34px);
  border-radius: 28px;
  border: 1px solid rgba(246, 196, 83, 0.26);
  background: linear-gradient(180deg, rgba(13, 36, 31, 0.96) 0%, rgba(7, 24, 20, 0.94) 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  text-align: center;
  color: var(--text);
  animation: orientation-card-rise 520ms ease-out both;
}

.orientation-guard-card::before,
.orientation-guard-card::after {
  content: '';
  position: absolute;
  left: -28px;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 26 13'><path d='M1 10 Q6.5 4 13 7 Q19.5 4 25 10' fill='none' stroke='%23f6c453' stroke-opacity='.3' stroke-width='2' stroke-linecap='round'/></svg>") no-repeat center / contain;
  pointer-events: none;
  animation: guard-bird-fly 9s linear infinite;
}
.orientation-guard-card::before { top: 18px; width: 26px; height: 13px; animation-delay: 1s; }
.orientation-guard-card::after  { top: 34px; width: 19px; height: 10px; opacity: 0.65; animation-delay: 5.5s; }

.orientation-guard-icon {
  width: 92px;
  height: 92px;
  margin: 0 auto 20px;
  display: block;
  color: var(--accent);
  overflow: visible;
}

.orientation-guard-icon rect,
.orientation-guard-icon path,
.orientation-guard-icon line {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rotation-arc-group path {
  stroke-width: 2.5;
  opacity: 0.5;
}

.orientation-phone {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: orientation-rotate-phone 4s ease-in-out infinite;
}

.orientation-guard-card h2 {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 3.2vmin, 1.7rem);
  color: var(--accent);
}

.orientation-guard-card p {
  margin: 0;
  color: var(--text-dim);
  line-height: 1.5;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px clamp(14px, 3vmin, 28px);
  background: var(--panel);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.title-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.brand-title {
  margin: 0;
  font-size: clamp(1rem, 2.2vmin, 1.4rem);
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
}
.brand-title span { color: var(--text-dim); margin: 0 4px; }

.mode-pill {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(246, 196, 83, 0.28);
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}

.hud {
  display: flex;
  gap: 10px;
  align-items: center;
}

.game-quit-button {
  padding: 9px 14px;
  min-height: 40px;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.06);
}

.game-quit-button:hover {
  color: var(--text);
  border-color: rgba(255, 107, 107, 0.42);
  background: rgba(255, 107, 107, 0.12);
}

.scope-tools {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.zoom-button {
  min-width: 58px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 10px;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.zoom-button .icon { width: 1em; height: 1em; }

.zoom-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.zoom-button.is-active {
  color: #1a1306;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  box-shadow: 0 8px 20px rgba(246, 196, 83, 0.2);
}

.analog-timer {
  position: relative;
  width: clamp(58px, 8vmin, 78px);
  height: clamp(58px, 8vmin, 78px);
  color: var(--accent);
  --timer-progress: 1;
  --timer-hand-angle: 0deg;
}

.timer-dial {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.42));
}

.timer-track {
  fill: rgba(255, 255, 255, 0.06);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 8;
}

.timer-progress {
  fill: none;
  stroke: currentColor;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: calc((1 - var(--timer-progress)) * 100);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 220ms linear, color 220ms ease;
}

.timer-hand {
  stroke: currentColor;
  stroke-width: 4;
  stroke-linecap: round;
  transform: rotate(var(--timer-hand-angle));
  transform-origin: 50% 50%;
  transition: transform 220ms linear;
}

.timer-pin { fill: var(--text); }

.analog-timer strong {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text);
  font-size: clamp(0.9rem, 2.1vmin, 1.2rem);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.55);
}

.analog-timer.is-warn {
  color: var(--bad);
  animation: urgent-pulse 650ms ease-in-out infinite alternate;
}

.analog-timer.is-expert:not(.is-warn) {
  color: var(--accent-strong);
}

@keyframes urgent-pulse {
  from { transform: scale(1); }
  to { transform: scale(1.07); }
}

.hud-meter {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 64px;
}
.hud-meter span {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
}
.hud-meter strong {
  font-size: 1.15rem;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.hud-meter.is-warn strong { color: var(--bad); }

/* Playfield */
.playfield {
  flex: 1;
  display: flex;
  padding: clamp(8px, 1.4vmin, 16px);
  min-height: 0;
  overflow: hidden;
}

.marsh-stage {
  position: relative;
  flex: 1;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  cursor: grab;
  user-select: none;
  touch-action: none;
  background: #0a1f1b;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

.marsh-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--scope-x) var(--scope-y), transparent 0%, transparent 18%, rgba(0, 0, 0, 0.18) 34%, rgba(0, 0, 0, 0.4) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.16));
  pointer-events: none;
  mix-blend-mode: multiply;
  z-index: 2;
}

.marsh-stage.is-dragging { cursor: grabbing; }

.marsh-content {
  position: absolute;
  inset: 0;
}

.marsh-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.bird-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.distant-fog {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(7, 22, 19, 0) 0%, rgba(7, 22, 19, 0.18) 65%, rgba(7, 22, 19, 0.4) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, transparent 30%);
  pointer-events: none;
  mix-blend-mode: multiply;
}

.distant .marsh-bird {
  width: var(--bird-size);
  filter: brightness(0.85) contrast(0.95) saturate(0.85);
  opacity: 0.92;
}

.magnified-clip {
  position: absolute;
  inset: 0;
  clip-path: circle(var(--eyepiece-radius) at var(--scope-x) var(--scope-y));
  -webkit-clip-path: circle(var(--eyepiece-radius) at var(--scope-x) var(--scope-y));
  pointer-events: none;
  will-change: clip-path;
  filter: saturate(1.15) contrast(1.08);
  z-index: 3;
}

.magnified-clip::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at var(--scope-x) var(--scope-y), rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.03) 28%, rgba(0, 0, 0, 0.35) 72%, rgba(0, 0, 0, 0.65) 100%),
    repeating-radial-gradient(circle at var(--scope-x) var(--scope-y), rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 9px);
  pointer-events: none;
  mix-blend-mode: screen;
}

.magnified-zoom {
  position: absolute;
  inset: 0;
  transform: scale(var(--magnify));
  transform-origin: var(--scope-x) var(--scope-y);
  will-change: transform;
}

.magnified-zoom .marsh-bird {
  width: var(--bird-size);
}

.marsh-bird {
  position: absolute;
  left: var(--bx);
  top: var(--by);
  transform: translate(-50%, -50%) scale(var(--bs, 1)) scaleX(var(--flip, 1));
  transform-origin: center;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  transition: opacity 400ms ease, transform 400ms ease;
}

.marsh-bird.is-found {
  opacity: 0;
  transform: translate(-50%, -50%) scale(calc(var(--bs, 1) * 0.5)) scaleX(var(--flip, 1));
}

.marsh-bird.is-missed {
  opacity: 1;
  z-index: 7;
  border: 3px solid rgba(255, 224, 138, 0.98);
  border-radius: 999px;
  padding: 3px;
  background: rgba(6, 19, 17, 0.34);
  filter: drop-shadow(0 0 8px rgba(255, 182, 39, 0.95)) drop-shadow(0 0 18px rgba(0, 0, 0, 0.65));
}

.marsh-stage.is-revealing-misses {
  cursor: default;
}

.marsh-stage.is-revealing-misses .eyepiece {
  opacity: 0.72;
}

/* Eyepiece */
.eyepiece {
  position: absolute;
  left: var(--scope-x);
  top: var(--scope-y);
  width: calc(var(--eyepiece-radius) * 2);
  height: calc(var(--eyepiece-radius) * 2);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.92),
    0 0 0 12px rgba(15, 12, 9, 0.96),
    0 0 0 17px rgba(80, 69, 50, 0.9),
    0 0 0 20px rgba(246, 196, 83, 0.36),
    0 0 90px 34px rgba(0, 0, 0, 0.58) inset,
    0 30px 60px rgba(0, 0, 0, 0.6);
  transition: box-shadow 220ms ease;
  z-index: 5;
}

.eyepiece::before,
.eyepiece::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.eyepiece::before {
  box-shadow:
    inset 16px 18px 28px rgba(255, 255, 255, 0.08),
    inset -26px -28px 42px rgba(0, 0, 0, 0.58);
}

.eyepiece::after {
  inset: 10%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(circle at 36% 30%, rgba(255, 255, 255, 0.12), transparent 30%);
  mix-blend-mode: screen;
}

.marsh-stage.is-dragging .eyepiece {
  transform: translate(-50%, -50%) scale(0.985);
}

.eyepiece.is-on-target {
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.92),
    0 0 0 12px rgba(15, 12, 9, 0.96),
    0 0 0 17px rgba(80, 69, 50, 0.9),
    0 0 0 21px rgba(246, 196, 83, 0.68),
    0 0 80px 28px rgba(0, 0, 0, 0.4) inset,
    0 0 60px rgba(246, 196, 83, 0.4);
}

.eyepiece-glare {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 20%, rgba(255, 255, 255, 0) 36%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 42%);
  pointer-events: none;
}

.scope-decoration {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: clamp(340px, 42vmin, 620px);
  height: auto;
  pointer-events: none;
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.55));
  opacity: 0.95;
  z-index: 4;
  user-select: none;
}

.scope-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.3px;
  pointer-events: none;
  transition: opacity 300ms ease;
  z-index: 6;
}
.scope-hint.is-hidden { opacity: 0; }

.feedback {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  pointer-events: none;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  z-index: 6;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.feedback.is-good { color: var(--good); }
.feedback.is-bad { color: var(--bad); }
.feedback.is-visible { opacity: 1; transform: translateX(-50%) translateY(4px); }

/* Controls */
.controls-panel {
  background: var(--panel);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px clamp(14px, 3vmin, 28px) 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.controls-actions {
  display: none;
  gap: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.bird-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.bird-button {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.035)),
    rgba(7, 31, 26, 0.78);
  border: 1px solid rgba(246, 196, 83, 0.16);
  color: var(--text);
  padding: 10px 14px;
  font-size: 0.85rem;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.2;
  min-height: 60px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 8px 18px rgba(0, 0, 0, 0.16);
}

.bird-button::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(246, 196, 83, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(246, 196, 83, 0.18), transparent 18%);
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.bird-button > span { position: relative; z-index: 1; }
.bird-button > span:first-child { min-width: 0; }

.bird-button:hover {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.05)),
    rgba(10, 42, 35, 0.9);
  border-color: rgba(246, 196, 83, 0.36);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

.bird-button:hover::before { opacity: 1; }
.bird-button:active { transform: translateY(1px); }

.bird-button.is-just-found {
  animation: bird-found-pop 380ms ease-out 1;
}

.bird-button.is-found {
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(105, 210, 125, 0.28), rgba(105, 210, 125, 0.12)),
    rgba(7, 31, 26, 0.82);
  border-color: rgba(105, 210, 125, 0.6);
  color: var(--good);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09), 0 0 0 1px rgba(105, 210, 125, 0.16), 0 10px 24px rgba(0, 0, 0, 0.22);
}

.bird-button .check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--good);
  color: #07211c;
  font-size: 0.7rem;
  font-weight: 800;
  margin-left: auto;
}

.bird-button:not(.is-found) .check { display: none; }

/* Result */
.screen-result {
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(180deg, rgba(246, 196, 83, 0.08) 0%, rgba(246, 196, 83, 0) 38%),
    linear-gradient(180deg, #08241f 0%, #061311 100%);
  padding: clamp(16px, 4vmin, 40px);
  overflow-y: auto;
}

.result-card {
  background:
    linear-gradient(180deg, rgba(16, 52, 44, 0.97), rgba(7, 24, 20, 0.97));
  border: 1px solid rgba(246, 196, 83, 0.26);
  border-radius: 20px;
  padding: clamp(22px, 3.4vmin, 34px);
  max-width: 680px;
  width: 100%;
  text-align: center;
  box-shadow: 0 28px 74px rgba(0, 0, 0, 0.52), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  animation: result-card-rise 480ms ease-out both;
}

.result-card h2 {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 2.7vmin, 2rem);
  color: var(--accent);
  line-height: 1.12;
}

.result-stats {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.5;
  margin: 0 0 8px;
}
.result-best {
  font-size: 0.95rem;
  color: var(--accent);
  margin: 0 0 18px;
  min-height: 1.2em;
}

.result-current-record {
  display: block;
  margin-bottom: 10px;
}

.result-best .score-records.compact .score-record {
  min-width: 118px;
  padding: 6px 10px;
}

.result-compare,
.result-progress {
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.45;
  font-size: 0.95rem;
}

.result-progress {
  color: var(--text-dim);
}

.result-support {
  margin: 0 0 18px;
  padding: 11px 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.45;
}

.result-support a {
  color: #ffe08a;
  font-weight: 800;
  text-decoration-color: rgba(255, 224, 138, 0.62);
  text-underline-offset: 3px;
}

.result-support a:hover {
  color: #fff4c4;
  text-decoration-color: currentColor;
}

.leaderboard-name-form {
  margin: 0 0 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.9fr);
  align-items: center;
  gap: 14px;
  border-radius: 16px;
  border: 1px solid rgba(246, 196, 83, 0.34);
  background:
    linear-gradient(135deg, rgba(246, 196, 83, 0.13), rgba(255, 255, 255, 0.04)),
    rgba(6, 19, 17, 0.42);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.leaderboard-name-form[hidden] { display: none; }

.leaderboard-name-copy {
  display: grid;
  gap: 3px;
}

.leaderboard-name-kicker {
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.9px;
  text-transform: uppercase;
}

.leaderboard-name-copy label {
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 850;
  line-height: 1.2;
}

.leaderboard-name-copy p,
.leaderboard-name-status {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.35;
}

.leaderboard-name-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.leaderboard-name-controls input {
  width: 100%;
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.94);
  color: #10231f;
  font: inherit;
  font-size: 0.95rem;
  padding: 10px 12px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.leaderboard-name-controls input:focus {
  border-color: rgba(246, 196, 83, 0.9);
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.22), inset 0 1px 2px rgba(0, 0, 0, 0.12);
}

.leaderboard-name-controls .primary-action {
  min-height: 46px;
  padding: 10px 16px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.leaderboard-name-status {
  grid-column: 1 / -1;
  min-height: 1.2em;
}

.leaderboard-name-form.is-saved {
  border-color: rgba(105, 210, 125, 0.48);
}

.leaderboard-name-form.is-saved .leaderboard-name-status {
  color: var(--good);
}

.result-leaderboard {
  margin: 0 0 18px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(6, 19, 17, 0.38);
}

.result-leaderboard .leaderboard-heading {
  margin-bottom: 10px;
}

.result-leaderboard .leaderboard-list {
  gap: 7px;
}

.result-leaderboard .leaderboard-entry {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035)),
    rgba(10, 42, 35, 0.6);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.eyepiece.is-confirmed {
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.92),
    0 0 0 12px rgba(15, 12, 9, 0.96),
    0 0 0 18px rgba(105, 210, 125, 0.75),
    0 0 0 22px rgba(246, 196, 83, 0.42),
    0 0 110px 36px rgba(105, 210, 125, 0.18) inset,
    0 30px 60px rgba(0, 0, 0, 0.6);
}

.analog-timer.is-tick .timer-progress,
.analog-timer.is-tick .timer-hand {
  transition-duration: 120ms;
}

.analog-timer.is-tick strong {
  animation: timer-pop 160ms ease-out 1;
}

.hud-meter.is-bump strong {
  animation: hud-bump 240ms ease-out 1;
}

.hud-meter.is-soft-penalty strong {
  animation: hud-soft-penalty 300ms ease-out 1;
}

@keyframes bird-found-pop {
  0% { transform: translateY(0) scale(1); }
  55% { transform: translateY(-3px) scale(1.04); }
  100% { transform: translateY(0) scale(1); }
}

@keyframes timer-pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes hud-bump {
  0% { transform: translateY(0); }
  45% { transform: translateY(-2px); }
  100% { transform: translateY(0); }
}

@keyframes hud-soft-penalty {
  0% { transform: translateY(0); }
  50% { transform: translateY(1px); }
  100% { transform: translateY(0); }
}

@keyframes result-card-rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes orientation-card-rise {
  from { transform: translateY(12px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes orientation-rotate-phone {
  0%, 14%   { transform: rotate(0deg); }
  44%, 66%  { transform: rotate(-90deg); }
  86%, 100% { transform: rotate(0deg); }
}

@keyframes guard-bird-fly {
  0%   { transform: translate(0px, 0px);     opacity: 0; }
  5%   { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translate(430px, -14px); opacity: 0; }
}

/* Compact mobile landscape */
@media (max-height: 480px) {
  :root {
    --eyepiece-radius: clamp(56px, 12vmin, 90px);
    --magnify: 3.0;
    --bird-size: clamp(16px, 2.4vmin, 28px);
    --tutorial-eyepiece-radius: 52px;
  }
  .top-bar { padding: 6px 12px; gap: 8px; }
  .title-lockup { gap: 6px; }
  .brand-title { font-size: 0.85rem; }
  .mode-pill { padding: 3px 7px; font-size: 0.6rem; }
  .splash-bottom-bar {
    gap: 4px;
    padding: 6px 10px;
    background: linear-gradient(180deg, rgba(6, 19, 17, 0.5) 0%, rgba(6, 19, 17, 0.9) 6%, rgba(6, 19, 17, 0.97) 100%);
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
  }
  .mode-selector { gap: 4px; padding: 4px; }
  .mode-button { min-width: 94px; padding: 6px 9px; font-size: 0.68rem; }
  .mode-button small { font-size: 0.58rem; }
  .mode-button strong,
  .mode-option strong { font-size: 0.68rem; }
  .primary-action { padding: 9px 20px; font-size: 0.85rem; }
  .splash-actions { gap: 6px; order: 1; }
  .install-prompt {
    order: 2;
    width: 100%;
    padding: 5px 8px;
    gap: 6px;
    border-radius: 12px;
  }
  .install-prompt-copy strong { font-size: 0.72rem; }
  .install-prompt-copy p { font-size: 0.6rem; line-height: 1.2; }
  .install-prompt-install,
  .install-prompt-dismiss { min-width: 0; padding: 5px 9px; font-size: 0.62rem; }
  .install-prompt-kicker { font-size: 0.55rem; }
  .splash-best { order: 3; width: 100%; font-size: 0.72rem; gap: 4px; }
  .leaderboard-entry { min-height: 32px; padding: 5px 7px; }
  .leaderboard-detail strong { font-size: 0.72rem; }
  .leaderboard-detail small { display: none; }
  .leaderboard-score { font-size: 0.82rem; }
  .score-record { min-width: 108px; padding: 5px 8px; }
  .score-record strong { font-size: 0.94rem; }
  .game-quit-button { padding: 6px 10px; min-height: 34px; font-size: 0.72rem; }
  .scope-tools { gap: 3px; padding: 3px; }
  .zoom-button { min-width: 44px; min-height: 34px; padding: 6px 7px; font-size: 0.68rem; }
  .zoom-button .icon { display: none; }
  .analog-timer { width: 50px; height: 50px; }
  .analog-timer strong { font-size: 0.82rem; }
  .hud-meter { padding: 2px 8px; min-width: 50px; }
  .hud-meter span { font-size: 0.6rem; }
  .hud-meter strong { font-size: 0.95rem; }
  .screen-tutorial { padding: 8px; }
  .tutorial-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto auto;
    column-gap: 12px;
    padding: 12px;
    border-radius: 16px;
    max-height: calc(100dvh - 16px);
  }
  .tutorial-card h2 {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 6px;
    font-size: 1.1rem;
  }
  .tutorial-demo {
    grid-column: 1;
    grid-row: 1 / -1;
    aspect-ratio: auto;
    min-height: 0;
    border-radius: 12px;
    align-self: stretch;
  }
  .tutorial-demo-scope { width: 104px; height: 104px; }
  .tutorial-demo-tool { width: 170px; }
  .tutorial-cues {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: 1fr;
    gap: 4px;
    margin-top: 0;
  }
  .tutorial-cue { min-height: 30px; padding: 5px 8px; font-size: 0.74rem; }
  .tutorial-demo-buttons {
    grid-column: 2;
    grid-row: 3;
    gap: 6px;
    margin-top: 6px;
  }
  .demo-button { min-height: 34px; }
  .tutorial-actions {
    grid-column: 2;
    grid-row: 4;
    margin-top: 8px;
  }
  .controls-panel { padding: 6px 10px 8px; gap: 6px; }
  .controls-actions { gap: 6px; }
  .ghost-action { padding: 6px 12px; font-size: 0.8rem; }
  .bird-button { padding: 6px 8px; font-size: 0.75rem; }
  .bird-buttons { gap: 4px; }
  .scope-decoration { width: clamp(220px, 28vmin, 380px); }
}

/* Portrait/narrow fallback */
@media (orientation: portrait) and (pointer: coarse) {
  .global-orientation-lock {
    display: flex;
  }

  .app {
    pointer-events: none;
    user-select: none;
  }

  .orientation-guard {
    display: flex;
  }
}

@media (max-width: 720px) and (orientation: portrait) {
  :root {
    --eyepiece-radius: clamp(70px, 22vmin, 130px);
    --magnify: 3.0;
    --bird-size: clamp(20px, 4.4vmin, 36px);
  }
  .top-bar { padding: 10px 12px; }
  .hud { gap: 6px; }
  .scope-tools { order: 2; width: 100%; justify-content: center; }
  .install-prompt {
    width: min(100%, 360px);
    flex-direction: column;
    align-items: stretch;
  }
  .install-prompt-actions {
    justify-content: flex-start;
  }
  .install-prompt-install,
  .install-prompt-dismiss {
    width: 100%;
  }
  .hud-meter { padding: 4px 10px; min-width: 54px; }
  .hud-meter strong { font-size: 1rem; }
  .brand-title { font-size: 0.95rem; letter-spacing: 0.5px; }
  .mode-selector { width: min(100%, 360px); }
  .mode-option { min-width: 0; flex: 1; }
  .controls-panel { padding: 10px 12px 14px; }
  .bird-buttons { grid-template-columns: repeat(2, 1fr); }
}
