/* ReciclaGo app surfaces — modals only. Landing layout stays untouched. */

html.is-sheet-open,
html.is-sheet-open body {
  overflow: hidden;
  overscroll-behavior: none;
}

html.is-sheet-open body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
}

.btn--sm {
  padding: 9px 16px;
  font-size: 13px;
}

.sheet {
  width: min(760px, calc(100% - 24px));
  max-height: min(860px, calc(100dvh - 92px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: #fff;
  box-shadow: 0 24px 80px rgba(6, 75, 57, 0.16);
  color: var(--text-primary);
  overflow: hidden;
}

.sheet[open] {
  display: flex;
  flex-direction: column;
  margin-top: 72px;
}

.lightbox[open] {
  margin-top: 72px;
}

.sheet--lg {
  width: min(960px, calc(100% - 24px));
}

.sheet--start {
  width: min(920px, calc(100% - 24px));
}

.sheet--wide {
  width: min(1180px, calc(100% - 20px));
  height: min(820px, calc(100dvh - 92px));
  max-height: min(820px, calc(100dvh - 92px));
}

.sheet__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px 14px;
  flex-shrink: 0;
}

.sheet__heading h2 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

.sheet__eyebrow {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

.sheet__head-end {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.sheet__close {
  background: #f1f1ef;
  color: var(--text-primary);
}

.sheet .sheet__close.btn-circle:hover {
  background: var(--green-soft);
  color: var(--green-dark);
  transform: none;
}

.sheet .sheet__close.btn-circle:hover svg,
.lightbox .sheet__close.btn-circle:hover svg {
  transform: none;
}

.sheet .btn-circle,
.lightbox .btn-circle {
  line-height: 0;
}

.sheet .btn-circle svg,
.lightbox .btn-circle svg {
  display: block;
  width: 16px;
  height: 16px;
}

.sheet-hud {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 999px;
}

.sheet-hud:has(.btn) {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.sheet-hud__points {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.sheet-hud__level {
  color: var(--green-dark);
  opacity: 0.72;
  font-weight: 500;
}

.sheet__body {
  padding: 18px 22px 24px;
  overflow-x: clip;
  overflow-y: auto;
  flex: 1;
  overscroll-behavior: contain;
}

.sheet__lead {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  max-width: 62ch;
}

.sheet-progress {
  display: grid;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0 0 18px;
}

.sheet-progress__meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
}

.sheet-progress__meta span:last-child {
  color: var(--text-secondary);
}

.meter {
  height: 2px;
  background: #ecece8;
  overflow: hidden;
}

.meter > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--green-dark);
  transition: width 500ms var(--ease-out-premium);
}

.sheet .btn,
.lightbox .btn {
  border-radius: 12px;
  max-width: 100%;
}

.sheet .btn:hover,
.sheet .btn:active,
.lightbox .btn:hover,
.lightbox .btn:active {
  transform: none;
}

.sheet .field input {
  border-radius: 12px;
  background: #f1f1ef;
  outline: none;
  transition: box-shadow 180ms var(--ease), background 180ms var(--ease);
}

.sheet .field input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(6, 75, 57, 0.16);
}

.sheet-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  overflow: visible;
}

.sheet-filters--map {
  flex-direction: column;
  flex-wrap: nowrap;
  overflow: visible;
  gap: 12px;
  margin-bottom: 14px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  overflow: visible;
  min-width: 0;
}

.filter-group__label {
  flex: 1 0 100%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.filter-chip {
  border: 0;
  background: #f1f1ef;
  color: var(--text-secondary);
  border-radius: 10px;
  padding: 7px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 180ms var(--ease), color 180ms var(--ease);
}

.filter-chip.is-on {
  background: var(--green-dark);
  color: #fff;
}

.sheet-empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* —— Start / profile —— */

.welcome {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.05fr);
  gap: 22px;
  align-items: stretch;
  min-height: 420px;
}

.welcome__panel {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  min-height: 420px;
  color: #fff;
  background: var(--green-dark);
  display: grid;
  align-content: end;
}

.welcome__panel img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.welcome__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(6, 75, 57, 0.18) 0%, rgba(6, 75, 57, 0.82) 58%, rgba(6, 75, 57, 0.94) 100%);
}

.welcome__copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 14px;
  padding: 24px 22px 22px;
}

.welcome__panel h3 {
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
}

.welcome__panel p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
}

.benefit-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.benefit-list li {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}

.benefit-list strong {
  display: block;
  font-size: 13px;
  color: #fff;
}

.benefit-list span {
  display: block;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 500;
}

.glyph {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: inherit;
  flex-shrink: 0;
}

.glyph svg {
  display: block;
  width: 20px;
  height: 20px;
  overflow: visible;
}

.welcome__panel .glyph {
  color: #d6e5be;
  margin-top: 1px;
}

.welcome__form {
  display: grid;
  align-content: center;
}

.welcome__form .field {
  margin-top: 8px;
}

.welcome__form .btn {
  width: 100%;
  margin-top: 8px;
}

.profile {
  display: grid;
  gap: 18px;
}

.profile__hello h3 {
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
}

.profile__hello p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat {
  background: #f6f7f2;
  border-radius: 16px;
  padding: 14px;
}

.profile-stat span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
}

.profile-stat strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.profile-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.profile-actions .btn {
  width: auto;
  min-width: 148px;
  min-height: 44px;
  height: 44px;
  padding: 0 18px;
  line-height: 1;
  box-sizing: border-box;
  white-space: nowrap;
  flex: 0 0 auto;
}

.profile-actions .btn--danger {
  margin-left: auto;
}

/* —— Challenges —— */

.quest-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.quest {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 8px 16px;
  background: #f7f7f4;
  border-radius: 16px;
  padding: 20px 20px 18px;
  transition:
    transform 280ms var(--ease-out-premium),
    box-shadow 280ms var(--ease-out-premium),
    background 280ms var(--ease-out-premium);
}

.quest.is-done {
  background: #f1f3ec;
}

.quest__index {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
  color: var(--green-dark);
  padding-top: 2px;
  font-variant-numeric: tabular-nums;
}

.quest.is-done .quest__index {
  color: var(--text-secondary);
}

.quest__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.quest__tag {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.quest__reward {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--green-dark);
  white-space: nowrap;
}

.quest h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.quest__detail {
  margin: 0 0 12px;
  color: var(--text-secondary);
  font-size: 14px;
}

.quest__steps {
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
  display: grid;
  gap: 7px;
}

.quest__steps li {
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 10px;
  align-items: start;
}

.quest__steps li::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-top: 7px;
  background: var(--green-dark);
  border-radius: 50%;
}

.quest__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.points-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: var(--green-soft);
  color: var(--green-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

/* —— Rewards —— */

.prize-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.prize {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f7f7f4;
  border-radius: 16px;
  padding: 18px;
  min-height: 220px;
  transition:
    transform 280ms var(--ease-out-premium),
    box-shadow 280ms var(--ease-out-premium),
    background 280ms var(--ease-out-premium);
}

.prize.is-owned {
  background: #f1f3ec;
}

.prize.is-locked {
  opacity: 0.92;
}

.prize .glyph {
  width: 28px;
  height: 28px;
  color: var(--green-dark);
  margin-bottom: 6px;
}

.prize .glyph svg {
  width: 24px;
  height: 24px;
}

.prize__cat {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.prize h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.prize__detail {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13px;
  flex: 1;
}

.prize__foot {
  display: grid;
  gap: 8px;
  margin-top: 6px;
}

.prize__cost {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.prize__ep {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.prize__ep strong {
  display: block;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
}

.prize__pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
}

.prize__wait {
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #eceee8;
  border-radius: 10px;
  padding: 10px 12px;
}

.prize__owned {
  margin: 0;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  color: var(--green-dark);
  background: #fff;
  border-radius: 10px;
  padding: 10px 12px;
}

.prize .btn {
  width: 100%;
}

/* —— Map points —— */

.sheet--wide .sheet__body {
  overflow: hidden;
  min-height: 0;
}

.sheet__body--split {
  display: grid;
  grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
  min-width: 0;
  height: auto;
  padding-bottom: 18px;
}

.sheet--wide .sheet__body--split {
  flex: 1;
  height: auto;
}

.point-pane {
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.point-list {
  list-style: none;
  padding: 0 2px 4px 0;
  margin: 0;
  display: grid;
  gap: 10px;
  overflow-x: clip;
  overflow-y: auto;
  min-height: 0;
  min-width: 0;
  flex: 1;
  scrollbar-width: thin;
}

.spot {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  text-align: left;
  border: 0;
  background: #f7f7f4;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: background 280ms var(--ease-out-premium);
}

.spot.is-active {
  background: #eef2e6;
}

.spot__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.spot h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  min-width: 0;
  overflow-wrap: anywhere;
}

.spot__meta,
.spot__addr {
  margin: 0;
  font-size: 12px;
  color: var(--text-secondary);
}

.spot__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mat-chip {
  background: #fff;
  color: var(--green-dark);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
}

.spot-wrap {
  display: grid;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.spot__cta {
  width: 100%;
  max-width: 100%;
}

.map-stage {
  position: relative;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #eef3e8;
}

.map-stage .leaflet-control-attribution,
.map-stage .leaflet-bottom {
  display: none;
}

.map-stage::after {
  content: "© OpenStreetMap";
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 400;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 3px 8px;
  pointer-events: none;
}

.map {
  min-height: 100%;
  height: 100%;
  width: 100%;
  max-width: 100%;
  border-radius: 18px;
}

/* —— Lightbox —— */

.lightbox {
  width: min(1080px, calc(100% - 20px));
  height: min(820px, calc(100dvh - 92px));
  border: 0;
  border-radius: 20px;
  padding: 0;
  background: #fff;
  overflow: hidden;
}

.lightbox[open] {
  display: flex;
  flex-direction: column;
}

.lightbox__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px 8px;
  flex-shrink: 0;
}

.lightbox__caption {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.lightbox__stage {
  flex: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: #f4f6f0;
  min-height: 0;
}

.lightbox__figure {
  margin: 0;
  height: 100%;
  display: grid;
  place-items: center;
}

.lightbox__figure img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 16px;
}

.lightbox__close {
  position: static;
}

.lightbox__prev,
.lightbox__next {
  position: static;
  top: auto;
  left: auto;
  right: auto;
}

.lightbox__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 0 16px 16px;
  flex-shrink: 0;
  scrollbar-width: thin;
}

.lightbox__thumb {
  flex: 0 0 76px;
  width: 76px;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #e7eadf;
  cursor: pointer;
  opacity: 0.48;
}

.lightbox__thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  scale: 1;
  transition: scale 360ms var(--ease-out-premium);
}

.lightbox__thumb.is-on {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .filter-chip:hover {
    background: #e9ede3;
    color: var(--text-primary);
  }

  .filter-chip.is-on:hover {
    background: #05382b;
    color: #fff;
  }

  .quest:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(6, 75, 57, 0.08);
  }

  .quest.is-done:hover {
    box-shadow: 0 10px 28px rgba(6, 75, 57, 0.08);
  }

  .prize:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(6, 75, 57, 0.08);
  }

  .spot:hover {
    background: #eef2e6;
  }

  .sheet .btn--ink:hover,
  .sheet .btn--sage:hover,
  .sheet .btn--ghost:hover,
  .sheet .btn--blue:hover,
  .sheet .btn--danger:hover,
  .lightbox .btn--ink:hover,
  .lightbox .btn--sage:hover,
  .lightbox .btn--ghost:hover,
  .lightbox .btn--blue:hover,
  .lightbox .btn--danger:hover {
    transform: none;
  }

  .lightbox__thumb:hover {
    opacity: 0.8;
  }
}

@media (min-width: 801px) {
  .sheet-filters {
    flex-wrap: wrap;
    overflow: visible;
  }
}

@media (max-width: 1024px) {
  .prize-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 800px) {
  .sheet,
  .sheet--lg,
  .sheet--start,
  .sheet--wide,
  .lightbox {
    width: calc(100vw - 12px);
    max-width: calc(100vw - 12px);
    height: calc(100dvh - 76px);
    max-height: calc(100dvh - 76px);
    border-radius: 16px;
  }

  .sheet__head,
  .lightbox__head {
    padding: 14px 14px 12px;
  }

  .sheet__body {
    padding: 14px 14px 20px;
  }

  .welcome {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .profile-actions {
    gap: 12px;
  }

  .profile-actions .btn {
    min-width: 0;
    padding: 0 14px;
  }

  .sheet__body--split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
    height: auto;
  }

  .sheet--wide .sheet__body {
    overflow: auto;
  }

  .map-stage {
    order: -1;
    min-height: 240px;
  }

  .map {
    min-height: 240px;
  }

  .point-list {
    overflow-x: clip;
    overflow-y: visible;
    flex: none;
  }

  .quest {
    grid-template-columns: 36px 1fr;
  }

  .welcome__panel {
    min-height: 280px;
  }

  .lightbox__stage {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr auto;
  }

  .lightbox__figure {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .prize-grid {
    grid-template-columns: 1fr;
  }

  .sheet-hud__level {
    display: none;
  }

  .profile-actions {
    gap: 12px;
  }

  .profile-actions .btn {
    height: 44px;
    min-height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }

  .quest__foot .btn {
    width: 100%;
    min-height: 44px;
    height: 44px;
    padding: 0 12px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .quest:hover,
  .prize:hover,
  .spot:hover,
  .meter > i {
    transition: none;
    transform: none;
  }
}
