.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page__main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--sp-7) var(--sp-5);
  position: relative;
  z-index: 1;
}

.hero {
  text-align: center;
  padding: var(--sp-8) 0 var(--sp-7);
}

.hero__title {
  background: linear-gradient(135deg, var(--c-cyan) 0%, var(--c-blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--sp-3);
}

.hero__subtitle {
  font-size: 1.1rem;
  color: var(--c-text-dim);
  margin-bottom: var(--sp-6);
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

.search-box {
  max-width: 320px;
  margin: var(--sp-6) auto 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-3);
}

.search-box__row {
  display: flex;
  gap: var(--sp-2);
}

.search-box__row .input {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
}

.search-box .btn { white-space: nowrap; }

.world-map {
  height: clamp(400px, 60vh, 600px);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-2);
  margin-top: var(--sp-6);
}

.leaflet-container {
  background: var(--c-deep-2) !important;
  font-family: var(--f-sans) !important;
}

.leaflet-popup-content-wrapper, .leaflet-popup-tip {
  background: var(--c-deep-3) !important;
  color: var(--c-text) !important;
}

.leaflet-popup-content {
  margin: var(--sp-3) var(--sp-4) !important;
  font-size: 0.9rem;
}

.leaflet-popup-content a {
  color: var(--c-cyan);
  font-family: var(--f-mono);
}

.bottle-marker {
  background: none !important;
  border: none !important;
}

.map-tooltip {
  background: var(--c-deep-3) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: 4px !important;
  color: var(--c-cyan) !important;
  font-family: var(--f-mono) !important;
  font-size: 0.7rem !important;
  padding: 2px 6px !important;
  box-shadow: 0 0 8px rgba(0,0,0,0.4) !important;
}

.map-tooltip::before { border-top-color: var(--c-deep-3) !important; }

/* ---- Instagram-style detail page ---- */

.ig-page {
  max-width: 640px;
  margin: 0 auto;
}

/* Header: avatar + info + QR */
.ig-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-3);
  padding-bottom: var(--sp-5);
  border-bottom: 1px solid var(--c-border);
}

.ig-header h1 {
  font-size: 1.5rem;
}

.ig-header__avatar {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
  position: relative;
}

.ig-header__avatar svg {
  width: 100%;
  height: 100%;
}

.ig-header__code {
  font-family: var(--f-mono);
  font-size: 0.95rem;
  color: var(--c-text-mute);
  letter-spacing: 0.06em;
}

/* Hero depth */
.ig-hero-depth {
  text-align: center;
  padding: var(--sp-5) 0 var(--sp-3);
}

.ig-hero-depth__label {
  font-size: 1rem;
  color: var(--c-text-mute);
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-1);
}

.ig-hero-depth__value {
  font-family: var(--f-mono);
  font-size: 5rem;
  font-weight: 800;
  color: var(--c-cyan);
  line-height: 1;
  text-shadow: 0 0 40px rgba(128, 222, 234, 0.3);
}

.ig-hero-depth__value span {
  font-size: 0.4em;
  font-weight: 600;
  color: var(--c-text-dim);
  margin-left: 2px;
  text-shadow: none;
}

/* Hero date */
.ig-hero-date {
  text-align: center;
  padding: var(--sp-2) 0 var(--sp-5);
  border-bottom: 1px solid var(--c-border);
}

.ig-hero-date__label {
  font-size: 0.9rem;
  color: var(--c-text-mute);
  letter-spacing: 0.1em;
  margin-bottom: var(--sp-1);
}

.ig-hero-date__value {
  font-family: var(--f-mono);
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--c-text);
}

/* Meta group */
.ig-meta {
  padding: var(--sp-4) 0;
}

.ig-meta__title {
  font-size: 0.85rem;
  color: var(--c-text-mute);
  text-align: center;
  letter-spacing: 0.08em;
  margin-bottom: var(--sp-3);
}

.ig-meta__row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-4);
}

.ig-meta__item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 1rem;
  color: var(--c-text-dim);
}

.ig-meta__item svg {
  flex-shrink: 0;
  opacity: 0.5;
}

/* Stat pills row (keep for backward compat) */
.ig-stats {
  display: flex;
  justify-content: center;
  gap: var(--sp-4);
  padding: var(--sp-5) 0;
  flex-wrap: wrap;
}

/* Map */
.ig-map {
  height: 380px;
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--c-border);
  margin: var(--sp-5) 0;
}

/* Story text */
.ig-story {
  font-size: 1.25rem;
  line-height: 1.8;
  padding: var(--sp-5);
  background: var(--c-glass);
  border-radius: var(--r-lg);
  border: 1px solid var(--c-border);
  margin-bottom: var(--sp-5);
  white-space: pre-wrap;
}

/* Media (photos / video) */
.ig-media {
  margin-bottom: var(--sp-5);
}

/* Message */
.ig-message {
  background: linear-gradient(135deg, rgba(255, 107, 157, 0.1), rgba(255, 142, 177, 0.05));
  border: 1px solid rgba(255, 107, 157, 0.25);
  padding: var(--sp-7) var(--sp-6);
  border-radius: var(--r-lg);
  margin-bottom: var(--sp-5);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 160px;
}

.ig-message__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--c-coral);
  margin-bottom: var(--sp-3);
  font-weight: 600;
}

.ig-message p {
  font-size: 1.05rem;
  line-height: 1.8;
  font-style: italic;
  color: var(--c-text);
  max-width: 480px;
}

/* Navigation */
.ig-nav {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-3);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--c-border);
}

.ig-nav .btn { flex: 1; justify-content: center; }

.back-home {
  position: fixed;
  top: var(--sp-4);
  left: var(--sp-4);
  z-index: 100;
  font-size: 0.85rem;
}

.sample-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--sp-3);
  max-width: var(--w-max, 1200px);
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.sample-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-glass);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

.sample-card:hover {
  border-color: var(--c-cyan);
  box-shadow: 0 0 16px rgba(128, 222, 234, 0.12);
}

.sample-card__bottle {
  position: relative;
  flex-shrink: 0;
  width: 56px;
  height: 56px;
}

.sample-card__bottle svg {
  width: 100%;
  height: 100%;
}

.sample-card__id {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--f-mono);
  font-size: 0.85rem;
  color: var(--c-cyan);
  text-shadow: 0 0 6px rgba(128, 222, 234, 0.6);
}

.sample-card__info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.sample-card__name {
  font-size: 0.95rem;
  color: var(--c-text);
  font-weight: 600;
}

.sample-card__meta {
  font-size: 0.8rem;
  color: var(--c-text-dim);
}

@media (max-width: 640px) {
  .ig-header { flex-wrap: wrap; justify-content: center; text-align: center; }
  .ig-hero-depth__value { font-size: 3.5rem; }
  .ig-hero-date__value { font-size: 1.5rem; }
  .ig-stats { gap: var(--sp-2); }
  .ig-stat { min-width: 70px; padding: var(--sp-2) var(--sp-3); }
  .ig-stat__value { font-size: 1.25rem; }
  .sample-grid { grid-template-columns: 1fr; }
}
