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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: #1a1a2e;
  color: #eee;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 16px;
}

.app {
  width: 100%;
  max-width: 480px;
  text-align: center;
}

.title { font-size: 2rem; margin-bottom: 4px; }
.subtitle { color: #999; margin-bottom: 20px; }

.tally-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.beer-btn {
  position: relative;
  padding: 20px 12px;
  font-size: 1.15rem;
  font-weight: 600;
  color: #fff;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

.beer-btn:active {
  transform: scale(0.96);
  background: #0f3460;
}

.badge {
  display: inline-block;
  min-width: 24px;
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 0.85rem;
  background: #e94560;
  border-radius: 999px;
}

.feedback {
  margin-top: 24px;
  min-height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffd166;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.feedback.show {
  animation: feedback-fade 2s ease forwards;
}

@keyframes feedback-fade {
  0%   { visibility: visible; opacity: 0; transform: translateY(4px); }
  15%  { visibility: visible; opacity: 1; transform: translateY(0); }
  90%  { visibility: visible; opacity: 1; transform: translateY(0); }
  100% { visibility: hidden; opacity: 0; transform: translateY(0); }
}

/* ---------- Bottom action bar (camera / guide / timeline / gallery) ---------- */

/* Keep page content clear of the fixed action bar. */
body {
  padding-bottom: 180px;
}

.bottom-actions {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
}

.camera-btn,
.guide-btn,
.gallery-btn,
.timeline-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 80px;
  height: 80px;
  color: #fff;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.1s ease;
}

.camera-btn .btn-icon,
.guide-btn .btn-icon,
.gallery-btn .btn-icon,
.timeline-btn .btn-icon {
  font-size: 1.75rem;
  line-height: 1;
}

.camera-btn .btn-label,
.guide-btn .btn-label,
.gallery-btn .btn-label,
.timeline-btn .btn-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ccc;
}

.camera-btn:hover,
.guide-btn:hover,
.gallery-btn:hover,
.timeline-btn:hover {
  background: #0f3460;
}

.camera-btn:active,
.guide-btn:active,
.gallery-btn:active,
.timeline-btn:active {
  transform: scale(0.96);
  background: #0f3460;
}

.camera-btn:focus-visible,
.guide-btn:focus-visible,
.gallery-btn:focus-visible,
.timeline-btn:focus-visible {
  outline: 2px solid #e94560;
  outline-offset: 2px;
}

/* ---------- TAKE ME HOME button (directions home) ---------- */

.take-me-home-btn {
  position: fixed;
  bottom: 112px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 448px;
  padding: 16px 12px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #fff;
  background: #dc2626;
  border: 1px solid #b91c1c;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.1s ease, box-shadow 0.1s ease;
}

.take-me-home-btn:hover {
  background: #ef4444;
}

.take-me-home-btn:active {
  transform: translateX(-50%) scale(0.98);
  background: #b91c1c;
}

.take-me-home-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ---------- Camera modal (fixed overlay, disposable-camera UX) ---------- */

.camera-modal {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.8);
}

.camera-modal.open {
  display: flex;
}

.camera-modal-viewport {
  position: relative;
  width: 100%;
  max-width: 480px;
}

.camera-modal video {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  border-radius: 12px;
  background: #111;
}

.camera-saving {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 600;
}

.camera-saving.show {
  display: flex;
}

.camera-saving-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: camera-spin 0.8s linear infinite;
}

@keyframes camera-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Gallery modal ---------- */

.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.7);
}

.gallery-modal.open {
  display: flex;
}

.gallery-modal-content {
  position: relative;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  background: #1a1a2e;
  border: 1px solid #0f3460;
  border-radius: 12px;
  padding: 16px;
}

.gallery-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-right: 36px;
}

.gallery-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: #fff;
  background: #e94560;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.1s ease;
}

.gallery-modal-close:hover {
  background: #ff5570;
}

.gallery-modal-close:active {
  transform: scale(0.92);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.gallery-item {
  position: relative;
  background: #16213e;
  border: 1px solid #0f3460;
  border-radius: 8px;
  overflow: hidden;
}

.gallery-item-thumb {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #0f3460;
}

.gallery-item-timestamp {
  display: block;
  padding: 6px 4px;
  font-size: 0.7rem;
  color: #999;
  text-align: center;
}

.gallery-empty {
  padding: 24px 8px;
  color: #999;
  font-size: 0.95rem;
}

/* ---------- Photo modal (enlarged view + download/share/close) ---------- */

.photo-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.9);
}

.photo-modal.open {
  display: flex;
}

.photo-modal-content {
  position: relative;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-modal-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  background: #111;
}

.photo-modal-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 8px;
}

.photo-modal-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  line-height: 1;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.1s ease, background 0.1s ease;
}

.photo-modal-btn:hover {
  background: rgba(0, 0, 0, 0.75);
}

.photo-modal-btn:active {
  transform: scale(0.92);
}

.photo-modal-btn:focus-visible {
  outline: 2px solid #e94560;
  outline-offset: 2px;
}

.photo-modal-copied {
  position: absolute;
  top: 52px;
  right: 8px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  background: #2e7d32;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.photo-modal-copied.show {
  opacity: 1;
}

@media (min-width: 480px) {
  .tally-grid { grid-template-columns: repeat(3, 1fr); }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
}
