﻿*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
.skip-link {
  position: absolute; top: 12px; left: 12px; z-index: 1000;
  padding: 10px 16px; border-radius: 999px; background: #fff; color: #111;
  font-size: 14px; font-weight: 600; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transform: translateY(-160%); transition: transform 0.2s ease;
}
.skip-link:focus, .skip-link:focus-visible { transform: translateY(0); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
:focus { outline: none; }
.dino-page :focus-visible { outline: 2px solid #535353; outline-offset: 3px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: ui-monospace, monospace; font-size: 13px; color: #535353;
  padding: 10px 16px; border: 1px solid rgba(83, 83, 83, 0.25);
  border-radius: 999px; text-decoration: none;
  background: rgba(255, 255, 255, 0.65); transition: color 0.2s ease, background 0.2s ease;
}
.back-link:hover { color: #212121; background: #fff; }
.dino-page {
  min-height: 100vh;
  background: #f7f7f7;
  color: #535353;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.dino-header {
  width: 100%;
  max-width: 720px;
  padding: 24px 20px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}
.dino-page .back-link {
  color: #535353;
  border-color: rgba(83, 83, 83, 0.25);
  background: rgba(255, 255, 255, 0.65);
}
.dino-page .back-link:hover {
  color: #212121;
  background: #fff;
}
.dino-hint {
  font-size: 13px;
  color: #6e6e6e;
  font-family: var(--font-mono);
}
.dino-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px 40px;
  width: 100%;
}
.dino-stage canvas {
  max-width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* ── Mobile touch controls ─────────────────────────────────── */
/* Hidden by default; JS adds .touch-device to <body> on any touch-capable device */
.touch-controls {
  display: none;
}

.touch-device .touch-controls {
  display: block;
}

.ctrl-btn {
  position: fixed;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(60, 60, 60, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  z-index: 200;
  cursor: move;
  transition: background 0.15s ease, transform 0.1s ease;
}

.ctrl-btn:active {
  background: rgba(83, 83, 83, 0.95);
  transform: scale(0.93);
}

.ctrl-btn svg {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.ctrl-label {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  opacity: 0.75;
  line-height: 1;
}

/* Default positions — jump upper-right, duck lower-right */
#ctrl-jump {
  right: 24px;
  bottom: 136px;
}

#ctrl-duck {
  right: 24px;
  bottom: 52px;
}
