:root {
  color-scheme: dark;
  --bg: #121110;
  --bg-2: #181615;
  --card: #1d1b1a;
  --card-2: #262321;
  --card-3: #2f2b28;
  --line: rgba(234, 222, 200, 0.09);
  --line-2: rgba(234, 222, 200, 0.17);
  --text: #f4efe6;
  --text-2: rgba(244, 239, 230, 0.68);
  --text-3: rgba(244, 239, 230, 0.44);
  --beige: #a89a83;
  --beige-2: #c9bb9e;
  --beige-3: #e7dbc3;
  --graphite: #363434;
  --brass: linear-gradient(135deg, #efe4cc 0%, #c9bb9e 38%, #a89a83 62%, #7c705c 100%);
  --red: #f07a68;
  --red-bg: rgba(240, 122, 104, 0.13);
  --green: #8fd0a8;
  --green-bg: rgba(143, 208, 168, 0.12);

  /* ikonlar / иконки */
  --culinary-crust: #d49b54; --culinary-bread: #e7c89a; --culinary-cream: #fbf6ec; --culinary-meat: #9e3d36;
  --culinary-salmon: #e07652; --culinary-herb: #3a7554; --culinary-avocado: #7ca355; --culinary-eggplant: #5f425a;
  --culinary-gold: #d9a441; --culinary-berry: #b8323e; --culinary-plate: #efe3d2; --culinary-chili: #c1502a;
  --ic-ink: #3a2c24; --ic-brass: #8f6524; --ic-muted: #9e8a78;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --serif: "New York", "Noto Serif", "Iowan Old Style", Georgia, serif;
  --r-sm: 12px; --r: 18px; --r-lg: 26px; --pill: 999px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --spring: cubic-bezier(0.32, 0.94, 0.6, 1);   /* критически задемпфированная пружина – без отскока */
  --bounce: cubic-bezier(0.34, 1.25, 0.64, 1);  /* лёгкий отскок – только после жеста с инерцией */
  --soft: cubic-bezier(0.25, 1, 0.5, 1);
  --gx: 0deg; --gy: 0deg;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: clip; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--beige-2); outline-offset: 3px; }
.is-hidden { display: none !important; }
em { font-style: normal; }

/* ---------- Üst panel / верхняя панель ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: calc(60px + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) max(16px, env(safe-area-inset-right)) 0 max(16px, env(safe-area-inset-left));
  display: flex; align-items: center; justify-content: space-between;
  background: rgba(18, 17, 16, 0.55); backdrop-filter: saturate(160%) blur(22px); -webkit-backdrop-filter: saturate(160%) blur(22px);
  border-bottom: 1px solid transparent; transition: border-color 0.3s var(--ease), background 0.3s var(--ease);
}
.topbar.is-scrolled { background: rgba(18, 17, 16, 0.78); box-shadow: 0 10px 24px -14px rgba(0, 0, 0, 0.9); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand img { border-radius: 50%; box-shadow: 0 0 0 1px var(--line-2); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-size: 15px; font-weight: 700; letter-spacing: 0.01em; }
.brand-text small { font-size: 12px; color: var(--text-3); }
.lang-switch { position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: var(--pill); padding: 3px; }
.lang-switch button { position: relative; z-index: 1; border: 0; background: none; min-width: 48px; min-height: 36px; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; color: var(--text-2); cursor: pointer; transition: color 0.25s var(--ease); }
.lang-switch button.is-active { color: #1b1918; }
.lang-thumb { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: var(--pill); background: var(--brass); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); transition: transform 0.45s var(--spring); }
.lang-switch[data-lang="ru"] .lang-thumb { transform: translateX(100%); }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 100svh; display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
  background: radial-gradient(120% 70% at 50% 30%, #2c2825 0%, #1a1817 45%, var(--bg) 78%); }
.hero::after { content: ""; position: absolute; inset: auto 0 0 0; height: 45%; background: linear-gradient(to bottom, transparent, var(--bg) 92%); pointer-events: none; }
#hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
#hero-canvas:active { cursor: grabbing; }
.hero-fallback { display: none; position: absolute; top: 18%; left: 50%; width: 220px; transform: translateX(-50%); border-radius: 50%; box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6); }
.no-gl .hero-fallback { display: block; }
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 860px; padding: 0 22px calc(48px + env(safe-area-inset-bottom)); pointer-events: none; }
.hero-content > * { pointer-events: auto; }
.hero-kicker { margin: 0 0 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--beige-2); }
.hero-title { margin: 0 0 16px; font-size: clamp(2.3rem, 1.4rem + 4.2vw, 4.8rem); line-height: 1.02; font-weight: 800; letter-spacing: -0.035em; }
.hero-title em, .section-title em { background: var(--brass); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lede { margin: 0 auto 26px; max-width: 60ch; font-size: clamp(1rem, 0.95rem + 0.3vw, 1.15rem); color: var(--text-2); }
.hero-actions { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.btn-hero { display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer; padding: 0 28px; min-height: 54px; border-radius: var(--pill); font-size: 17px; font-weight: 700; color: #1b1918; background: var(--brass); box-shadow: 0 10px 30px rgba(168, 154, 131, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.6); transition: transform 0.3s var(--spring), box-shadow 0.3s var(--ease); }
.btn-hero:hover { transform: translateY(-2px) scale(1.02); }
.btn-hero:active { transform: scale(0.97); }
.btn-hero svg { animation: nudge 2.2s var(--ease) infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(3px); } }
.hero-hint { font-size: 13px; color: var(--text-3); }
.ornament-rule { display: flex; align-items: center; gap: 12px; margin-top: 30px; color: var(--beige); font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
.ornament-rule::before, .ornament-rule::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--beige), transparent); }

/* ---------- Səhifə / страница ---------- */
.page { display: grid; gap: 56px; max-width: 1240px; margin: 0 auto; padding: 24px 20px 72px; }
.page > * { min-width: 0; }

.tilt { transform: perspective(900px) rotateX(calc(var(--rx, 0deg) + var(--gy))) rotateY(calc(var(--ry, 0deg) + var(--gx))); transition: transform 0.5s var(--ease); will-change: transform; }
.tilt.is-tilting { transition: transform 0.18s var(--soft); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.arch-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 6px; justify-content: space-between; text-align: center; padding: 26px 16px 18px; border-radius: 120px 120px var(--r) var(--r); background: linear-gradient(180deg, var(--card-2), var(--card)); border: 1px solid var(--line); }
.arch-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(220px 140px at var(--mx, 50%) var(--my, 0%), rgba(231, 219, 195, 0.12), transparent 70%); pointer-events: none; }
.arch-card.is-featured { background: linear-gradient(180deg, #3a342c, #26221e); border-color: rgba(201, 187, 158, 0.35); }
.arch-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }
.arch-value { font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.7rem); font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.is-featured .arch-value { background: var(--brass); -webkit-background-clip: text; background-clip: text; color: transparent; }
.arch-caption { font-size: 13px; color: var(--beige-2); font-weight: 600; }
.kpi-bar { display: block; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.kpi-bar i { display: block; height: 100%; width: 0; background: var(--brass); border-radius: 4px; transition: width 0.7s var(--ease); }
.arch-jump-btn { align-self: center; border: 0; cursor: pointer; min-height: 40px; padding: 0 18px; border-radius: var(--pill); font-size: 13px; font-weight: 700; color: #1b1918; background: var(--brass); }

/* ---------- Filtrlər / фильтры ---------- */
.control-panel { display: grid; gap: 22px; padding: 22px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.control-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 18px; }
.control-group { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.control-label, .field-label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--beige); }
.pill-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-pill, .allergen-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: var(--pill); border: 1px solid var(--line-2); background: var(--card); font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.25s var(--ease), color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.3s var(--spring); }
.filter-pill em { font-size: 12px; color: var(--text-3); font-weight: 700; }
.filter-pill:hover, .allergen-pill:hover { background: var(--card-2); }
.filter-pill:active, .allergen-pill:active { transform: scale(0.96); }
.filter-pill.is-active { background: var(--brass); color: #1b1918; border-color: transparent; }
.filter-pill.is-active em { color: rgba(27, 25, 24, 0.6); }
.allergen-pill.is-excluded { background: var(--red); color: #1b1110; border-color: transparent; }
.allergen-pill.is-safe-all { border-color: rgba(143, 208, 168, 0.35); color: var(--green); background: var(--green-bg); }
.allergen-pill.is-safe-all.is-active { background: var(--green); color: #0f1d15; }
.segmented-control { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; border-radius: var(--pill); background: var(--card); border: 1px solid var(--line); }
.seg-btn { border: 0; background: none; min-height: 40px; padding: 0 14px; border-radius: var(--pill); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.25s var(--ease), color 0.25s var(--ease); }
.seg-btn.is-active { background: var(--card-3); color: var(--beige-3); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }
.search-select-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) auto; gap: 14px; align-items: end; }
.field-block { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.text-input, .select-input { width: 100%; min-height: 46px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--card); transition: box-shadow 0.2s var(--ease), border-color 0.2s var(--ease); }
.text-input::placeholder { color: var(--text-3); }
.text-input:focus, .select-input:focus { outline: none; border-color: var(--beige); box-shadow: 0 0 0 3px rgba(168, 154, 131, 0.2); }
.select-input { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--beige) 50%), linear-gradient(135deg, var(--beige) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
.select-input option { background: var(--card); }
.btn-secondary, .btn-primary { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 46px; padding: 0 20px; border-radius: var(--pill); font-size: 14px; font-weight: 700; cursor: pointer; transition: background 0.25s var(--ease), transform 0.3s var(--spring); }
.btn-secondary { background: transparent; border: 1px solid var(--line-2); }
.btn-secondary:hover { background: var(--card-2); }
.btn-primary { border: 0; background: var(--brass); color: #1b1918; }
.btn-secondary:active, .btn-primary:active { transform: scale(0.96); }
.results-status-bar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--text-2); }
.results-count strong { color: var(--beige-3); font-variant-numeric: tabular-nums; }

/* ---------- Kataloq / каталог ---------- */
.grid-wrap { position: relative; }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(440px, 100%), 1fr)); gap: 28px; align-items: start; }
.card-wrap { min-width: 0; will-change: transform; }
.dish-card {
  position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 16px; padding: 20px;
  border-radius: var(--r-lg); background: linear-gradient(180deg, var(--card-2) 0%, var(--card) 40%); border: 1px solid var(--line);
  transform: perspective(1400px) rotateX(calc(var(--rx, 0deg) + var(--gy))) rotateY(calc(var(--ry, 0deg) + var(--gx))) translateZ(var(--tz, 0px)) scale(var(--sc, 1));
  transition: transform 0.6s var(--ease), filter 0.6s var(--ease), opacity 0.6s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}
.dish-card.is-tilting { transition: transform 0.18s var(--soft), filter 0.6s var(--ease), opacity 0.6s var(--ease); }
.dish-card::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 3; background: radial-gradient(420px 260px at var(--mx, 50%) var(--my, -20%), rgba(231, 219, 195, 0.09), transparent 65%); }
.dish-card.is-pinned { border-color: rgba(201, 187, 158, 0.55); box-shadow: 0 0 0 1px rgba(201, 187, 158, 0.35), 0 20px 60px rgba(0, 0, 0, 0.45); }
.dish-card.is-safe { border-color: rgba(143, 208, 168, 0.4); box-shadow: 0 0 0 1px rgba(143, 208, 168, 0.18), 0 24px 60px rgba(0, 0, 0, 0.45); --tz: 14px; }
.dish-card.is-blocked { --tz: -110px; --sc: 0.93; filter: grayscale(0.95) brightness(0.5); opacity: 0.6; }
.blocked-badge { display: none; position: absolute; z-index: 4; top: 18px; right: 18px; padding: 6px 12px; border-radius: var(--pill); background: rgba(240, 122, 104, 0.9); color: #1b1110; font-size: 12px; font-weight: 800; letter-spacing: 0.02em; }
.is-blocked .blocked-badge { display: block; }

.dish-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; }
.dish-meta-left { display: flex; align-items: center; gap: 10px; }
.dish-index { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; background: var(--brass); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.cat-badge { padding: 5px 12px; border-radius: var(--pill); font-size: 11px; font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase; }
.cat-hot { background: rgba(224, 118, 82, 0.14); color: #f0a487; border: 1px solid rgba(224, 118, 82, 0.3); }
.cat-cold { background: rgba(124, 163, 140, 0.14); color: #a9d1bb; border: 1px solid rgba(124, 163, 140, 0.3); }
.cat-share { background: rgba(201, 187, 158, 0.13); color: var(--beige-3); border: 1px solid rgba(201, 187, 158, 0.3); }
.dish-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.icon-action-btn { min-height: 40px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.04); font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.3s var(--spring); }
.icon-action-btn:hover { background: var(--card-3); color: var(--text); }
.icon-action-btn:active { transform: scale(0.95); }
.icon-action-btn.is-active { background: var(--brass); color: #1b1918; border-color: transparent; }
.icon-action-btn.is-practiced { background: var(--green); color: #0f1d15; border-color: transparent; }
.dish-title { margin: 0; font-size: clamp(1.45rem, 1.25rem + 0.7vw, 1.9rem); line-height: 1.12; font-weight: 800; letter-spacing: -0.025em; }
.dish-subtitle { margin: 4px 0 0; font-size: 14px; color: var(--text-2); }
.allergen-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.allergen-tag, .allergen-safe-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: var(--pill); font-size: 12px; font-weight: 700; }
.allergen-tag { background: var(--red-bg); color: var(--red); }
.allergen-safe-tag { background: var(--green-bg); color: var(--green); border: 1px solid rgba(143, 208, 168, 0.25); }

.schematic-module { display: grid; gap: 12px; padding: 14px; border-radius: var(--r); background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); }
.schematic-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.schematic-title { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--beige); }
.explode-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: var(--pill); border: 1px solid rgba(201, 187, 158, 0.35); background: rgba(201, 187, 158, 0.08); color: var(--beige-3); font-size: 12px; font-weight: 700; cursor: pointer; transition: background 0.25s var(--ease), transform 0.3s var(--spring); }
.explode-btn:active { transform: scale(0.95); }
.explode-btn svg { transition: transform 0.5s var(--spring); }
.explode-btn.is-on { background: var(--brass); color: #1b1918; border-color: transparent; }
.explode-btn.is-on svg { transform: rotate(180deg); }
.stage3d { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-sm); overflow: hidden; background: radial-gradient(80% 70% at 50% 45%, #34302c 0%, #1f1c1a 70%, #181615 100%); }
.gl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: pan-y; cursor: grab; }
.gl-canvas:active { cursor: grabbing; }
.stage-hint { position: absolute; left: 12px; top: 10px; z-index: 2; font-size: 11px; font-weight: 600; color: var(--text-3); pointer-events: none; transition: opacity 0.4s var(--ease); }
.stage3d.is-exploded .stage-hint { opacity: 0; }
.gl-labels { position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.35s var(--ease); }
.gl-labels.is-on { opacity: 1; }
.gl-label { position: absolute; left: 0; top: 0; pointer-events: auto; display: inline-flex; align-items: center; gap: 6px; max-width: 46%; padding: 5px 10px 5px 8px; border-radius: var(--pill); border: 1px solid rgba(231, 219, 195, 0.22); background: rgba(24, 22, 21, 0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); color: var(--text); font-size: 11.5px; font-weight: 600; line-height: 1.2; text-align: left; cursor: pointer; white-space: normal; transition: background 0.2s var(--ease), border-color 0.2s var(--ease); }
.gl-label i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.gl-label.has-alg i { background: var(--red); box-shadow: 0 0 8px var(--red); }
.gl-label.is-focus { background: var(--brass); color: #1b1918; border-color: transparent; }
.gl-tag { position: absolute; left: 0; top: 0; padding: 3px 8px; border-radius: var(--pill); background: rgba(24, 22, 21, 0.85); border: 1px solid rgba(231, 219, 195, 0.3); font-size: 11px; font-weight: 800; color: var(--beige-3); pointer-events: none; }
.no-gl-note { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--text-3); font-size: 13px; }
.schematic-caption { font-size: 12px; font-weight: 600; color: var(--text-3); text-align: center; }
.pictogram-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 6px; }
.ing-chip { display: flex; align-items: center; gap: 8px; min-height: 46px; padding: 5px 10px 5px 5px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); text-align: left; cursor: pointer; transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.3s var(--spring); }
.ing-chip:hover { background: var(--card-3); transform: translateY(-1px); }
.ing-chip.is-selected { border-color: var(--beige-2); background: #3a342c; }
.ing-icon { flex: none; width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 10px; background: #efe6d6; }
.ing-name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.ing-chip .alg-dot { flex: none; margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--red); }
.ing-inspector { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 3px solid var(--beige); background: var(--card); font-size: 14px; animation: fadeUp 0.4s var(--ease); }
.ing-inspector-main { display: flex; flex-direction: column; gap: 3px; }
.ing-inspector-role { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--beige-2); }
.ing-inspector-note { line-height: 1.45; color: var(--text); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.desc-stack { display: grid; gap: 10px; }
.level-box { padding: 16px; border-radius: var(--r-sm); }
.level-1 { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.level-2 { background: linear-gradient(135deg, rgba(201, 187, 158, 0.14), rgba(201, 187, 158, 0.04)); border-left: 3px solid var(--beige-2); }
.level-header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.level-tag { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--beige); }
.level-2 .level-tag { color: var(--beige-3); }
.level-text { margin: 0; font-size: 15px; line-height: 1.6; }
.level-2 .level-text { font-family: var(--serif); font-style: italic; font-size: 17.5px; line-height: 1.55; color: #f7f1e6; }
.copy-script-btn { min-height: 36px; padding: 0 14px; border-radius: var(--pill); border: 1px solid rgba(201, 187, 158, 0.4); background: transparent; color: var(--beige-3); font-size: 12px; font-weight: 700; cursor: pointer; transition: background 0.2s var(--ease); }
.copy-script-btn:hover { background: rgba(201, 187, 158, 0.12); }
.copy-script-btn.is-copied { background: var(--green); color: #0f1d15; border-color: transparent; }
.scenario-box { display: grid; gap: 6px; padding: 12px 14px; border-radius: var(--r-sm); background: var(--green-bg); border: 1px solid rgba(143, 208, 168, 0.2); }
.scenario-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.scenario-title { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--green); }
.scenario-pairing { font-size: 12px; font-weight: 600; color: #b9dcc6; }
.scenario-text { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }

.scan-beam { position: absolute; left: -2%; right: -2%; top: 0; height: 120px; z-index: 6; pointer-events: none; opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(231, 219, 195, 0.10) 45%, rgba(231, 219, 195, 0.55) 50%, rgba(231, 219, 195, 0.10) 55%, transparent); filter: blur(1px); }
.grid-wrap.is-scanning .scan-beam { animation: scan 1.1s var(--ease) forwards; }
@keyframes scan { 0% { opacity: 0; transform: translateY(-60px); } 12% { opacity: 1; } 88% { opacity: 1; } 100% { opacity: 0; transform: translateY(var(--scan-h, 800px)); } }

.empty-state { display: grid; justify-items: center; gap: 14px; padding: 56px 24px; text-align: center; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.empty-state h3 { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.empty-state p { margin: 0; max-width: 48ch; color: var(--text-2); }

/* ---------- Bölmələr / секции ---------- */
.train-section, .tray-section, .matrix-section { display: grid; gap: 20px; padding: 24px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.section-heading-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-title { margin: 0; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.4rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.08; }

/* Məşq / тренажёр */
.train-progress { display: grid; gap: 8px; min-width: 200px; font-size: 14px; color: var(--text-2); }
.train-progress strong { color: var(--beige-3); }
.deck { position: relative; height: 470px; max-width: 520px; width: 100%; margin: 6px auto 0; perspective: 1600px; }
.flip-card { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.7s var(--ease), opacity 0.5s var(--ease); touch-action: pan-y; cursor: pointer; user-select: none; -webkit-user-select: none; }
.flip-card[data-depth="1"] { transform: translate(-18px, 14px) rotate(-4deg) translateZ(-60px) scale(0.95); opacity: 0.8; pointer-events: none; }
.flip-card[data-depth="2"] { transform: translate(18px, 26px) rotate(4.5deg) translateZ(-120px) scale(0.9); opacity: 0.5; pointer-events: none; }
.flip-card.deal { animation: deal 0.75s var(--ease) backwards; }
@keyframes deal { from { transform: translate(0, 160px) rotate(-16deg) scale(0.72); opacity: 0; } }
.flip-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.6s var(--soft); }
.flip-card.is-flipped .flip-inner { transform: rotateY(180deg); }
.flip-face { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; padding: 26px; border-radius: var(--r-lg); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; border: 1px solid var(--line-2); box-shadow: 0 30px 70px rgba(0, 0, 0, 0.5); }
.flip-front { background: radial-gradient(120% 90% at 20% 0%, #3a342c 0%, #24211f 55%, #1b1918 100%); }
.flip-front::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 240px; height: 240px; border-radius: 50%; background: url("img/logo.webp") center / cover; opacity: 0.08; }
.flip-back { transform: rotateY(180deg); background: linear-gradient(160deg, #2e2924, #1c1a18); border-color: rgba(201, 187, 158, 0.35); overflow-y: auto; }
.flip-num { font-size: 56px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; background: var(--brass); -webkit-background-clip: text; background-clip: text; color: transparent; }
.flip-name { margin: 0; font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); font-weight: 800; letter-spacing: -0.025em; line-height: 1.1; }
.flip-icons { display: flex; flex-wrap: wrap; gap: 8px; }
.flip-icons .ing-icon { width: 42px; height: 42px; border-radius: 12px; }
.flip-prompt { margin-top: auto; font-size: 17px; font-weight: 600; color: var(--beige-3); }
.flip-tap { font-size: 12px; color: var(--text-3); }
.flip-speech { margin: 0; font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.55; color: #f7f1e6; }
.flip-card.fly-right { transform: translateX(130%) rotate(16deg) !important; opacity: 0 !important; }
.flip-card.fly-left { transform: translateX(-130%) rotate(-16deg) !important; opacity: 0 !important; }
.flip-card.is-dragging { transition: none; }
.flip-card .swipe-badge { position: absolute; top: 22px; z-index: 5; padding: 6px 14px; border-radius: var(--pill); font-size: 13px; font-weight: 800; opacity: 0; transition: opacity 0.15s linear; pointer-events: none; }
.swipe-badge.know { right: 22px; background: var(--green); color: #0f1d15; }
.swipe-badge.again { left: 22px; background: var(--beige-2); color: #1b1918; }
.deck-done { position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; text-align: center; padding: 24px; border-radius: var(--r-lg); background: radial-gradient(90% 80% at 50% 30%, #2f3a32, #1b1918); border: 1px solid rgba(143, 208, 168, 0.3); animation: fadeUp 0.6s var(--ease); }
.deck-done h3 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; }
.deck-done p { margin: 0; color: var(--text-2); max-width: 36ch; }
.deck-done .btn-primary { justify-self: center; }
.deck-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 34px; }
.deck-btn { min-width: 120px; }

/* Masa / стол */
.table-stage { position: relative; height: clamp(300px, 46vw, 460px); border-radius: var(--r); overflow: hidden; background: radial-gradient(70% 70% at 50% 45%, #2b2724 0%, #181615 80%); border: 1px solid var(--line); }
.table-hint { position: absolute; left: 14px; bottom: 12px; z-index: 2; font-size: 12px; font-weight: 600; color: var(--text-3); pointer-events: none; }
.table-empty { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%); padding: 10px 18px; border-radius: var(--pill); background: rgba(24, 22, 21, 0.8); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--beige-3); pointer-events: none; white-space: nowrap; }
.tray-actions-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tray-items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.tray-chip-card { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 10px 10px 16px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); animation: fadeUp 0.4s var(--ease); }
.tray-chip-card .dish-subtitle { margin: 0; font-size: 12px; }
.tray-remove-btn { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-2); background: transparent; cursor: pointer; font-size: 18px; color: var(--text-2); }
.tray-remove-btn:hover { background: var(--red-bg); color: var(--red); }
.tray-script-output { padding: 18px; border-radius: 0 var(--r-sm) var(--r-sm) 0; border-left: 3px solid var(--beige-2); background: var(--card); font-family: var(--serif); font-style: italic; font-size: 18px; line-height: 1.55; }

/* Matris / матрица */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.matrix-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.matrix-table th { text-align: left; white-space: nowrap; padding: 10px 14px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); background: var(--card); border-bottom: 1px solid var(--line); }
.matrix-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.matrix-table tbody tr { transition: background 0.2s var(--ease); }
.matrix-table tbody tr:hover { background: var(--card); }
.matrix-dot-yes { display: inline-flex; padding: 3px 9px; border-radius: var(--pill); background: var(--red-bg); color: var(--red); font-size: 12px; font-weight: 700; }
.matrix-dot-no { color: var(--text-3); }

.source-footer { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 24px; border-top: 1px solid var(--line); text-align: center; font-size: 13px; color: var(--text-3); }
.source-footer img { border-radius: 50%; opacity: 0.85; }

/* Görünmə animasiyası / появление */
.reveal { opacity: 0; transform: perspective(1100px) translateY(32px) translateZ(-90px) rotateX(8deg); transform-origin: 50% 100%; transition: opacity 0.8s var(--soft), transform 0.9s var(--soft); transition-delay: calc(var(--d, 0) * 90ms); }
.reveal.is-in { opacity: 1; transform: none; }

@media (max-width: 760px) {
  .page { gap: 40px; padding: 16px 14px 56px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .arch-card { padding: 22px 12px 14px; }
  .search-select-row { grid-template-columns: 1fr; }
  .control-panel, .train-section, .tray-section, .matrix-section { padding: 16px; }
  .dish-card { padding: 16px; gap: 14px; }
  .segmented-control { width: 100%; }
  .seg-btn { flex: 1 1 auto; }
  .deck { height: 500px; }
  .pictogram-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gl-label { max-width: 52%; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* Hero: geniş ekran / широкий экран */
@media (min-width: 900px) and (min-aspect-ratio: 11/10) {
  .hero { align-items: center; justify-content: flex-start; }
  .hero::after { height: 30%; }
  .hero-content { text-align: left; max-width: 600px; margin-left: max(5vw, calc((100vw - 1240px) / 2 + 20px)); padding: 80px 0 40px; }
  .hero-title { font-size: clamp(2.6rem, 1.2rem + 3.2vw, 4.4rem); }
  .hero-lede { margin-left: 0; }
  .hero-actions { flex-direction: row; align-items: center; gap: 18px; }
  .ornament-rule { max-width: 520px; }
  .hero-fallback { left: 72%; top: 50%; transform: translate(-50%, -50%); width: 300px; }
}
@media (max-width: 899px), (max-aspect-ratio: 11/10) {
  .hero-content { padding-top: 0; }
  .hero-lede { font-size: 0.98rem; }
  .ornament-rule { margin-top: 22px; }
}
.gl-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.gl-lines path { fill: none; stroke: rgba(231, 219, 195, 0.45); stroke-width: 1; }
.gl-lines circle { fill: var(--beige-3); }
.gl-lines .is-focus { stroke: var(--beige-3); stroke-width: 1.5; }
.gl-lines circle.is-focus { fill: #fff; }
.gl-label { max-width: 44%; }
@media (max-width: 760px) {
  .dish-actions { width: 100%; }
  .dish-actions .icon-action-btn { flex: 1 1 0; padding: 0 10px; font-size: 12.5px; }
  .deck-btn { min-width: 0; flex: 1 1 0; padding: 0 12px; }
  .deck-actions { flex-wrap: nowrap; }
  .tray-actions-row .btn-secondary { flex: 1 1 auto; }
}
#guide, .tray-section, .train-section { scroll-margin-top: 72px; }

/* ---------- 3D: əlavələr / дополнения ---------- */
.fly-coin { position: fixed; left: 0; top: 0; z-index: 60; display: none; pointer-events: none; perspective: 700px; will-change: transform, width; }
.fly-coin img { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 2px #d2c19c, 0 18px 50px rgba(0, 0, 0, 0.55); backface-visibility: visible; }
.brand img { transition: opacity 0.2s linear; }

.arch-value.odo { display: inline-flex; justify-content: center; align-items: center; background: none; -webkit-text-fill-color: currentColor; color: var(--text); line-height: 1.1; }
.is-featured .arch-value.odo { color: var(--beige-3); }
.odo-d { position: relative; display: inline-block; height: 1.1em; overflow: hidden; -webkit-mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); mask-image: linear-gradient(transparent, #000 22%, #000 78%, transparent); }
.odo-strip { display: flex; flex-direction: column; transition: transform 1.2s var(--soft); }
.odo-strip i { font-style: normal; height: 1.1em; line-height: 1.1em; text-align: center; }
.odo-s { display: inline-block; padding: 0 0.06em; }

.allergen-pill { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.allergen-pill .token { position: relative; flex: none; width: 20px; height: 20px; transform-style: preserve-3d; transition: transform 0.7s var(--spring); }
.allergen-pill .token::before, .allergen-pill .token::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%; font-size: 11px; font-weight: 900; font-style: normal; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.allergen-pill .token::before { background: radial-gradient(circle at 35% 30%, #c9f0d6, #5fae80 70%); color: #0f2a1a; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25); }
.allergen-pill .token::after { content: "✕"; transform: rotateY(180deg); background: radial-gradient(circle at 35% 30%, #ffd2c9, #d9503d 70%); color: #2a0d08; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3); }
.allergen-pill.is-excluded .token { transform: rotateY(180deg); }
.allergen-pill.is-excluded .token::after { background: radial-gradient(circle at 35% 30%, #fff, #ffe1db 70%); color: #b8331f; }
.allergen-pill.is-excluded { box-shadow: 0 1px 0 rgba(0, 0, 0, 0.45), inset 0 2px 4px rgba(0, 0, 0, 0.25); transform: translateY(2px); }
.allergen-pill.is-safe-all.is-active .token { transform: rotateY(360deg); }

.deck-area { position: relative; max-width: 520px; width: 100%; margin: 6px auto 0; }
.deck-area .deck { margin: 0; }
.deck-pile { position: absolute; right: -6px; bottom: -26px; z-index: 6; width: 58px; height: 74px; pointer-events: none; }
.deck-pile span { position: absolute; inset: 0; border-radius: 10px; border: 1px solid rgba(201, 187, 158, 0.45); background: linear-gradient(160deg, #3a342c, #1f1c1a); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); }
.deck-pile span:nth-child(1) { transform: rotate(-9deg) translate(-4px, 3px); }
.deck-pile span:nth-child(2) { transform: rotate(6deg) translate(3px, 1px); }
.deck-pile span:nth-child(3) { background: url("img/logo.webp") center / 70% no-repeat, linear-gradient(160deg, #3a342c, #1f1c1a); }
.deck-pile b { position: absolute; right: -8px; top: -10px; min-width: 26px; height: 26px; padding: 0 6px; display: grid; place-items: center; border-radius: 999px; background: var(--green); color: #0f1d15; font-size: 13px; font-weight: 800; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4); }

.medal-overlay { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(8, 7, 7, 0.72); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); opacity: 0; transition: opacity 0.4s var(--soft), backdrop-filter 0.5s var(--soft), -webkit-backdrop-filter 0.5s var(--soft); }
.medal-overlay.is-open { opacity: 1; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.medal-card { width: min(420px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; padding: 18px 22px 24px; border-radius: var(--r-lg); background: radial-gradient(120% 80% at 50% 0%, #3a342c, #1b1918 70%); border: 1px solid rgba(201, 187, 158, 0.35); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); transform: translateY(16px) scale(0.96); transition: transform 0.5s var(--soft); }
.medal-overlay.is-open .medal-card { transform: none; }
#medal-canvas { width: 100%; aspect-ratio: 1 / 1.05; display: block; }
.medal-card h3 { margin: 0; font-size: 1.6rem; letter-spacing: -0.02em; background: var(--brass); -webkit-background-clip: text; background-clip: text; color: transparent; }
.medal-card p { margin: 0; color: var(--text-2); }
.medal-field { width: 100%; text-align: left; }
.medal-card .btn-primary { min-width: 160px; }
.no-gl #medal-canvas { display: none; }

.matrix-table { border-collapse: separate; border-spacing: 0; }
.matrix-table tbody tr { transform: perspective(900px) translateZ(0); transition: transform 0.35s var(--spring), background 0.2s var(--ease), box-shadow 0.35s var(--ease); }
.matrix-table tbody tr:hover, .matrix-table tbody tr:active { transform: perspective(900px) translateZ(26px); background: var(--card-2); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45); position: relative; z-index: 2; }
.matrix-dot-yes { width: 44px; justify-content: center; padding: 5px 0; color: #2a0d08; background: radial-gradient(circle at 35% 25%, #ffc9bd, #e0604b 72%); box-shadow: 0 3px 0 #8c2c1e, inset 0 1px 0 rgba(255, 255, 255, 0.5); transition: transform 0.6s var(--spring); }
.matrix-table tbody tr:hover .matrix-dot-yes, .matrix-table tbody tr:active .matrix-dot-yes { transform: rotateX(360deg); }

/* Qaçan sətir / бегущая строка */
.marquee { position: relative; z-index: 3; margin: -10px 0 10px; padding: 26px 0; overflow: hidden; perspective: 900px; }
.mq-row { position: relative; width: 104%; margin-left: -2%; overflow: hidden; white-space: nowrap; }
.mq-a { background: var(--brass); color: #1b1918; transform: rotate(-2deg) translateZ(20px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.5); z-index: 2; }
.mq-b { margin-top: -6px; background: #262321; color: var(--beige-3); border-block: 1px solid rgba(201, 187, 158, 0.3); transform: rotate(1.6deg) translateZ(-10px); }
.mq-track { display: inline-flex; align-items: center; gap: 18px; padding: 13px 0; animation: mq 46s linear infinite; will-change: transform; }
.mq-b .mq-track { animation-duration: 58s; animation-direction: reverse; }
@keyframes mq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.mq-item { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 700; letter-spacing: 0.02em; }
.mq-item em { display: inline-flex; padding: 2px 10px; border-radius: 999px; font-weight: 800; font-size: 13px; background: rgba(27, 25, 24, 0.12); }
.mq-b .mq-item em { background: rgba(201, 187, 158, 0.14); color: var(--beige-3); }
.mq-item b { font-weight: 800; }
.mq-sep { font-size: 10px; opacity: 0.55; }
.mq-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.mq-dot.is-alg { background: var(--red); box-shadow: 0 0 8px var(--red); }
.marquee:hover .mq-track { animation-play-state: paused; }

/* Musiqi düyməsi / кнопка музыки */
.top-actions { display: flex; align-items: center; gap: 8px; }
.music-btn { position: relative; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line-2); background: rgba(255, 255, 255, 0.07); color: var(--beige-3); cursor: pointer; transition: background 0.25s var(--ease), transform 0.3s var(--spring); }
.music-btn:active { transform: scale(0.92); }
.music-btn .eq { display: none; gap: 2px; align-items: flex-end; height: 16px; }
.music-btn .eq i { width: 3px; height: 100%; border-radius: 2px; background: #1b1918; animation: eq 0.9s ease-in-out infinite; transform-origin: bottom; }
.music-btn .eq i:nth-child(2) { animation-delay: -0.3s; } .music-btn .eq i:nth-child(3) { animation-delay: -0.6s; }
@keyframes eq { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }
.music-btn.is-on { background: var(--brass); border-color: transparent; }
.music-btn.is-on svg { display: none; }
.music-btn.is-on .eq { display: inline-flex; }
@media (max-width: 760px) { .mq-item { font-size: 13px; } .mq-track { padding: 11px 0; gap: 14px; } }

/* Foto və menyu adı / фото и название из меню */
.dish-photo { position: relative; margin: 14px 0 0; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--card-3); box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 1px var(--line); }
.dish-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transform: scale(1.04) translate(calc((var(--mx, 50%) - 50%) * -0.04), calc((var(--my, 50%) - 50%) * -0.04)); transition: transform 0.6s var(--ease); }
.dish-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.25)); pointer-events: none; }
.menu-name { font-weight: 600; color: var(--beige-2); font-size: 0.62em; letter-spacing: 0; white-space: normal; }
.flip-name .menu-name { display: block; margin-top: 6px; font-size: 0.55em; }
.matrix-table .menu-name, .tray-chip-card .menu-name { font-size: 0.85em; }


/* Apple: отклик на нажатие – мгновенно, отпускание – мягко */
.btn-hero, .btn-primary, .btn-secondary, .filter-pill, .allergen-pill, .seg-btn, .icon-action-btn, .ing-chip, .copy-script-btn, .arch-jump-btn, .music-btn, .lang-switch button, .tray-remove-btn, .deck-btn {
  transition-property: background, color, border-color, box-shadow, transform; transition-duration: 0.35s; transition-timing-function: var(--soft);
  touch-action: manipulation;
}
.btn-hero:active, .btn-primary:active, .btn-secondary:active, .filter-pill:active, .allergen-pill:active, .seg-btn:active, .icon-action-btn:active, .ing-chip:active, .copy-script-btn:active, .arch-jump-btn:active, .music-btn:active, .tray-remove-btn:active, .deck-btn:active {
  transform: scale(0.97); transition-duration: 0.1s; transition-timing-function: ease-out;
}
.allergen-pill.is-excluded:active { transform: translateY(2px) scale(0.97); }
.flip-card.is-dragging .flip-inner { transition: none; }

@media (prefers-reduced-motion: reduce) {
  .mq-track { animation: none !important; transform: none !important; }
  .marquee { overflow-x: auto; }
  .reveal { transition: opacity 0.2s ease !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .topbar, .topbar.is-scrolled { background: #121110; backdrop-filter: none; -webkit-backdrop-filter: none; }
  .gl-label { background: #181615; backdrop-filter: none; }
  .medal-overlay.is-open { background: rgba(8, 7, 7, 0.94); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

/* ---------- Açıq tema / светлая тема ---------- */
.theme-btn .ic-moon { display: none; }
:root[data-theme="light"] .theme-btn .ic-sun { display: none; }
:root[data-theme="light"] .theme-btn .ic-moon { display: block; }
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after { transition: background-color 0.5s var(--soft), color 0.5s var(--soft), border-color 0.5s var(--soft), box-shadow 0.5s var(--soft), fill 0.5s var(--soft) !important; }

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f1eb; --bg-2: #fbf9f5; --card: #ffffff; --card-2: #f8f5ef; --card-3: #eee7da;
  --line: rgba(54, 52, 52, 0.10); --line-2: rgba(54, 52, 52, 0.18);
  --text: #1f1d1c; --text-2: rgba(31, 29, 28, 0.70); --text-3: rgba(31, 29, 28, 0.48);
  --beige: #8f8068; --beige-2: #7a6b52; --beige-3: #5a4f3c;
  --red: #c4432e; --red-bg: rgba(196, 67, 46, 0.10); --green: #2b8452; --green-bg: rgba(43, 132, 82, 0.10);
}
:root[data-theme="light"] .topbar { background: rgba(244, 241, 235, 0.62); }
:root[data-theme="light"] .topbar.is-scrolled { background: rgba(244, 241, 235, 0.82); box-shadow: 0 10px 24px -16px rgba(60, 50, 40, 0.45); }
:root[data-theme="light"] .lang-switch, :root[data-theme="light"] .music-btn:not(.is-on) { background: rgba(54, 52, 52, 0.06); }
:root[data-theme="light"] .hero { background: radial-gradient(120% 70% at 50% 30%, #ffffff 0%, #f1ece3 45%, var(--bg) 78%); }
:root[data-theme="light"] .btn-hero { box-shadow: 0 10px 30px rgba(120, 100, 70, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.7); }
:root[data-theme="light"] .ornament-rule::before, :root[data-theme="light"] .ornament-rule::after { background: linear-gradient(90deg, transparent, var(--beige), transparent); }
:root[data-theme="light"] .arch-card { background: linear-gradient(180deg, #ffffff, #f6f2ea); box-shadow: 0 10px 30px rgba(60, 50, 40, 0.08); }
:root[data-theme="light"] .arch-card.is-featured { background: linear-gradient(180deg, #efe6d6, #e4d8c3); border-color: rgba(143, 128, 104, 0.4); }
:root[data-theme="light"] .is-featured .arch-value.odo { color: var(--beige-3); }
:root[data-theme="light"] .arch-card::before, :root[data-theme="light"] .dish-card::before { background: radial-gradient(420px 260px at var(--mx, 50%) var(--my, -20%), rgba(255, 255, 255, 0.7), transparent 65%); }
:root[data-theme="light"] .kpi-bar, :root[data-theme="light"] .train-progress .kpi-bar { background: rgba(54, 52, 52, 0.08); }
:root[data-theme="light"] .dish-card { background: linear-gradient(180deg, #ffffff 0%, #fbf8f3 40%); box-shadow: 0 18px 44px rgba(60, 50, 40, 0.10); }
:root[data-theme="light"] .dish-card.is-blocked { filter: grayscale(0.9) brightness(0.92); opacity: 0.5; }
:root[data-theme="light"] .schematic-module { background: var(--card-2); }
:root[data-theme="light"] .ing-chip { background: #ffffff; }
:root[data-theme="light"] .ing-chip.is-selected { background: #efe6d6; border-color: var(--beige); }
:root[data-theme="light"] .ing-icon { background: #f3ece0; }
:root[data-theme="light"] .level-1 { background: var(--card-2); }
:root[data-theme="light"] .level-2 .level-text, :root[data-theme="light"] .flip-speech { color: #2a2623; }
:root[data-theme="light"] .scenario-pairing { color: #3f7a59; }
:root[data-theme="light"] .cat-hot { background: rgba(196, 90, 50, 0.10); color: #a54a26; border-color: rgba(196, 90, 50, 0.3); }
:root[data-theme="light"] .cat-cold { background: rgba(60, 120, 95, 0.10); color: #2f6c55; border-color: rgba(60, 120, 95, 0.3); }
:root[data-theme="light"] .cat-share { background: rgba(143, 128, 104, 0.12); color: var(--beige-3); border-color: rgba(143, 128, 104, 0.3); }
:root[data-theme="light"] .seg-btn.is-active { background: #ffffff; color: var(--beige-3); box-shadow: 0 2px 8px rgba(60, 50, 40, 0.12); }
:root[data-theme="light"] .allergen-pill { box-shadow: 0 3px 0 rgba(60, 50, 40, 0.16); }
:root[data-theme="light"] .allergen-pill.is-excluded { color: #fff; }
:root[data-theme="light"] .allergen-pill.is-safe-all.is-active { color: #fff; }
:root[data-theme="light"] .icon-action-btn { background: #ffffff; }
:root[data-theme="light"] .icon-action-btn.is-practiced { color: #fff; }
:root[data-theme="light"] .copy-script-btn.is-copied { color: #fff; }
:root[data-theme="light"] .blocked-badge { color: #fff; }
:root[data-theme="light"] .mq-b { background: #ece4d6; color: var(--beige-3); border-color: rgba(143, 128, 104, 0.3); }
:root[data-theme="light"] .mq-b .mq-item em { background: rgba(143, 128, 104, 0.16); color: var(--beige-3); }
:root[data-theme="light"] .mq-a { box-shadow: 0 14px 30px rgba(60, 50, 40, 0.18); }
:root[data-theme="light"] .flip-front { background: radial-gradient(120% 90% at 20% 0%, #ffffff 0%, #f6f1e8 55%, #ece4d6 100%); }
:root[data-theme="light"] .flip-back { background: linear-gradient(160deg, #fbf8f2, #efe7da); border-color: rgba(143, 128, 104, 0.35); }
:root[data-theme="light"] .flip-face { box-shadow: 0 24px 50px rgba(60, 50, 40, 0.16); }
:root[data-theme="light"] .deck-pile span { background: linear-gradient(160deg, #ffffff, #ece4d6); box-shadow: 0 6px 14px rgba(60, 50, 40, 0.18); }
:root[data-theme="light"] .deck-pile span:nth-child(3) { background: url("img/logo.webp") center / 70% no-repeat, linear-gradient(160deg, #ffffff, #ece4d6); }
:root[data-theme="light"] .deck-done { background: radial-gradient(90% 80% at 50% 30%, #e3f1e8, #f6f2ea); }
:root[data-theme="light"] .table-stage { background: radial-gradient(70% 70% at 50% 45%, #ffffff 0%, #ece5d9 80%); }
:root[data-theme="light"] .table-empty { background: rgba(255, 255, 255, 0.85); }
:root[data-theme="light"] .gl-tag { background: rgba(255, 255, 255, 0.9); color: var(--beige-3); border-color: rgba(143, 128, 104, 0.35); }
:root[data-theme="light"] .tray-script-output { background: #ffffff; }
:root[data-theme="light"] .matrix-table th { background: var(--card-2); }
:root[data-theme="light"] .matrix-table tbody tr:hover, :root[data-theme="light"] .matrix-table tbody tr:active { background: #ffffff; box-shadow: 0 14px 30px rgba(60, 50, 40, 0.12); }
:root[data-theme="light"] .medal-overlay { background: rgba(244, 241, 235, 0.75); }
:root[data-theme="light"] .medal-card { background: radial-gradient(120% 80% at 50% 0%, #ffffff, #efe7da 70%); box-shadow: 0 40px 100px rgba(60, 50, 40, 0.25); }
:root[data-theme="light"] .dish-photo { box-shadow: 0 14px 34px rgba(60, 50, 40, 0.16); }
:root[data-theme="light"] .fly-coin img { box-shadow: 0 0 0 2px #c9b994, 0 14px 34px rgba(60, 50, 40, 0.25); }
:root[data-theme="light"] .scan-beam { background: linear-gradient(180deg, transparent, rgba(143, 128, 104, 0.10) 45%, rgba(143, 128, 104, 0.5) 50%, rgba(143, 128, 104, 0.10) 55%, transparent); }
:root[data-theme="light"] .select-input option { background: #ffffff; }

/* Hər düymə işləsin / всё, что похоже на кнопку, нажимается */
button.allergen-tag, button.allergen-safe-tag, button.cat-badge, button.mq-item, button.matrix-dot-yes, button.gl-tag {
  font: inherit; font-size: 12px; font-weight: 700; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 0.35s var(--soft), filter 0.25s var(--soft), background 0.25s var(--soft);
}
button.cat-badge { font-size: 11px; }
button.allergen-safe-tag { border: 1px solid rgba(143, 208, 168, 0.25); }
button.cat-badge.cat-hot, button.cat-badge.cat-cold, button.cat-badge.cat-share { border-width: 1px; border-style: solid; }
button.mq-item { background: none; color: inherit; font-size: 14px; padding: 4px 2px; }
button.matrix-dot-yes { font-size: 12px; }
button.gl-tag { pointer-events: auto; font-size: 11px; font-weight: 800; padding: 4px 9px; }
button.allergen-tag:hover, button.allergen-safe-tag:hover, button.cat-badge:hover, button.matrix-dot-yes:hover, button.gl-tag:hover { filter: brightness(1.12); }
button.allergen-tag:active, button.allergen-safe-tag:active, button.cat-badge:active, button.mq-item:active, button.matrix-dot-yes:active, button.gl-tag:active { transform: scale(0.95); transition-duration: 0.1s; }
.marquee:active .mq-track { animation-play-state: paused; }
.arch-card[data-go], .matrix-table tbody tr[data-dish], .tray-chip-card[data-dish] { cursor: pointer; }
.arch-card[data-go]:active { filter: brightness(1.06); }
.is-flash { animation: flashRing 1.5s var(--soft); }
@keyframes flashRing { 0% { box-shadow: 0 0 0 0 rgba(201, 187, 158, 0.0); } 20% { box-shadow: 0 0 0 4px rgba(201, 187, 158, 0.75); } 100% { box-shadow: 0 0 0 0 rgba(201, 187, 158, 0); } }
@media (max-width: 760px) { button.mq-item { font-size: 13px; } }

/* Masaya uçan təam / блюдо летит к столу */
.fly-dish { position: fixed; left: 0; top: 0; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; z-index: 90; pointer-events: none;
  box-shadow: 0 14px 30px rgba(0,0,0,0.45), 0 0 0 2px rgba(201,187,158,0.85); will-change: transform, opacity; }
.fly-dish img { width: 100%; height: 100%; object-fit: cover; display: block; }
