:root {
  --bg-primary: #ffffff;
  --fg-primary: #404040;
  --fg-inverse: #ffffff;
  --green-main: #33bc61;
  --green-soft: #c6f5bc;
  --green-check: #a2e54f;
  --green-text: #3e6e0e;
  --leaf-bg: #e2f7ed;
  --menu-bg: #f0f3f1;
  --back-bg: #f5f5f5;
  --border-light: #e5e5e5;
  --list-bg: #fbefcb;
  --list-border: #ede2c4;
  --list-title: #ab9160;
  --btn-disabled: #999999;
  --danger: #ff7654;
  --almost: #fcb32b;
  --modal-overlay: rgba(64, 64, 64, 0.8);
  --page-side: #f1f1f1;
  --max-w: 900px;
  --content-w: 600px;
  --content-h: 850px;
  --frame-w: 390px;
  --font: "Montserrat", sans-serif;
  --font-hand: "Caveat", "Figma Hand", cursive;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font);
  color: var(--fg-primary);
  background: var(--page-side);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  border: none;
  background: none;
  cursor: pointer;
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

#app-shell {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  background: var(--page-side);
}

#app {
  width: 100%;
  max-width: var(--max-w);
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center; /* centres the 600px content column inside 900px shell */
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
}

/* Content column — 600px wide, min 850px tall, centred inside the 900px shell */
.screen {
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: var(--content-w);
  min-height: var(--content-h);
  position: relative;
  background: var(--bg-primary);
}

.screen.active {
  display: flex;
}

/* —— Typography —— */
.t-heading {
  font-weight: 700;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: var(--fg-primary);
}

.t-large {
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
  color: var(--fg-primary);
}

.t-body {
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  color: var(--fg-primary);
}

.t-btn-big {
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: var(--fg-inverse);
}

.t-btn {
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 0.2px;
}

/* —— Buttons —— */
.btn-primary-big {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 72px;
  padding: 0 16px;
  border-radius: 12px;
  background: var(--green-main);
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  padding: 0 16px;
  border-radius: 12px;
  color: var(--fg-inverse);
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 60px;
  width: 138px;
  padding: 0 16px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid currentColor;
}

.btn-disabled {
  background: var(--btn-disabled) !important;
  pointer-events: none;
}

/* —— Header —— */
.app-header {
  position: relative;
  height: 56px;
  flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
}

.app-header__title {
  position: absolute;
  left: 48px;
  right: 48px;
  top: 50%;
  transform: translateY(-50%);
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
  color: var(--fg-primary);
}

.icon-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.icon-btn--back {
  left: 16px;
  background: var(--back-bg);
  border-radius: 16px;
}

.icon-btn--menu {
  right: 16px;
  background: var(--menu-bg);
  border-radius: 6px;
}

.icon-btn img {
  width: 16px;
  height: 16px;
}

/* —— Menu dropdown —— */
.menu-dropdown {
  display: none;
  position: absolute;
  top: 52px;
  right: 16px;
  z-index: 50;
  background: #f0f3f1;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px 20px;
  flex-direction: column;
  gap: 10px;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.menu-dropdown.open {
  display: flex;
}

.menu-dropdown button {
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 0.2px;
  color: var(--fg-primary);
  text-align: left;
  white-space: nowrap;
}

.menu-dropdown button:hover {
  opacity: 0.75;
}

/* —— Intro —— */
#screen-intro .screen-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  gap: 24px;
}

.welcome-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 30px;
  text-align: center;
}

.leaf-logo {
  width: 80px;
  height: 80px;
  border-radius: 40px;
  background: var(--leaf-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.leaf-logo img {
  width: 44px;
  height: 44px;
}

.rules-card {
  background: var(--green-soft);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 350px;
  margin: 0 auto;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.checkbox {
  flex-shrink: 0;
  background: var(--green-check);
  border: 2px solid var(--green-main);
  border-radius: 12px;
  padding: 6px;
  display: flex;
}

.checkbox img {
  width: 12px;
  height: 12px;
}

.checklist-item p {
  font-weight: 500;
  font-size: 14px;
  line-height: normal;
  color: #1a2f25;
}

.cta-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.cta-section .intro-footer {
  text-align: center;
}

.cta-section .intro-footer .bold {
  font-weight: 700;
}

/* —— Shop —— */
#screen-shop .shop-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  gap: 20px;
  overflow-y: auto;
}

.shop-top {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  position: relative;
}

.hra-bubble {
  flex: 1;
  background: var(--green-soft);
  border-radius: 8px;
  padding: 10px 16px;
  min-height: 64px;
  display: flex;
  align-items: center;
}

.hra-bubble p {
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  color: var(--green-text);
}

.shop-top .icon-btn--menu {
  position: relative;
  top: auto;
  right: auto;
  transform: none;
  flex-shrink: 0;
}

.aisles-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.aisle-card {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 84px;
  padding: 20px;
  border-radius: 16px;
  border: 3px solid;
  width: 100%;
  color: #fff;
  text-align: left;
}

.aisle-card__icon {
  flex-shrink: 0;
  padding: 10px;
  border-radius: 12px;
  border: none;
  display: flex;
}

.aisle-card__icon img {
  width: 24px;
  height: 24px;
}

.aisle-card__label {
  flex: 1;
  font-weight: 600;
  font-size: 20px;
  line-height: 24px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  color: #fff;
}

.aisle-card__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.shopping-list {
  background: var(--list-bg);
  border: 2px solid var(--list-border);
  border-radius: 6px;
  overflow: hidden;
  width: 100%;
  padding: 8px 0;
}

.shopping-list__title {
  font-weight: 600;
  font-size: 18px;
  line-height: 26px;
  text-align: center;
  color: var(--list-title);
}

.shopping-list__items {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 28px 24px;
}

.shopping-list__item {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 22px;
}

.shopping-list__item img {
  width: 22px;
  height: 22px;
}

.shopping-list__item span {
  font-family: var(--font-hand);
  font-weight: 700;
  font-size: 20px;
  line-height: 22px;
  color: var(--fg-primary);
}

.bottom-nav {
  flex-shrink: 0;
  background: #fff;
  padding: 20px;
  display: flex;
  gap: 20px;
  align-items: center;
}

.cart-badge {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: #f5f5f5;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

.cart-badge img {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 88px;
  height: 88px;
  transform: translate(-50%, -50%);
  object-fit: contain;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
}

.bottom-nav .btn-primary-big {
  flex: 1;
  height: 72px;
}

/* —— Aisle intro —— */
.aisle-intro-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.aisle-intro-text {
  padding: 35px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
  position: relative;
  z-index: 2;
  background: linear-gradient(180deg, #fff 70%, transparent);
}

.aisle-shelf-wrap {
  flex: 1;
  position: relative;
  min-height: 320px;
}

.aisle-shelf-wrap img.shelf {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.aisle-shelf-wrap .pick-btn {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  height: 72px;
  border-radius: 12px;
  border: 4px solid;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 8px 46px rgba(0, 0, 0, 0.14);
  color: #fff;
}

/* —— Product carousel —— */
.product-flow {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.product-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
  min-height: 0;
}

.product-stage__bg {
  position: absolute;
  inset: -40px;
  filter: blur(8px);
  z-index: 0;
}

.product-stage__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card {
  position: relative;
  z-index: 2;
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 340px;
  height: min(550px, 62vh);
  box-shadow: 0 8px 24px 4px rgba(0, 0, 0, 0.2), 0 8px 46px rgba(0, 0, 0, 0.14);
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}

.product-card__image-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px 12px;
  min-height: 0;
}

.product-card__image-wrap img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.product-card .btn-secondary {
  margin-bottom: 24px;
  flex-shrink: 0;
}

.product-actions {
  flex-shrink: 0;
  background: #fff;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.carousel-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.carousel-arrow {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.carousel-arrow img {
  width: 40px;
  height: 40px;
}

.pagination {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pagination span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d9d9d9;
}

.pagination span.active {
  background: currentColor;
}

/* —— Details modal —— */
.modal-overlay {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 40;
  background: var(--modal-overlay);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.details-modal {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 350px;
  max-height: 80vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.details-modal p.bold-block {
  font-weight: 700;
  font-size: 14px;
  line-height: 22px;
}

.details-modal p.note {
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
}

.details-bullet {
  display: flex;
  align-items: flex-start;
  gap: 0;
}

.details-bullet img {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 1px;
}

.details-bullet p {
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  flex: 1;
}

/* —— Added toast —— */
#screen-added {
  align-items: center;
  justify-content: center;
}

.added-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 60px;
  padding: 20px;
  text-align: center;
}

.added-content h1 {
  width: 218px;
}

.added-basket {
  width: 302px;
  height: 302px;
  animation: basket-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.added-basket img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes basket-pop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  60% {
    transform: scale(1.06);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

/* —— Extra question —— */
#screen-question {
  background: #c471d8;
}

.question-body {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 20px;
  width: 100%;
}

.question-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 8px 46px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}

.question-card--ask {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 20px;
}

.quiz-hero {
  width: 64px;
  height: 64px;
  border-radius: 32px;
  background: #fff3e0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quiz-hero img {
  width: 32px;
  height: 32px;
}

.answers-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.answer-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid #e5e5e5;
  border-radius: 12px;
  background: #fff;
  width: 100%;
  text-align: left;
}

.answer-letter {
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--green-soft);
  border: 2px solid var(--green-main);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 0.2px;
  color: var(--green-main);
}

.answer-btn__text {
  flex: 1;
  font-weight: 600;
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 0.2px;
  color: var(--fg-primary);
}

.answer-btn__chevron {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.feedback-banner {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
}

.feedback-banner__icon {
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.feedback-banner__icon img {
  width: 18px;
  height: 18px;
}

.feedback-banner__label {
  font-weight: 700;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  color: #fff;
}

.feedback-body {
  min-height: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 40px 20px;
  text-align: center;
}

.feedback-body .title {
  font-weight: 700;
  font-size: 26px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.feedback-actions {
  padding: 0 20px 20px;
  width: 100%;
}

.feedback-banner.correct {
  background: var(--green-main);
}
.feedback-banner.almost {
  background: var(--almost);
}
.feedback-banner.wrong {
  background: var(--danger);
}

.feedback-body .title.correct {
  color: var(--green-main);
}
.feedback-body .title.almost {
  color: var(--almost);
}
.feedback-body .title.wrong {
  color: var(--danger);
}

/* —— Outline button (Leave game) —— */
.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 60px;
  padding: 0 16px;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #1fb364;
  color: #1fb364;
}

.btn-outline[hidden] {
  display: none !important;
}

/* —— Cashier intro (Figma 6204:1127, 390×844) —— */
#screen-cashier {
  overflow: hidden;
  position: relative;
}

.cashier-top {
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  height: 32px;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0;
}

.cashier-top .icon-btn--menu {
  position: relative;
  top: auto;
  right: auto;
  transform: none;
}

.cashier-body {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.cashier-bubble {
  position: absolute;
  left: 50%;
  top: 69px;
  transform: translateX(-50%);
  width: min(334px, calc(100% - 56px));
  z-index: 2;
  pointer-events: none;
}

.cashier-bubble__bg {
  width: 100%;
  height: auto;
  display: block;
}

.cashier-bubble__text {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 18px;
  display: flex;
  align-items: center;
  padding: 24px 40px 20px 42px;
  font-weight: 600;
  font-style: italic;
  font-size: 18px;
  line-height: 1.35;
  color: #075129;
}

/* Tom: proportional positioning within the content column */
.cashier-tom {
  position: absolute;
  left: -8%;
  top: 38%;
  width: 100%;
  height: 58%;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0;
  pointer-events: none;
}

.cashier-tom img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  object-position: center bottom;
}

.cashier-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 20px;
  background: transparent;
  pointer-events: auto;
}

/* —— Evaluation —— */
.evaluate-flow {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.evaluate-stage {
  position: relative;
  height: 300px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
}

.evaluate-product {
  width: 204px;
  height: 300px;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.evaluate-product img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 12px;
}

.evaluate-avatar {
  position: absolute;
  width: 140px;
  height: 140px;
  left: calc(50% + 14px);
  top: 183px;
  object-fit: contain;
  background: transparent;
  pointer-events: none;
  z-index: 2;
}

.evaluate-copy {
  flex: 1;
  padding: 24px 20px 12px;
  overflow-y: auto;
  font-weight: 500;
  font-size: 14px;
  line-height: 22px;
  color: var(--fg-primary);
}

.evaluate-copy p {
  margin-bottom: 12px;
}

.evaluate-copy p:last-child {
  margin-bottom: 0;
}

.evaluate-rating {
  display: flex;
  align-items: center;
  gap: 6px;
}

.evaluate-rating__dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}

.evaluate-rating--yes .evaluate-rating__dot {
  background: #20bf38;
}

.evaluate-rating--almost .evaluate-rating__dot {
  background: #ffd31a;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.evaluate-rating--no .evaluate-rating__dot {
  background: #ef3b3b;
}

.evaluate-actions {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 12px 20px 24px;
}

.evaluate-nav {
  position: relative;
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.evaluate-prev {
  position: absolute;
  left: 0;
  top: 0;
  background: var(--green-main);
  display: none;
}

.evaluate-prev.visible {
  display: flex;
}

.evaluate-next {
  width: 120px;
  background: var(--green-main);
}

#evaluate-pagination {
  color: var(--green-main);
}

/* —— Complete —— */
#screen-complete {
  justify-content: space-between;
}

.complete-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 20px;
}

.complete-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px 0;
  text-align: center;
}

.complete-badge {
  width: 100px;
  height: 100px;
  border-radius: 50px;
  background: var(--leaf-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.complete-badge img {
  width: 56px;
  height: 56px;
}

.complete-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  text-align: center;
}

.complete-block {
  width: 100%;
  max-width: 350px;
}

.complete-block__title {
  font-weight: 700;
  font-size: 14px;
  line-height: 22px;
  margin-bottom: 12px;
  color: var(--fg-primary);
}

.complete-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: #fff;
}

@media (min-width: 600px) {
  #app {
    min-height: 100vh;
  }

  .product-card {
    height: 550px;
  }
}
