/* ==========================================================================
   Foodbox · constructor.xplanet.store · 2026 design system
   ========================================================================== */

:root {
  /* Surfaces */
  --bg: #0c0c0e;              /* deep almost-black */
  --bg-up: #161618;            /* elevated surface */
  --bg-card: #1c1c1f;          /* card */
  --bg-card-hover: #232327;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);

  /* Text */
  --fg: #f5f3ef;               /* primary text — warm cream-white */
  --fg-dim: #a0a0a4;            /* secondary */
  --fg-mute: #6b6b70;           /* tertiary */

  /* Accents */
  --accent: #ff6b35;           /* warm coral — appetite */
  --accent-hover: #ff5a23;
  --accent-soft: rgba(255,107,53,0.14);
  --good: #4ade80;
  --warn: #fbbf24;

  /* Effects */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --shadow-glow: 0 10px 40px -10px rgba(255,107,53,0.35);
  --grad-accent: linear-gradient(135deg, #ff6b35, #ff9a5b);
  --grad-text: linear-gradient(135deg, #f5f3ef, #a0a0a4);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'ss01', 'cv11';
  min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; transition: opacity 0.15s; }
a:hover { opacity: 0.75; }
img, video { max-width: 100%; display: block; }

/* ============== NAV ============== */
.nav {
  position: sticky; top: 0; z-index: 30;
  background: rgba(12,12,14,0.88);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  max-width: 1180px; margin: 0 auto;
  padding: 14px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
.brand {
  display: flex; align-items: center; gap: 4px;
  font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
  color: var(--fg);
}
.brand-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--grad-accent);
  display: inline-block; margin-left: 4px;
  box-shadow: 0 0 12px var(--accent);
}
.nav-actions { display: flex; align-items: center; gap: 8px; }

.credits-pill {
  background: var(--accent-soft);
  color: var(--accent);
  padding: 6px 12px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  border: 1px solid rgba(255,107,53,0.3);
  text-decoration: none !important;
  display: inline-flex; align-items: center; gap: 4px;
}
.credits-pill:hover { background: rgba(255,107,53,0.2); }
.credits-pill.low { background: rgba(251,191,36,0.15); color: var(--warn); border-color: rgba(251,191,36,0.3); }

.lang-switch {
  display: inline-flex; gap: 1px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px;
}
.lang-btn {
  padding: 4px 10px; border: none; background: transparent;
  font-size: 11px; font-weight: 700; letter-spacing: 0.04em;
  color: var(--fg-mute); cursor: pointer; border-radius: 999px;
  font-family: inherit;
  transition: all 0.15s;
}
.lang-btn.active { background: var(--fg); color: var(--bg); }
.lang-btn:not(.active):hover { color: var(--fg); }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 20px; border: none; border-radius: var(--r-sm);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: transform .12s ease, opacity .15s ease, background 0.15s, box-shadow 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 4px 14px -2px rgba(255,107,53,0.4);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px -2px rgba(255,107,53,0.55); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.4; cursor: default; transform: none; box-shadow: none; }
.btn-ghost {
  background: transparent; color: var(--fg);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { background: var(--bg-card); border-color: var(--fg-mute); }
.btn-dark { background: var(--bg-card); color: var(--fg); border: 1px solid var(--line); }
.btn-dark:hover { background: var(--bg-card-hover); }
.btn-lg { padding: 16px 32px; font-size: 16px; border-radius: var(--r-md); }
.btn-sm { padding: 7px 14px; font-size: 12px; }
.btn-block { width: 100%; }

/* ============== INPUTS ============== */
.input {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  color: var(--fg); font-size: 14px;
  outline: none;
  transition: border-color .15s ease, background 0.15s;
  font-family: inherit;
}
.input:focus { border-color: var(--accent); background: var(--bg-card-hover); }
.input::placeholder { color: var(--fg-mute); }
.label { display: block; font-size: 12px; color: var(--fg-dim); margin-bottom: 6px; font-weight: 500; letter-spacing: 0.02em; }

/* ============== LAYOUT ============== */
.container { max-width: 1180px; margin: 0 auto; padding: 22px 22px; }
.section { padding: 50px 0; }
.center { text-align: center; }
.card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px;
}

.h1 {
  font-size: clamp(32px, 6vw, 64px);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.04em;
  margin: 0 0 18px;
}
.h1 .grad {
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.h2 { font-size: clamp(22px, 3vw, 32px); font-weight: 700; letter-spacing: -0.02em; margin: 0 0 12px; }
.h3 { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.lead { color: var(--fg-dim); font-size: clamp(15px, 1.6vw, 18px); max-width: 56ch; margin: 0 auto; line-height: 1.55; }
.muted { color: var(--fg-mute); font-size: 13px; }
.eyebrow {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--line);
  color: var(--fg-dim);
  padding: 5px 14px; border-radius: 999px;
  font-size: 12px; letter-spacing: 0.08em; font-weight: 600; text-transform: uppercase;
  margin-bottom: 20px;
}
.eyebrow .dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--good);
  display: inline-block; margin-right: 6px; animation: pulse 1.6s ease infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ============== GALLERY TILES ============== */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 32px;
}
.tile {
  position: relative;
  aspect-ratio: 3/4;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
  transition: transform .25s cubic-bezier(.4,0,.2,1), box-shadow .25s;
  cursor: pointer;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 20px 40px -20px rgba(0,0,0,0.6); }
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(0deg, rgba(0,0,0,0.92), transparent 80%);
  color: #fff;
  padding: 30px 14px 14px;
  font-size: 13px;
}
.tile-title { font-weight: 700; line-height: 1.2; }
.tile-author { font-size: 11px; opacity: 0.7; margin-top: 4px; }
.tile-likes {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  color: #fff;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; gap: 3px;
}
.tile-placeholder {
  background: var(--bg-up);
  display: flex; align-items: center; justify-content: center;
  color: var(--fg-mute); font-size: 12px;
}

/* ============== STEPS PROGRESS ============== */
.steps {
  display: flex; gap: 6px; justify-content: center;
  margin: 28px 0 28px;
  flex-wrap: wrap;
}
.step-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--fg-dim);
  border: 1px solid var(--line);
  cursor: pointer; user-select: none;
  transition: all 0.15s;
}
.step-pill:hover { color: var(--fg); }
.step-pill.done { background: rgba(74,222,128,0.1); color: var(--good); border-color: rgba(74,222,128,0.3); }
.step-pill.active { background: var(--grad-accent); color: #fff; border-color: transparent; box-shadow: var(--shadow-glow); }
.step-pill .step-no {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%;
  background: var(--line); color: var(--fg-dim);
  font-size: 10px; line-height: 18px; text-align: center; font-weight: 700;
}
.step-pill.done .step-no { background: var(--good); color: #0c0c0e; }
.step-pill.active .step-no { background: rgba(255,255,255,0.25); color: #fff; }
.step-pill .step-count {
  background: rgba(255,255,255,0.18);
  color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 1px 6px; border-radius: 999px;
}
.step-pill:not(.active) .step-count { background: var(--accent); color: #fff; }

.step-head { margin: 0 0 24px; }
.step-head h2 { font-size: clamp(20px, 2.8vw, 28px); font-weight: 700; margin: 0 0 6px; letter-spacing: -0.02em; }
.step-head p { color: var(--fg-dim); font-size: 14px; margin: 0; }

/* ============== BUILD LAYOUT ============== */
.build-layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 30px;
}
@media (max-width: 880px) { .build-layout { grid-template-columns: 1fr; } }

.summary {
  position: sticky;
  top: 78px;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 18px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow: auto;
}
.summary h3 {
  margin: 0 0 12px;
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--fg-mute);
}
.summary-empty {
  color: var(--fg-mute); font-size: 13px; padding: 20px 0; text-align: center;
}
.summary-row {
  display: flex; gap: 12px; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.summary-row:last-child { border-bottom: 0; }
.summary-row .sum-pic {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--bg-up);
  flex: 0 0 42px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.summary-row .sum-pic img { max-width: 100%; max-height: 100%; object-fit: contain; }
.summary-row .sum-meta { flex: 1; min-width: 0; }
.summary-row .sum-cat {
  font-size: 10px; color: var(--fg-mute);
  text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600;
}
.summary-row .sum-name {
  font-size: 13px; font-weight: 600; color: var(--fg);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.summary-row .sum-remove {
  background: transparent; border: none; color: var(--fg-mute);
  font-size: 16px; padding: 4px 8px; cursor: pointer; border-radius: 6px;
}
.summary-row .sum-remove:hover { background: var(--bg-up); color: var(--accent); }

.summary-meter {
  margin: 16px 0 0; padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 11px; color: var(--fg-mute);
  display: flex; align-items: center; gap: 8px;
  font-weight: 600; letter-spacing: 0.03em;
  text-transform: uppercase;
}
.summary-meter-bar { flex: 1; height: 4px; background: var(--bg-up); border-radius: 999px; overflow: hidden; }
.summary-meter-bar > div {
  height: 100%; background: var(--grad-accent);
  transition: width .25s ease;
}
.summary-meter.full .summary-meter-bar > div { background: var(--warn); }
.summary-meter.full { color: var(--warn); }

/* ============== PICKER GRID ============== */
.picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}
.picker-item {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(.4,0,.2,1);
}
.picker-item:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.picker-item.selected {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  box-shadow: 0 0 0 1px var(--accent), 0 8px 24px -8px rgba(255,107,53,0.4);
  transform: translateY(-2px);
}
.picker-item.selected::after {
  content: "✓"; position: absolute; top: 8px; right: 8px;
  background: var(--accent); color: #fff;
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
  box-shadow: 0 2px 8px rgba(255,107,53,0.5);
}
.picker-item .pic {
  aspect-ratio: 1/1;
  background: var(--bg-up);
  overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.picker-item .pic img {
  max-width: 88%; max-height: 88%;
  object-fit: contain;
}
.picker-item .name {
  padding: 10px 12px;
  font-size: 13px; font-weight: 600; color: var(--fg);
  line-height: 1.3;
}
.picker-item .name small {
  display: block; color: var(--fg-mute); font-weight: 400; font-size: 11px; margin-top: 2px;
}

.subgroup-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 22px;
}
.subgroup-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px;
  background: var(--bg-card); color: var(--fg-dim);
  border: 1px solid var(--line);
  font-size: 13px; font-weight: 500; cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}
.subgroup-tab:hover { color: var(--fg); }
.subgroup-tab.active { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.subgroup-tab .sub-count {
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; line-height: 16px; text-align: center;
  padding: 0 4px;
  border-radius: 999px;
}
.subgroup-tab.active .sub-count { background: var(--bg); color: var(--accent); }

.skip-btn { font-size: 13px; color: var(--fg-mute); padding: 7px 14px; cursor: pointer; background: none; border: none; font-family: inherit; }
.skip-btn:hover { color: var(--fg); }

/* ============== STEP NAVIGATION (sticky bottom bar) ============== */
.step-nav {
  position: sticky; bottom: 18px;
  background: var(--bg-up);
  backdrop-filter: blur(12px);
  padding: 12px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  margin: 32px auto 0;
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  max-width: 480px;
  box-shadow: 0 20px 60px -10px rgba(0,0,0,0.5);
}

/* ============== RESULT VIEW ============== */
.result-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
@media (max-width: 760px) { .result-wrap { grid-template-columns: 1fr; } }
.result-img-box {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px;
  position: relative;
  overflow: hidden;
}
.result-img-box img { width: 100%; border-radius: 12px; display: block; }
.result-img-box.loading { min-height: 380px; display: flex; align-items: center; justify-content: center; color: var(--fg-dim); }
.result-img-box.loading::before {
  content: ""; width: 32px; height: 32px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin-right: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.result-summary .layer-row {
  display: flex; gap: 10px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.result-summary .layer-row:last-child { border-bottom: 0; }
.layer-label {
  color: var(--fg-mute); font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.08em; flex: 0 0 100px; font-weight: 600;
}
.layer-value { font-weight: 600; flex: 1; font-size: 14px; }

/* ============== MODAL ============== */
.modal-bg {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-bg.show { display: flex; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  max-width: 440px; width: 100%;
  padding: 28px;
  position: relative;
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: var(--bg-up); border: none;
  width: 30px; height: 30px; border-radius: 50%;
  font-size: 18px; cursor: pointer; color: var(--fg-dim);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--fg); background: var(--bg-card-hover); }
.modal h3 { margin: 0 0 8px; font-size: 18px; font-weight: 700; }
.modal .lead { font-size: 14px; margin-bottom: 18px; max-width: none; }

/* ============== CREDITS PAGE ============== */
.tariff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 22px 0 40px;
}
.tariff {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 18px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(.4,0,.2,1);
}
.tariff:hover { border-color: var(--line-strong); transform: translateY(-2px); background: var(--bg-card-hover); }
.tariff.best {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--bg-card-hover), var(--bg-card));
}
.tariff .badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  background: var(--grad-accent); color: #fff;
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  padding: 4px 12px; border-radius: 999px;
  text-transform: uppercase;
  box-shadow: var(--shadow-glow);
}
.tariff .credits-num {
  font-size: 44px; font-weight: 800;
  background: var(--grad-accent);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  letter-spacing: -0.04em;
}
.tariff .credits-name { font-size: 12px; color: var(--fg-mute); margin: 6px 0 18px; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; }
.tariff .price { font-size: 24px; font-weight: 700; color: var(--fg); margin-bottom: 4px; }
.tariff .price small { color: var(--fg-mute); font-weight: 500; font-size: 12px; display: block; margin-top: 4px; }

.bonus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin: 14px 0 40px;
}
.bonus {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  display: flex; gap: 16px;
  align-items: flex-start;
  transition: all 0.15s;
}
.bonus:hover { border-color: var(--line-strong); }
.bonus.claimed { opacity: 0.5; background: var(--bg-up); }
.bonus-icon {
  flex: 0 0 48px; height: 48px; border-radius: 14px;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
}
.bonus.tg .bonus-icon { background: rgba(45,160,228,0.15); color: #2da0e4; }
.bonus-body { flex: 1; }
.bonus h4 { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: var(--fg); }
.bonus p { margin: 0 0 12px; color: var(--fg-dim); font-size: 13px; line-height: 1.5; }
.bonus-reward {
  display: inline-block;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700;
  padding: 4px 10px; border-radius: 999px;
  margin-bottom: 12px;
}

/* ============== MOBILE TWEAKS ============== */
@media (max-width: 600px) {
  .container { padding: 16px 16px; }
  .h1 { font-size: 32px; }
  .picker { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
  .picker-item .name { font-size: 12px; padding: 8px 10px; }
  .step-pill { font-size: 10px; padding: 6px 12px; }
  .step-pill .step-no { display: none; }
  .tile-grid { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
  .summary { position: relative; top: 0; max-height: none; }
}
