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

:root {
  --bg: #1a1f1a;
  --surface: #252b25;
  --surface2: #2e362e;
  --accent: #6db36d;
  --accent2: #4a8f4a;
  --text: #e8ede8;
  --text2: #a0afa0;
  --danger: #c0392b;
  --radius: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


#map {
  flex: 1;
  z-index: 1;
}

.leaflet-container {
  background: #2a3a2a;
}

/* Markerit */
.place-marker {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  cursor: pointer;
  transition: transform 0.15s;
}

.place-marker:active {
  transform: scale(1.2);
}

.marker-playground { background: #2980b9; }
.marker-dog_park { background: #8e44ad; }
.marker-historic { background: #c0392b; }
.marker-special { background: #d35400; }
.marker-visited { background: #3d3d3d; opacity: 0.6; }

/* Bottom sheet */
.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  z-index: 2000;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 70dvh;
  overflow-y: auto;
}

.sheet.open {
  transform: translateY(0);
}

.sheet.hidden {
  display: none;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  margin: 12px auto 0;
}

.sheet-content {
  padding: 16px 20px 32px;
}

.sheet-category {
  font-size: 28px;
  margin-bottom: 6px;
}

.sheet-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  line-height: 1.2;
}

.sheet-content p {
  color: var(--text2);
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.sheet-fact {
  background: var(--surface2);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 20px;
}

.fact-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

.sheet-fact p {
  margin: 0;
  font-size: 14px;
}

.sheet-actions {
  display: flex;
  gap: 10px;
}

.btn-primary {
  flex: 1;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-primary:active {
  background: var(--accent2);
}

.btn-primary.visited {
  background: var(--surface2);
  color: var(--text2);
}

.btn-secondary {
  background: var(--surface2);
  color: var(--text2);
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 16px;
  cursor: pointer;
}

/* Locate & Sound buttons */
.locate-btn {
  position: fixed;
  right: 16px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  z-index: 1500;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.locate-btn, .explore-mode-btn {
  transition: transform 0.1s, filter 0.1s;
}
.locate-btn.pressed, .locate-btn:active,
.explore-mode-btn.pressed, .explore-mode-btn:active {
  transform: scale(0.85);
  filter: brightness(1.5);
}

#locate-btn       { bottom: 80px; }
#settings-btn     { bottom: 132px; }
#map-camera-btn   { bottom: 184px; }

#map-camera-btn.camera-disabled {
  opacity: 0.4;
  filter: grayscale(1);
}

.film-load-overlay {
  position: fixed; inset: 0;
  z-index: 4500;
  background: rgba(0,0,0,0.85);
  display: flex; align-items: center; justify-content: center;
}
.film-load-overlay.hidden { display: none; }
.film-load-content {
  display: flex; flex-direction: column;
  align-items: center; gap: 20px;
}
.film-load-emoji {
  font-size: 56px;
  animation: film-emoji-spin 1.5s linear;
}
@keyframes film-emoji-spin {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}
.film-load-bar {
  width: 200px; height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px; overflow: hidden;
}
.film-load-progress {
  height: 100%; width: 0%;
  background: #4f4;
  border-radius: 3px;
  animation: film-progress 1.5s linear forwards;
}
@keyframes film-progress {
  from { width: 0%; }
  to   { width: 100%; }
}
.film-load-text {
  color: rgba(255,255,255,0.8);
  font-size: 15px; letter-spacing: 1px;
}

.nearby-search-spin {
  font-size: 56px;
  animation: nearby-spin 1.2s ease-in-out infinite;
}
@keyframes nearby-spin {
  0%   { transform: scale(1) rotate(-10deg); }
  50%  { transform: scale(1.15) rotate(10deg); }
  100% { transform: scale(1) rotate(-10deg); }
}
.nearby-load-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  animation: nearby-indeterminate 1.4s ease-in-out infinite;
}
@keyframes nearby-indeterminate {
  0%   { width: 0%; margin-left: 0%; }
  50%  { width: 60%; margin-left: 20%; }
  100% { width: 0%; margin-left: 100%; }
}

.score-panel {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: 12px;
  z-index: 2200;
  background: rgba(20, 26, 20, 0.72);
  color: #e8ede8;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.7;
  pointer-events: auto;
  cursor: pointer;
}
.score-row { display: block; }

.explore-mode-btn {
  position: fixed;
  left: 16px;
  bottom: 100px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--surface2);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  font-size: 20px;
  cursor: pointer;
  z-index: 1500;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}


/* Toast */
.toast {
  position: fixed;
  top: max(20px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  border-radius: 20px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  z-index: 4100;
  white-space: nowrap;
  animation: fadeInOut 2.5s ease forwards;
}

.toast.hidden {
  display: none;
}

@keyframes fadeInOut {
  0% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  15% { opacity: 1; transform: translateX(-50%) translateY(0); }
  75% { opacity: 1; }
  100% { opacity: 0; }
}

/* Kompassi */
.compass {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(30, 38, 30, 0.82);
  border: 1px solid var(--surface2);
  border-radius: 60px;
  padding: 6px 32px 14px;
  z-index: 1500;
  box-shadow: 0 2px 16px rgba(0,0,0,0.5);
  cursor: pointer;
  user-select: none;
  overflow: visible;
}
.compass.hidden { display: none; }

.compass-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease;
}

.compass-inner.excited {
  animation: compass-spin 0.55s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  transition: none;
}

@keyframes compass-spin {
  0%   { transform: rotate(0deg)   scale(1);   }
  30%  { transform: rotate(270deg) scale(1.25); }
  70%  { transform: rotate(630deg) scale(1.1);  }
  100% { transform: rotate(720deg) scale(1);   }
}

.animal-pointer {
  font-size: 22px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: -4px;
  filter: drop-shadow(0 -2px 6px rgba(109, 179, 109, 0.8));
}
.animal-icon {
  font-size: 44px;
  line-height: 1;
}

.compass-needle {
  width: 12px;
  height: 48px;
  display: flex;
  flex-direction: column;
}
.needle-north {
  flex: 1;
  background: #e74c3c;
  border-radius: 6px 6px 0 0;
}
.needle-south {
  flex: 1;
  background: var(--surface2);
  border-radius: 0 0 6px 6px;
}

.compass-dist {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: 0.5px;
}

/* Settings */
.settings-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  z-index: 4000;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.4);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.settings-sheet.hidden {
  transform: translateY(110%);
  pointer-events: none;
}

#settings-dev {
  bottom: auto;
  top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  padding: calc(20px + env(safe-area-inset-top)) 20px 20px;
  transform: translateY(0);
}
#settings-dev.hidden {
  transform: translateY(-110%);
  pointer-events: none;
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.settings-header h2 {
  font-size: 18px;
  font-weight: 700;
}

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--surface2);
}
.setting-row span {
  color: var(--text2);
  font-size: 15px;
}

.style-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.style-btn {
  background: var(--surface2);
  color: var(--text);
  border: none;
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
}
.style-btn.active {
  background: var(--accent);
  color: #fff;
}

/* Admin */
.admin-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #e67e22;
  color: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  padding: 4px;
  z-index: 5000;
}

.sheet-admin {
  background: #2a2a1a;
  border: 1px solid #e67e22;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 14px;
  font-size: 13px;
}

.admin-coords {
  font-family: monospace;
  color: #e67e22;
  margin-right: 12px;
}

.admin-osm-link {
  color: #6db36d;
  text-decoration: none;
}

.admin-label {
  background: rgba(230, 126, 34, 0.9) !important;
  border: none !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 2px 6px !important;
  border-radius: 4px !important;
  white-space: nowrap;
}

/* Koko ruudun juhla */
.celeb-bg {
  position: fixed;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 4998;
  pointer-events: none;
  animation: celeb-expand 1.1s cubic-bezier(0.2, 0.6, 0.3, 1) forwards;
}
.celeb-catch    { background: rgba(240, 192, 96, 0.45); }
.celeb-discover { background: rgba(109, 179, 109, 0.45); }

.celeb-content {
  position: fixed;
  top: 50%;
  left: 50%;
  font-size: 80px;
  line-height: 1;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5a3e1b;
  border: 3px solid #f0c060;
  border-radius: 50%;
  transform: translate(-50%, -50%) scale(0);
  z-index: 4999;
  pointer-events: none;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5);
  animation: celeb-pop 2.2s ease-out forwards;
}

@keyframes celeb-expand {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  55%  { transform: translate(-50%, -50%) scale(120); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(130); opacity: 0; }
}

@keyframes celeb-pop {
  0%   { transform: translate(-50%, -50%) scale(0);   opacity: 0; }
  15%  { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  30%  { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
  75%  { transform: translate(-50%, -50%) scale(1.05); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0; }
}

/* Räjähdys */
.burst-flash {
  position: absolute;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 2001;
  transform: translate(-50%, -50%) scale(0.3);
  animation: burst-flash 0.35s ease-out forwards;
}

.burst-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px solid;
  pointer-events: none;
  z-index: 2000;
  transform: translate(-50%, -50%) scale(0);
  animation: burst-ring 0.65s ease-out forwards;
}

@keyframes burst-flash {
  0%   { transform: translate(-50%, -50%) scale(0.3); opacity: 1; }
  60%  { transform: translate(-50%, -50%) scale(1.4); opacity: 0.9; }
  100% { transform: translate(-50%, -50%) scale(2);   opacity: 0; }
}

@keyframes burst-ring {
  0%   { transform: translate(-50%, -50%) scale(0); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 0; }
}

/* Puput */
.rabbit-marker {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #5a3e1b;
  border: 2px solid #f0c060;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
  animation: rabbit-hop 1.2s ease-in-out infinite;
}

@keyframes rabbit-hop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* Harvinaiset (joutsen, kotka, keijukainen) */
.rare-marker {
  background: #1a3420;
  border-color: #6db36d;
  animation: rare-pulse 3s ease-in-out infinite;
}

@keyframes rare-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(109, 179, 109, 0.4); }
  50%       { box-shadow: 0 2px 20px rgba(109, 179, 109, 0.9); }
}

/* Unicorn */
.unicorn-marker {
  background: #2d1b4e;
  border-color: #c084fc;
  animation: unicorn-pulse 2s ease-in-out infinite;
}

@keyframes unicorn-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(192,132,252,0.4); }
  50%       { box-shadow: 0 2px 20px rgba(192,132,252,0.9); }
}

/* Sleep indicator */
.sleep-indicator {
  position: absolute;
  font-size: 24px;
  pointer-events: none;
  z-index: 2000;
  transform: translate(-50%, -50%);
  animation: sleep-float 1.2s ease-out forwards;
}

@keyframes sleep-float {
  0%   { transform: translate(-50%, -50%) scale(0.5); opacity: 1; }
  60%  { transform: translate(-50%, -120%) scale(1.2); opacity: 1; }
  100% { transform: translate(-50%, -180%) scale(1); opacity: 0; }
}

/* GPS dot */
.gps-dot {
  width: 16px;
  height: 16px;
  background: #4a90e2;
  border: 3px solid white;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(74,144,226,0.3);
}

.gps-dot-test {
  background: #e67e22;
  box-shadow: 0 0 0 3px rgba(230,126,34,0.3);
}

/* Disclaimer */
.disclaimer-screen.hidden { display: none; }
.disclaimer-screen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #1a2a1a;
  overflow-y: auto;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.disclaimer-content {
  max-width: 480px;
  padding: 2rem;
  color: var(--text);
}

.disclaimer-content h1 {
  margin-bottom: 1.5rem;
  font-size: 1.4rem;
  line-height: 1.3;
}

.disclaimer-content ul {
  list-style: none;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.disclaimer-content li {
  line-height: 1.5;
}

.disclaimer-content p {
  font-style: italic;
  color: var(--text2);
  margin-bottom: 2rem;
  line-height: 1.5;
  font-size: 0.9rem;
}

.disclaimer-screen .btn-primary {
  width: 100%;
}

.disclaimer-scroll-hint {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.8rem;
  color: var(--accent);
  text-shadow: 0 0 12px var(--accent), 0 0 24px var(--accent);
  animation: scroll-bounce 1.4s ease-in-out infinite;
  pointer-events: none;
  z-index: 10000;
}
.disclaimer-scroll-hint.hidden { display: none; }
@keyframes scroll-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.9; }
  50% { transform: translateX(-50%) translateY(8px); opacity: 0.5; }
}
.disclaimer-screen .btn-primary:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* Score modal */
.score-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.score-modal.hidden {
  display: none;
}
.score-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
}
.score-modal-box {
  position: relative;
  background: #1a2a1a;
  border-radius: 12px;
  padding: 1.5rem;
  min-width: 260px;
  color: white;
}
.score-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 18px;
  font-weight: 700;
}
.score-modal-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
}

/* Polaroid-kuva */
.polaroid-photo-inner {
  background: #fff;
  padding: 12px 12px 48px 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  transform: rotate(-2deg);
  animation: polaroid-develop 1.5s ease-out forwards;
}
@keyframes polaroid-develop {
  0%   { filter: brightness(0); }
  30%  { filter: brightness(0.3) sepia(0.8); }
  100% { filter: brightness(1) sepia(0.2) contrast(1.05); }
}
.polaroid-caption {
  text-align: center;
  margin-top: 8px;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  color: #333;
  letter-spacing: 1px;
}
/* Salama */
.camera-flash {
  position: fixed;
  inset: 0;
  background: white;
  z-index: 1001;
  animation: flash-out 0.4s ease-out forwards;
  pointer-events: none;
}
.camera-flash.hidden {
  display: none;
}
@keyframes flash-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* Full-screen kameramodal */
.camera-modal-fs {
  position: fixed;
  inset: 0;
  z-index: 5500;
  background: #000;
}
.camera-modal-fs.hidden { display: none; }

/* Piilota kaikki UI kun kamera auki */
body.camera-open .score-panel,
body.camera-open #explore-mode-btn,
body.camera-open #settings-btn,
body.camera-open #locate-btn,
body.camera-open #map-camera-btn,
body.camera-open .compass,
body.camera-open #toast {
  display: none !important;
}

/* Stamp-näkymä */
.fs-stamp {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 20px; overflow-y: auto;
}
.fs-stamp.hidden { display: none; }
.fs-live.hidden { display: none; }

/* Polaroid-kehys */
.fs-polaroid {
  position: relative;
  background: white;
  padding: 10px 10px 48px 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  width: min(320px, 92vw);
  transform: rotate(-1.5deg);
}
#fs-bg-canvas {
  display: block;
  width: 100%;
  height: auto;
}

@keyframes fs-polaroid-develop {
  0%   { filter: brightness(0) sepia(1); }
  40%  { filter: brightness(0.4) sepia(0.8); }
  100% { filter: brightness(1) sepia(0); }
}
.fs-polaroid.developing {
  animation: fs-polaroid-develop 1.2s ease-out forwards;
}

/* Kohdeympyrä */
.fs-target {
  position: absolute;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(255, 220, 50, 0.25);
  border: 3px solid rgba(255, 220, 50, 0.7);
  box-shadow: 0 0 20px rgba(255, 220, 50, 0.5);
  transform: translate(-50%, -50%);
  animation: target-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes target-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.8; }
  50%       { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
}
.fs-target.snapped {
  animation: none;
  background: rgba(255,220,50,0.6);
  box-shadow: 0 0 40px rgba(255,220,50,0.9);
}

/* Kolikko (yhteinen stamp-puzzlelle) */
.ar-coin-inner {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe066, #f0a500 60%, #b8760a);
  box-shadow: 0 4px 16px rgba(0,0,0,0.5), inset 0 2px 4px rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: coin-spin 2s linear infinite;
  font-size: 48px;
  transform-style: preserve-3d;
}
@keyframes coin-spin {
  0%   { transform: rotateY(0deg); }
  100% { transform: rotateY(360deg); }
}
#fs-coin-drag, .fs-coin-drag {
  perspective: 300px;
}
.ar-coin-shadow {
  width: 70px;
  height: 14px;
  background: radial-gradient(ellipse, rgba(0,0,0,0.5) 0%, transparent 70%);
  margin-top: -4px;
  border-radius: 50%;
  animation: shadow-pulse 2s linear infinite;
}
@keyframes shadow-pulse {
  0%, 100% { transform: scaleX(1); opacity: 0.5; }
  50%       { transform: scaleX(0.15); opacity: 0.2; }
}
.ar-coin-emoji {
  line-height: 1;
}

/* Raahattava kolikko Polaroidissa */
#fs-coin-drag {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  display: flex; flex-direction: column; align-items: center;
  z-index: 10;
}
#fs-coin-drag:active { cursor: grabbing; }
.fs-coin-drag {
  position: absolute;
  cursor: grab;
  display: flex; flex-direction: column; align-items: center;
  transform: translate(-50%, -50%);
  touch-action: none;
}
.fs-coin-drag:active { cursor: grabbing; }
@keyframes coin-stamp-in {
  0%   { transform: translate(-50%, -200%) scale(0); opacity: 0; }
  60%  { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  80%  { transform: translate(-50%, -50%) scale(0.9); }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.fs-coin-drag.stamping {
  animation: coin-stamp-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.fs-coin-drag.snap-transition {
  transition: left 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
              top 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fs-coin-drag.coin-snapped .ar-coin-inner {
  animation: none;
}

/* Tähdet */
.fs-stars {
  position: absolute; inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.fs-star {
  position: absolute;
  font-size: 20px;
  animation: star-fly 0.8s ease-out forwards;
}
@keyframes star-fly {
  0%   { transform: translate(0,0) scale(0); opacity: 1; }
  100% { transform: translate(var(--dx), var(--dy)) scale(1.5); opacity: 0; }
}

/* Polaroid-teksti */
.fs-polaroid-caption {
  text-align: center;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #333;
  margin-top: 10px;
  letter-spacing: 1px;
}

.fs-polaroid-url {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  color: #aaa;
  pointer-events: none;
  letter-spacing: 0.5px;
}

/* Snap-välähdys */
@keyframes snap-flash {
  0%   { opacity: 0.9; }
  100% { opacity: 0; }
}
.snap-flash {
  position: fixed; inset: 0;
  background: white;
  z-index: 2000;
  animation: snap-flash 0.4s ease-out forwards;
  pointer-events: none;
}

.fs-stamp-hint {
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 13px;
  margin-top: 10px;
  transition: opacity 0.5s;
}
.fs-stamp-controls {
  display: flex; gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

/* Polaroid-tulos fullscreenissä */
.fs-photo {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 16px;
  background: rgba(0,0,0,0.8);
}
.fs-photo.hidden { display: none; }
.fs-photo-actions {
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: center;
}

#camera-canvas-fs {
  display: block;
  width: 260px;
  height: auto;
}

.fs-live {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.85);
}
.vintage-camera {
  width: min(320px, 92vw);
  background: linear-gradient(160deg, #3a2a1a 0%, #2a1a0a 100%);
  border-radius: 20px;
  padding: 16px 16px 20px 16px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7), inset 0 1px 0 rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.vintage-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
}
.vintage-brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255,220,150,0.8);
  text-transform: uppercase;
}
.vintage-led {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #4a4;
  box-shadow: 0 0 6px #4f4;
}
.vintage-viewfinder {
  position: relative;
  width: 100%;
  /* Portrait — vastaa lopullista kuvaa */
  aspect-ratio: 3/4;
  background: #000;
  border-radius: 6px;
  overflow: hidden;
  border: 3px solid rgba(255,255,255,0.1);
}
#camera-video-fs {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}
.vintage-crosshair {
  position: absolute; inset: 0;
  background:
    linear-gradient(rgba(255,255,255,0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.15) 1px, transparent 1px);
  background-size: 33.33% 33.33%;
  pointer-events: none;
}
.vintage-hint {
  position: absolute;
  bottom: 12px;
  left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
  padding: 0 12px;
  pointer-events: none;
}
.vintage-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 8px;
}
.vintage-close-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  font-size: 16px; cursor: pointer;
}
.vintage-shutter-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e06060, #a02020);
  border: 4px solid rgba(255,255,255,0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  cursor: pointer;
  transition: transform 0.1s;
}
.vintage-shutter-btn:active { transform: scale(0.93); }

/* Nearby-nappi */
#nearby-btn       { bottom: 236px; }

.nearby-marker {
  width: 36px; height: 36px;
  background: rgba(80, 140, 200, 0.85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
