/* Mobile-first: the Mini App runs inside Telegram's in-app browser, almost
   always on a phone. Colours come from Telegram's own theme variables so the
   page doesn't clash with the user's light/dark setting. */

:root {
  --bg: var(--tg-theme-bg-color, #17212b);
  --text: var(--tg-theme-text-color, #f5f5f5);
  --hint: var(--tg-theme-hint-color, #9aa4ae);
  --btn-bg: var(--tg-theme-button-color, #2ea6ff);
  --btn-text: var(--tg-theme-button-text-color, #ffffff);
  --surface: var(--tg-theme-secondary-bg-color, #232e3c);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior: none;
}

#app {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
}

.status {
  font-size: 13px;
  color: var(--hint);
  text-align: center;
  min-height: 18px;
}

.status.error { color: #ff6b6b; }

.map-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}

.caption {
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.4;
  background: var(--surface);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 20px;
}

.pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font-size: 24px;
  padding: 16px 0;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.06s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.94); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn-center {
  background: var(--btn-bg);
  color: var(--btn-text);
}
