/* Woody Woodpecker UI — Pixel Art Theme (matching old React bot exactly) */

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-width: 0;
  min-height: var(--app-viewport-height);
  overflow-x: hidden;
}

html {
  min-width: 0;
  min-height: 100%;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  background: var(--bg);
}

/* Every route is mounted directly below #main. Previously those roots grew to
   the full Telegram Desktop viewport (often ~800px) while cards, carousels and
   typography were tuned for a phone. This single shell fixes all customer,
   game and admin routes without introducing a wrapper that could change the
   containing block of position:fixed modals. */
#main {
  width: 100%;
  max-width: var(--app-max-width);
  min-height: var(--app-viewport-height);
  padding-top: var(--safe-top); /* below the Telegram buttons in fullscreen (#117) */
  margin-inline: auto;
  overflow-x: clip;
}

#main > div {
  width: 100%;
  min-width: 0;
  min-height: var(--app-viewport-height) !important;
}

/* App container */
.app-container { min-height: var(--app-viewport-height); display: flex; flex-direction: column; }
.main-content { flex: 1; padding: 12px; padding-bottom: 100px; }

/* Page base */
.page { max-width: 600px; margin: 0 auto; }

/* Page header (from old bot) */
.page-header { padding: 20px 16px 16px; text-align: center; }
.page-icon { font-size: 44px; margin-bottom: 8px; filter: drop-shadow(3px 3px 0 #000); }
.page-title {
  font-size: 24px; font-weight: 800; color: var(--green);
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
  letter-spacing: 2px; margin-bottom: 6px;
}
.page-subtitle { font-size: 13px; color: var(--text2); }

/* Section title (from old bot) */
.section-title {
  font-size: 13px; font-weight: 700; color: var(--cyan);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
  text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}

/* Navigation bar */
.nav-bar {
  position: fixed; bottom: 0; left: 50%; right: auto;
  width: 100%; max-width: var(--app-max-width);
  transform: translateX(-50%);
  display: flex; justify-content: space-around; align-items: center;
  background-color: var(--bg2);
  border-top: 4px solid var(--border);
  padding: 8px 4px calc(8px + var(--safe-bottom));
  z-index: 1000;
}
/* All ten sections live in the bar, so every slot is an equal fraction of
   the viewport (`flex: 1 1 0` + `min-width: 0`) instead of being sized by
   its own content. Without that, the widest labels pushed the row past the
   screen edge and the last tabs were clipped out of reach. */
.bottom-nav > *,
.nav-bar > * { flex: 1 1 0; min-width: 0; }
/* Each slot is a router <a>; strip the default underline and inherited link
   colour so the tab styling below is the only thing that paints it. */
.bottom-nav > a,
.nav-bar > a { text-decoration: none; color: inherit; -webkit-tap-highlight-color: transparent; }

/* Every other link in the app, which until now had no rule at all.
 *
 * Dioxus `Link` renders a plain `<a href>`, and an `<a>` nobody colours takes
 * the user agent's blue with an underline. On this app's cards — `#16213e`,
 * dark blue — that is blue on blue: the profile's Quick Actions rows read as
 * broken rather than as links. The nav bar had a copy of this fix for its own
 * slots and nothing else did.
 *
 * An element selector, so anything that sets its own colour — the support
 * link, the referral link, a class, an inline style — still wins. This only
 * paints the links that were being left to the browser. */
a { color: var(--green); text-decoration: none; -webkit-tap-highlight-color: transparent; }
a:visited { color: var(--green); }
a:hover, a:focus-visible { color: var(--cyan); }
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 100%; min-width: 0;
  gap: 2px; padding: 2px 0; border: none; background: none;
  color: var(--text2); cursor: pointer;
  transition: all 0.15s; font-size: 10px; font-weight: 600;
}
.nav-item.active { color: var(--text); filter: none; }
.nav-svg { width: 22px; height: 22px; display: block; }
.theme-mark,
.lang-toggle {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  font-size: 13px;
  font-weight: 700;
}
.header, .screen-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.brand-head { display: block; width: 100%; }
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.brand-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.brand-lockup {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.brand-mark { width: 64px; height: 64px; display: block; flex: 0 0 64px; }
.brand-words { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}
.brand-place {
  margin-top: 3px;
  font-size: 8px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text2);
}
.brand-back {
  display: inline-flex;
  margin: 14px 16px 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--text2);
  font-size: 14px;
  cursor: pointer;
}
.screen-title { padding: 8px 16px 4px; }
.screen-title h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
}
.screen-title p {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.35;
  color: var(--text2);
}
.givel-page {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(70px + var(--safe-bottom));
}
.tier-grid, .stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.tier-grid { padding: 4px 16px 0; }
.tier-card, .stat-card, .plain-card {
  background: var(--card);
  border: 1px solid var(--border);
}
.tier-card, .stat-card { padding: 12px; }
/* The current tier is a ring, not an inverted fill: the dark theme forces the card
   background with !important, which made the inverted card dark text on dark. */
.tier-card.on { box-shadow: inset 0 0 0 2px var(--text); }
.tier-card.locked { border-style: dashed; }
.tier-name, .stat-value { font-size: 15px; font-weight: 600; letter-spacing: -0.02em; }
.tier-meta, .stat-label { margin-top: 4px; font-size: 12px; color: var(--text2); line-height: 1.3; }
.tier-badge {
  display: inline-block; margin-top: 8px; padding: 2px 8px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  border: 1px solid var(--border); color: var(--text2);
}
.tier-card.on .tier-badge { background: var(--text); border-color: var(--text); color: var(--card); }
.tier-head { color: var(--text); }
.tier-head-label { font-size: 12px; color: var(--text2); }
.tier-head-name { margin-top: 4px; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--text); }
.tier-bar { margin-top: 12px; height: 8px; background: var(--bg2); border: 1px solid var(--border); overflow: hidden; }
.tier-bar-fill { height: 100%; background: var(--text); }
.tier-head-sub { margin-top: 8px; font-size: 13px; color: var(--text); line-height: 1.35; }
.tier-head-note { margin-top: 6px; font-size: 12px; color: var(--text2); line-height: 1.35; }
.tier-grid-title { padding: 4px 16px 8px; font-size: 13px; font-weight: 600; color: var(--text); }
.plain-card { margin: 12px 16px; padding: 16px; }
.form-card { background: var(--card); border: 1px solid var(--border); margin: 8px 16px 16px; }
.form-card .form-body { padding: 16px 16px 0; }
.form-card .obj-btn { width: 100%; margin: 16px 0 0; border-radius: 0; }
.field {
  width: 100%;
  background: var(--bg2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 0;
  font-size: 15px;
  margin-bottom: 14px;
  font-family: inherit;
}
.note {
  margin: 16px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-line;
}
.nav-icon { font-size: 20px; line-height: 1.1; }
.nav-label {
  font-size: 9px; font-weight: 600; line-height: 1.1;
  max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Buttons (from old bot) */
.btn {
  font-family: inherit; font-size: 14px; font-weight: 700;
  padding: 12px 20px;
  border: 4px solid var(--border);
  box-shadow: 3px 3px 0 #000;
  cursor: pointer; transition: transform 0.1s, box-shadow 0.1s;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--green); color: #000;
  border: 4px solid #2d9e0f;
  box-shadow: 3px 3px 0 #000;
}
.btn-secondary {
  background: var(--bg2); color: var(--text);
  border: 4px solid var(--border);
  box-shadow: 3px 3px 0 #000;
}
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-lg { padding: 16px 24px; font-size: 16px; }

/* Light: black pill on white. Dark: white pill on black. */
.givel-btn,
.obj-btn,
.btn-view,
.btn-submit {
  appearance: none;
  -webkit-appearance: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.022em;
  text-transform: none;
  color: var(--bg);
  background: var(--text);
  border: none;
  border-radius: 980px;
  padding: 11px 18px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  width: 100%;
}
.catalog-grid { align-items: stretch; }
.obj-card { height: 100%; }
.obj-info { display: flex; flex-direction: column; flex: 1; padding-bottom: 0 !important; }
.obj-btn {
  width: 100%;
  margin-inline: 0;
  border-radius: 0 0 12px 12px;
  box-sizing: border-box;
}
/* A link styled as a button (profile "Open CRM", #108) is inline by default:
   its vertical padding then overlaps the text above. Make it a block. */
a.givel-btn {
  display: block;
  box-sizing: border-box;
  margin-top: 12px;
  text-align: center;
  text-decoration: none;
}
.givel-btn:hover,
.obj-btn:hover,
.btn-view:hover,
.btn-submit:hover { background: var(--text); }
.givel-btn:active,
.obj-btn:active,
.btn-view:active,
.btn-submit:active { background: var(--text); transform: none; box-shadow: none; }
/* Choices: the picked one is filled (above), the others and Back are outlined. */
.obj-btn.secondary,
.obj-btn.secondary:hover,
.obj-btn.secondary:active {
  color: var(--text);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--text);
}

.givel-btn-quiet,
.btn-contact {
  appearance: none;
  -webkit-appearance: none;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: -0.022em;
  text-transform: none;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 980px;
  padding: 11px 18px;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: none;
  width: 100%;
}
.givel-btn-quiet:hover,
.btn-contact:hover { background: rgba(0, 0, 0, 0.06); }

.filter-chip,
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 980px;
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: none;
  white-space: nowrap;
}
.filter-chip.on,
.radio-label.on {
  color: #fff;
  background: var(--text);
  border-color: var(--text);
}
/* Cards (from old bot — sharp corners, 4px borders, pixel shadow) */
.card {
  background-color: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  overflow: hidden;
}
.card.clickable { cursor: pointer; }
.card.clickable:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

/* Cards grid */
.cards-grid { display: flex; flex-direction: column; gap: 12px; }

/* Comet card 3D tilt (from old bot StrainCard) */
.comet-card {
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
  transform-style: preserve-3d;
  will-change: transform;
}
.comet-card:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), var(--pixel-shadow);
}
.set-card:active,
.strain-card:active,
.comet-card:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}

/* Strain card */
.strain-card {
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  overflow: hidden;
}

/* Strain visual (category gradient overlay) */
.strain-visual {
  aspect-ratio: 853/1280;
  position: relative;
  overflow: hidden;
}
.strain-visual.sativa {
  background: linear-gradient(135deg, rgba(255,230,0,0.2), transparent);
}
.strain-visual.indica {
  background: linear-gradient(135deg, rgba(179,136,255,0.2), transparent);
}
.strain-visual.hybrid {
  background: linear-gradient(135deg, rgba(57,255,20,0.2), transparent);
}
.strain-visual img {
  width: 100%; height: 100%; object-fit: cover;
  transition: opacity 0.5s ease;
}

/* Category badges */
.type-badge { display: inline-block; padding: 2px 8px; font-size: 13px; }
.type-badge.sativa { color: var(--yellow); }
.type-badge.indica { color: var(--purple); }
.type-badge.hybrid { color: var(--green); }

/* Strain content */
.strain-content { padding: 12px; }
.strain-name { font-size: 17px; font-weight: 700; text-shadow: 2px 2px 0 rgba(0,0,0,0.1); margin-bottom: 4px; }
.strain-price { font-size: 20px; font-weight: 800; color: var(--yellow); text-shadow: 2px 2px 0 rgba(0,0,0,0.1); }
.strain-thc, .strain-cbd { font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.strain-description { font-size: 13px; color: var(--text2); margin-bottom: 8px; line-height: 1.4; }
.strain-effect { font-size: 13px; color: var(--text2); }

/* Set card */
.set-card {
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.set-card.featured-set {
  border-color: var(--green);
  box-shadow: var(--pixel-shadow), 0 0 20px rgba(57,255,20,0.2);
}
.set-visual {
  aspect-ratio: 1/1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(57,255,20,0.1), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.set-visual img {
  width: 100%; height: 100%; object-fit: cover;
}
.set-icon {
  font-size: 64px;
  filter: drop-shadow(3px 3px 0 #000);
}
.set-body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.set-type {
  font-size: 11px;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}
.set-name {
  font-size: 16px; font-weight: 700; text-shadow: 2px 2px 0 rgba(0,0,0,0.1); margin-bottom: 4px;
}
.set-description {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 12px;
  line-height: 1.4;
  flex: 1;
}
.set-price-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.set-price {
  font-size: 22px; font-weight: 800; color: var(--yellow); text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}
.set-original-price {
  font-size: 14px;
  color: var(--text2);
  text-decoration: line-through;
}
.set-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: var(--green);
  color: #000;
  font-size: 12px;
  padding: 4px 8px;
  font-weight: 700;
  box-shadow: 2px 2px 0 #000;
  z-index: 10;
}
.set-badge.featured {
  background: var(--yellow);
  font-size: 14px;
  padding: 6px 12px;
}
.set-out-of-stock {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--red);
}
.set-card-body { padding: 14px; }
.sets-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.featured-sets {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
@media (min-width: 600px) {
  .sets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .featured-sets {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* Accessory card */
.accessory-visual {
  aspect-ratio: 1/1;
  background: linear-gradient(135deg, rgba(0,255,255,0.1), transparent);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
}

/* Filter chips (pill shape from old bot) */
.filter-tabs { display: flex; gap: 6px; margin-bottom: 12px; overflow-x: auto; padding-bottom: 4px; }
.filter-tab {
  padding: 8px 16px; font-size: 12px; font-weight: 600;
  background: var(--bg2); color: var(--text);
  border: 3px solid var(--border);
  border-radius: 20px;
  cursor: pointer; white-space: nowrap;
  transition: all 0.15s;
}
.filter-tab.active {
  border-color: var(--green); color: var(--green);
  background: rgba(57,255,20,0.15);
}
.filter-tab:active { transform: translate(2px, 2px); box-shadow: none; }

/* Cart items */
.cart-items { display: flex; flex-direction: column; gap: 10px; }
.cart-item {
  display: flex; gap: 12px; padding: 12px;
  background: var(--card); border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
}
.cart-item-remove {
  width: 32px; height: 32px;
  background: rgba(255,71,87,0.2);
  border: 3px solid var(--red);
  color: var(--red); font-size: 18px;
  cursor: pointer;
}
.qty-btn {
  width: 28px; height: 28px;
  background: var(--bg2); border: 3px solid var(--border);
  font-size: 16px; font-weight: 700;
  cursor: pointer; color: var(--text);
}
.cart-summary {
  padding: 16px;
  background: var(--bg2);
  border-top: 4px solid var(--border);
}

/* Checkout */
.form-input {
  width: 100%; padding: 12px 16px;
  font-size: 16px;
  background: var(--bg2);
  border: 4px solid var(--border);
  color: var(--text); font-family: inherit;
}
.form-input:focus { outline: none; border-color: var(--green); }

/* Order card */
.order-card {
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  overflow: hidden;
}

/* Order status badges */
.order-status {
  font-size: 13px; padding: 4px 12px;
  border: 2px solid; font-weight: 700;
}
.status-pending { background: rgba(255,230,0,0.2); color: var(--yellow); border-color: var(--yellow); }
.status-confirmed { background: rgba(57,255,20,0.2); color: var(--green); border-color: var(--green); }
.status-ready { background: rgba(0,229,255,0.2); color: var(--cyan); border-color: var(--cyan); }
.status-completed { background: rgba(136,136,170,0.2); color: var(--text2); border-color: var(--text2); }

/* Modal */
.modal-backdrop {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 16px; backdrop-filter: blur(4px);
}
.modal-content {
  background-color: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  max-width: 100%; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
}

/* Loading */
.loading-container {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 48px;
}

/* Success page */
.success-icon { font-size: 70px; text-align: center; }
.success-title { font-size: 24px; font-weight: 800; color: var(--green); }

/* Strain grid (menu page) */
.strain-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding: 0 16px;
}

/* Product card */
.product-card {
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.product-image {
  aspect-ratio: 1/1;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(0,229,255,0.1), transparent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-image img {
  width: 100%; height: 100%; object-fit: cover;
}
.product-placeholder {
  font-size: 48px;
  filter: drop-shadow(3px 3px 0 #000);
}
.product-badge {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--red);
}
.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.product-name {
  font-size: 15px; font-weight: 700; text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}
.product-description {
  font-size: 13px;
  color: var(--text2);
  line-height: 1.4;
}
.product-price {
  font-size: 18px; font-weight: 800; color: var(--yellow); text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 0 16px;
}

/* SOTD badge */
.sod-badge {
  display: inline-block; background: var(--yellow); color: #000;
  font-size: 13px; padding: 4px 8px; font-weight: 700;
  box-shadow: 2px 2px 0 #000;
}

/* TZ #2 marketing badges (cycle #132) — colours mirror the inline
   badges in src/ui/screens/menu_screen.rs::render_strain_card so the
   shared `StrainCard` component's visual matches the home menu. */
.new-badge {
  display: inline-block; background: #00e5ff; color: #000;
  font-size: 13px; padding: 4px 8px; font-weight: 700;
  box-shadow: 2px 2px 0 #000;
}
.best-badge {
  display: inline-block; background: #ff9d00; color: #000;
  font-size: 13px; padding: 4px 8px; font-weight: 700;
  box-shadow: 2px 2px 0 #000;
}
.sale-badge {
  display: inline-block; background: #ff4757; color: #fff;
  font-size: 13px; padding: 4px 8px; font-weight: 700;
  box-shadow: 2px 2px 0 #000;
}
/* Sale-price strikethrough vs new-price emphasis. */
.strain-price .price-old {
  text-decoration: line-through;
  color: #888;
  margin-right: 8px;
}
.strain-price .price-sale {
  color: #ff4757;
  font-weight: 800;
}
.sod-card {
  background: var(--card);
  border: 4px solid var(--green);
  box-shadow: var(--pixel-shadow), 0 0 20px rgba(57,255,20,0.2);
  overflow: hidden;
}
.sod-image {
  aspect-ratio: 1/1;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(57,255,20,0.1), transparent);
}
.sod-image img {
  width: 100%; height: 100%; object-fit: cover;
}
.sod-content {
  padding: 12px;
}
.sod-name {
  font-size: 18px; font-weight: 700; text-shadow: 2px 2px 0 rgba(0,0,0,0.1);
  margin-bottom: 4px;
}
.sod-type {
  font-size: 13px;
  color: var(--text2);
  margin-bottom: 8px;
}

/* QR card (profile) */
.qr-card {
  margin: 20px 0; padding: 28px 16px 24px;
  background: var(--bg2);
  border: 4px solid var(--green);
  box-shadow: 4px 4px 0 #000, 0 0 20px rgba(57,255,20,0.1);
  text-align: center;
}

/* Stats grid (profile) */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* Quick actions */
.quick-action {
  background: var(--bg2);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  padding: 12px 14px; margin-bottom: 8px;
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer;
}

/* Progress bar (profile tier) */
.tier-progress {
  background: var(--bg2);
  border: 4px solid var(--border);
  padding: 14px;
}
.progress-bar-track {
  height: 8px; background: rgba(0,0,0,0.4);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--yellow));
  transition: width 0.3s;
}

/* Referral link box */
.referral-box {
  background: var(--bg);
  border: 4px solid var(--border);
  padding: 6px 8px;
}

/* Language switcher */
.lang-btn {
  font-family: inherit;
  font-size: 13px; padding: 8px;
  border: 4px solid var(--border);
  cursor: pointer;
}
.lang-btn.active {
  background: rgba(57,255,20,0.08);
  color: var(--green);
  border-color: var(--green);
}

/* Quest/Adventure cards */
.quest-card {
  box-shadow: var(--pixel-shadow);
  cursor: pointer;
}

/* Admin stat */
.admin-stat {
  text-align: center; padding: 12px;
  background: var(--bg2);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
}
.admin-stat-value { font-size: 24px; font-weight: 800; }

/* Tech tree node */
.tech-node {
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  padding: 12px;
}

/* Garden plant card */
.plant-card {
  background: var(--card);
  border: 4px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

/* Animations */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes pulse { 0%, 80%, 100% { transform: scale(0); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }
@keyframes game-pulse { 0% { transform: scale(1); } 50% { transform: scale(1.04); } 100% { transform: scale(1); } }
@keyframes game-bounce { from { transform: scale(1); } to { transform: scale(1.1); } }
@keyframes floater-rise {
  0% { transform: translateX(-50%) translateY(0); opacity: 1; }
  100% { transform: translateX(-50%) translateY(-40px); opacity: 0; }
}

.fade-in { animation: fadeIn 0.15s ease-out; }

/* Skeleton loader */
.skeleton {
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* Bottom nav (pixel art) */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; right: auto;
  width: 100%; max-width: var(--app-max-width);
  transform: translateX(-50%);
  background: var(--bg2);
  border-top: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
  display: flex; align-items: stretch;
  justify-content: space-between;
  padding: 6px 2px calc(6px + var(--safe-bottom));
  z-index: 100;
}
.cart-badge {
  /* Ten tabs make each slot ~36px wide, so the old -8px overhang bled onto
     the neighbouring tab. Keep the badge inside its own slot. */
  position: absolute; top: -3px; right: 1px;
  background: var(--red); color: #fff;
  border: 1px solid var(--bg2);
  font-size: 9px; min-width: 14px; height: 14px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}

/* Deal of day / Strain of day banners (from old bot) */
.deal-banner {
  background: linear-gradient(135deg, #ff6b35, #f7931e);
  border: 4px solid #ff6b35;
  box-shadow: 0 4px 15px rgba(255,107,53,0.4), var(--pixel-shadow);
  padding: 16px;
  cursor: pointer;
}

/* Sommelier card */
.sommelier-card {
  background: var(--card);
  border: 4px solid var(--purple);
  box-shadow: var(--pixel-shadow), 0 0 20px rgba(179,136,255,0.2);
  padding: 20px;
}

/* Fact card (home) */
.fact-card {
  background: linear-gradient(135deg, #dcfce7, #bbf7d0);
  border: 2px solid var(--green);
  box-shadow: 0 0 12px rgba(16,185,129,0.2);
  padding: 16px;
}

/* Home page */
.home-page { padding: 0; }
.header {
  text-align: center;
  padding: 24px 16px 16px;
}
.logo {
  width: 80px; height: 80px;
  margin-bottom: 12px;
}
.subtitle {
  font-size: 13px; color: var(--text2);
}
.hero {
  padding: 16px;
}
.hero h2 {
  font-size: 16px; font-weight: 700;
  color: var(--green);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.categories {
  padding: 16px;
}
.categories h2 {
  font-size: 16px; font-weight: 700;
  color: var(--cyan);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.category-card {
  background: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  padding: 16px 8px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}
.category-card:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 #000;
}
.category-icon {
  width: 48px; height: 48px;
  margin-bottom: 8px;
}
.category-icon.emoji {
  font-size: 40px;
  display: flex; align-items: center; justify-content: center;
}
.category-name {
  font-size: 12px; font-weight: 700;
  text-shadow: 1px 1px 0 rgba(0,0,0,0.1);
}
.quick-links {
  padding: 0 16px 16px;
}
.quest-banner {
  background: linear-gradient(135deg, #c4b5fd, #a78bfa);
  border: 4px solid var(--purple);
  box-shadow: var(--pixel-shadow), 0 0 20px rgba(139,92,246,0.2);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.quest-icon {
  font-size: 36px;
}
.quest-text {
  flex: 1;
}
.quest-title {
  font-size: 16px; font-weight: 700; margin-bottom: 4px;
}
.quest-desc {
  font-size: 13px; color: var(--text2);
}

/* Admin tabs — always horizontal scroll, 13 tabs don't fit on any screen */
.admin-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  border-radius: 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tabs > button {
  flex: 0 0 auto !important; /* override inline flex:1 */
  white-space: nowrap;
  min-height: 44px;
}

@media (max-width: 380px) {
  .admin-tabs > button {
    padding: 8px 10px !important;
    font-size: 12px !important;
  }
}

/* Ten tabs across a narrow phone leave ~36px per slot — too little for a
   readable label, so below 420px the icons carry the bar on their own.
   Above it the labels fit and stay. */
@media (max-width: 420px) {
  .nav-label { display: none; }
  .nav-icon { font-size: 21px; }
}

/* ── Modal (pixel art) ─────────────────────────────────────── */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000; padding: 16px; backdrop-filter: blur(4px);
  animation: fadeIn 0.15s ease-out;
}
.modal {
  background-color: var(--card);
  border: 4px solid var(--border);
  box-shadow: var(--pixel-shadow);
  max-width: 100%; max-height: 90vh;
  overflow: hidden; display: flex; flex-direction: column;
  border-radius: 4px;
  animation: popIn 0.15s ease-out;
}
.modal-sm { max-width: 320px; }
.modal-md { max-width: 480px; }
.modal-lg { max-width: 640px; }
.modal-full { width: 100%; height: 100%; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 2px solid var(--border);
  background: var(--bg2);
}
.modal-title {
  font-size: 15px; font-weight: 700; color: var(--green);
  margin: 0; text-transform: uppercase; letter-spacing: 1px;
}
.modal-close {
  background: none; border: none; color: var(--text2);
  font-size: 20px; cursor: pointer; padding: 0 4px;
  line-height: 1; min-width: 32px; min-height: 32px;
  display: flex; align-items: center; justify-content: center;
}
.modal-body {
  padding: 16px; overflow-y: auto;
  max-height: calc(90vh - 60px);
}

/* ── Toast notifications ───────────────────────────────────── */
.toast-container {
  position: fixed; top: 16px; right: 16px;
  z-index: 3000; display: flex; flex-direction: column; gap: 8px;
  max-width: 360px; width: calc(100% - 32px);
  pointer-events: none;
}
.toast {
  background: var(--card);
  border: 3px solid var(--border);
  box-shadow: var(--pixel-shadow);
  padding: 12px 16px; border-radius: 4px;
  display: flex; align-items: flex-start; gap: 10px;
  animation: fadeIn 0.2s ease-out, popIn 0.2s ease-out;
  pointer-events: auto;
}
.toast-success { border-color: var(--green); }
.toast-error   { border-color: var(--red); }
.toast-warning { border-color: var(--yellow); }
.toast-info    { border-color: var(--cyan); }
.toast-icon {
  font-size: 18px; flex-shrink: 0; margin-top: 1px;
}
.toast-body {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
}
.toast-title {
  font-size: 13px; font-weight: 700; color: var(--text);
}
.toast-message {
  font-size: 12px; color: var(--text2); line-height: 1.4;
}
.toast-close {
  background: none; border: none; color: var(--text2);
  font-size: 16px; cursor: pointer; padding: 0 2px;
  line-height: 1; min-width: 24px; min-height: 24px;
  display: flex; align-items: center; justify-content: center;
}

/* ── Empty state ───────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 32px 16px;
  display: flex; flex-direction: column;
  align-items: center; gap: 8px;
}
.empty-state-icon { font-size: 40px; }
.empty-state-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin: 0;
}
.empty-state-description {
  font-size: 13px; color: var(--text2); line-height: 1.5;
  max-width: 260px;
}
.empty-state-action { margin-top: 4px; }

/* ── Skeleton loader ───────────────────────────────────────── */
.skeleton-loader {
  display: inline-block;
  background: linear-gradient(90deg, var(--bg2) 25%, var(--bg) 50%, var(--bg2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
.skeleton-text   { width: 100%; height: 14px; }
.skeleton-text-sm{ width: 60%; height: 12px; }
.skeleton-title  { width: 70%; height: 18px; }
.skeleton-avatar { width: 36px; height: 36px; border-radius: 6px; }
.skeleton-avatar-lg { width: 64px; height: 64px; border-radius: 6px; }
.skeleton-card   { width: 100%; height: 80px; }
.skeleton-btn    { width: 80px; height: 36px; }
/* Content-specific skeleton placeholders (UX loop #2) */
.skeleton-pack    { width: 70%; flex: 0 0 70%; aspect-ratio: 1 / 1.35; border: 4px solid var(--accent); border-radius: 4px; box-shadow: 4px 4px 0 #000; }
.skeleton-sotd    { width: 100%; height: 220px; border: 4px solid #ff6b35; border-radius: 4px; box-shadow: 4px 4px 0 #000; }
.skeleton-event   { width: 100%; height: 120px; border: 4px solid var(--border); border-radius: 4px; box-shadow: 4px 4px 0 #000; }
.skeleton-orders  { width: 100%; height: 96px; border: 4px solid var(--border); border-radius: 4px; box-shadow: 4px 4px 0 #000; margin-bottom: 12px; }
.skeleton-member-card { width: 100%; height: auto; aspect-ratio: 1.586; border: 4px solid var(--border); border-radius: 12px; box-shadow: 4px 4px 0 #000; }
.skeleton-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 8px 0;
}

/* ── Service cards (transport, services): normal flow, no fixed heights ── */
.svc-head { padding: 16px 16px 0; }
.svc-head-title { font-weight: 700; font-size: 20px; color: var(--text); margin-bottom: 6px; }
.svc-head-sub { font-size: 14px; line-height: 1.4; color: var(--text2); margin-bottom: 20px; }
.svc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 16px 24px;
  align-items: stretch;
}
.svc-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  height: auto;
}
.svc-pic { display: block; }
.svc-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  background: var(--bg2);
}
.svc-img.svc-brand { object-fit: contain; padding: 24px; box-sizing: border-box; }
.svc-body { flex: 1; padding: 12px 12px 0; }
.svc-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.25; }
.svc-desc {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.svc-foot { padding: 12px; }
.svc-card .obj-btn { border-radius: 980px; margin: 0; }
@media (max-width: 420px) {
  .svc-grid { grid-template-columns: 1fr; }
}

/* Manager onboarding (/onboarding): layout only; colours come from the theme variables. */
.onb-card { margin: 12px 16px; padding: 16px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.onb-progress { font-size: 13px; color: var(--text2); margin-bottom: 6px; }
.onb-title { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.onb-text { font-size: 15px; line-height: 1.4; color: var(--text); margin-bottom: 16px; }
.onb-hint { font-size: 13px; color: var(--text2); margin: 8px 0 12px; }
.onb-error { font-size: 14px; color: var(--red); margin: 8px 0; }
.onb-upload { display: block; font-size: 14px; color: var(--text); margin-bottom: 8px; }
.onb-file { display: block; min-height: 44px; width: 100%; margin-top: 6px; color: var(--text); }
.onb-preview { display: block; width: 160px; height: 160px; object-fit: cover; margin: 12px 0; border: 1px solid var(--border); border-radius: 8px; }
.onb-consent { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; color: var(--text); cursor: pointer; }
.onb-consent input { width: 22px; height: 22px; accent-color: var(--text); }
.onb-actions { display: flex; gap: 12px; margin-top: 16px; }
.onb-actions .givel-btn, .onb-actions .givel-btn-quiet { min-height: 44px; }

/* Training (/training): layout only; colours come from the theme variables.
   Screen sits above the fixed nav-bar, same contract as .main-content. */
.training-screen {
  min-height: 100vh;
  padding: 12px 12px calc(90px + var(--safe-bottom));
  max-width: var(--app-max-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.training-header { display: flex; flex-direction: column; gap: 10px; }
.training-title { font-size: 24px; font-weight: 700; color: var(--text); margin: 0; }
.header-actions { display: flex; }
.search-input {
  width: 100%; min-height: 44px;
  padding: 10px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 980px;
  color: var(--text);
  font-size: 15px;
  outline: none;
}
.search-input::placeholder { color: var(--text2); }
.filter-controls { display: flex; flex-direction: column; gap: 10px; }
.lesson-count { font-size: 13px; color: var(--text2); }
.lessons-grid { display: flex; flex-direction: column; gap: 12px; }
.lesson-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-sm);
}
.lesson-header { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.lesson-header h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 0; }
.lesson-category {
  font-size: 11px; color: var(--text2);
  border: 1px solid var(--border);
  border-radius: 980px;
  padding: 3px 9px;
  white-space: nowrap;
}
.lesson-body { display: flex; flex-direction: column; gap: 4px; }
.lesson-body p { font-size: 13px; color: var(--text2); margin: 0; overflow-wrap: anywhere; }
.lesson-footer { display: flex; }
.lesson-btn {
  min-height: 40px; width: 100%;
  padding: 8px 16px;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 980px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.lesson-btn:active { opacity: 0.85; }
.no-results { padding: 24px 8px; text-align: center; }
.no-results p { font-size: 14px; color: var(--text2); margin: 4px 0; }
.filter-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}
.filter-section h3 { font-size: 15px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.filter-section p { font-size: 13px; color: var(--text2); margin: 4px 0; }
.training-footer { padding: 4px 8px 0; }
.training-footer p { font-size: 12px; color: var(--text2); margin: 0; }

/* Lesson detail (/training/:id): layout only; colours from theme variables. */
.lesson-meta { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.meta-row { display: flex; gap: 6px; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.meta-label { color: var(--text2); }
.lesson-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
