/* Стиль «Чай Китайской Панды» (pandatea.shop): комикс-необрутализм —
   кремовый фон в горошек, чёрные рамки 3px, жёсткая тень 4px, без скруглений. */
:root {
  --cream: #fffcdf;
  --dot: #efe9c4;
  --white: #ffffff;
  --black: #000000;
  --ink-2: #3b3b36;
  --ink-3: #77735f;
  --green: #1f512a;
  --red: #f45745;
  --yellow: #ffdc5a;
  --lime: #9ae885;
  --tea: #c9821f;
  --tea-light: #f2b544;
  --b: 3px solid var(--black);
  --sh: 4px 4px 0 var(--black);
  --display: "Yanone Kaffeesatz", "Arial Narrow", sans-serif;
  --body: "Roboto", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  color: var(--black);
  font: 16px/1.55 var(--body);
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--cream);
  background-image: radial-gradient(var(--dot) 22%, transparent 24%), radial-gradient(var(--dot) 22%, transparent 24%);
  background-size: 40px 40px;
  background-position: 0 0, 20px 20px;
}
#app { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }

h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; }
h1 { font-size: 40px; }
h2 { font-size: 30px; }
h3 { font-size: 22px; }
p { margin: 0 0 12px; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }

.screen { animation: rise .35s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.stagger > * { animation: rise .4s cubic-bezier(.2,.7,.2,1) both; }
.stagger > *:nth-child(1) { animation-delay: .02s } .stagger > *:nth-child(2) { animation-delay: .05s }
.stagger > *:nth-child(3) { animation-delay: .08s } .stagger > *:nth-child(4) { animation-delay: .11s }
.stagger > *:nth-child(5) { animation-delay: .14s } .stagger > *:nth-child(6) { animation-delay: .17s }
.stagger > *:nth-child(7) { animation-delay: .2s } .stagger > *:nth-child(n+8) { animation-delay: .23s }

/* ---------- общие блоки ---------- */
.card { background: var(--white); border: var(--b); box-shadow: var(--sh); border-radius: 0; }
.list { display: grid; gap: 14px; }
.press { transition: transform .08s, box-shadow .08s; }
.press:active, .module:active, .lesson-row:active, .btn:active, .opt:active, .quick button:active, .final:active {
  transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--black);
}

/* ---------- заставка ---------- */
.splash { min-height: 70vh; display: grid; place-content: center; justify-items: center; gap: 8px; font-family: var(--display); font-size: 24px; text-transform: uppercase; }
.splash-cup { width: 70px; height: 38px; border: var(--b); border-top: 0; border-radius: 0 0 38px 38px; position: relative; overflow: hidden; background: var(--white); }
.splash-cup::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 50%; background: var(--tea-light); border-top: var(--b); animation: pour 1.4s ease-in-out infinite alternate; }
@keyframes pour { from { height: 15%; } to { height: 75%; } }
.steam { display: flex; gap: 9px; height: 26px; }
.steam i { width: 4px; height: 22px; background: var(--black); animation: steam 1.6s ease-in-out infinite; }
.steam i:nth-child(2) { animation-delay: .25s } .steam i:nth-child(3) { animation-delay: .5s }
@keyframes steam { 0% { transform: translateY(6px) scaleY(.4); opacity: 0 } 50% { opacity: 1 } 100% { transform: translateY(-8px); opacity: 0 } }

/* ---------- шапка как на сайте ---------- */
.brandbar { background: var(--green); border: var(--b); box-shadow: var(--sh); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; margin-bottom: 22px; color: #fff; }
.brandbar img { height: 48px; width: auto; display: block; }
.brandbar .word { font-family: var(--display); font-weight: 700; font-size: 26px; line-height: .9; text-transform: uppercase; text-align: right; color: #fff; }

.hero { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; margin-bottom: 18px; }
.eyebrow { font-family: var(--display); font-size: 18px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); line-height: 1.1; }
.hero h1 { margin: 2px 0 8px; font-size: 38px; }
.hero .sub { color: var(--ink-2); font-size: 14.5px; }
.bowl { width: 112px; height: 112px; position: relative; }
.bowl svg { width: 100%; height: 100%; overflow: visible; }
.bowl .pct { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 24px; font-family: var(--display); font-weight: 700; font-size: 28px; }
.bowl .tea-fill { transition: transform 1.2s cubic-bezier(.2,.7,.2,1); }
.wave { animation: wave 3.5s ease-in-out infinite alternate; }
@keyframes wave { from { transform: translateX(-6px); } to { transform: translateX(6px); } }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--white); border: var(--b); box-shadow: var(--sh); margin-bottom: 16px; }
.stat { padding: 10px 4px; text-align: center; }
.stat + .stat { border-left: var(--b); }
.stat b { display: block; font-family: var(--display); font-weight: 700; font-size: 30px; line-height: 1; }
.stat span { font-size: 12px; color: var(--ink-2); text-transform: uppercase; font-weight: 500; letter-spacing: .02em; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 12px; }
.section-title span { font-size: 13px; color: var(--ink-3); text-transform: uppercase; font-weight: 500; }

.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.quick button { padding: 12px 14px; text-align: left; border: var(--b); box-shadow: var(--sh); background: var(--yellow); }
.quick button:nth-child(2) { background: var(--lime); }
.quick b { display: block; font-family: var(--display); font-weight: 700; font-size: 21px; text-transform: uppercase; line-height: 1.05; }
.quick span { font-size: 12.5px; color: var(--ink-2); }

/* ---------- модули ---------- */
.module { display: grid; grid-template-columns: 50px 1fr auto; gap: 14px; align-items: center; padding: 12px 14px 12px 12px; text-align: left; width: 100%; position: relative; }
.numeral { width: 50px; height: 50px; display: grid; place-items: center; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-weight: 700; font-size: 24px; background: var(--yellow); border: var(--b); }
.module.passed .numeral { background: var(--lime); }
.module h3 { font-size: 22px; }
.module .meta { font-size: 12.5px; color: var(--ink-2); margin-top: 3px; }
.bar { height: 10px; border: 2px solid var(--black); background: var(--white); margin-top: 7px; }
.bar i { display: block; height: 100%; background: var(--green); transition: width .8s; }
.chev { font-family: var(--display); font-size: 30px; font-weight: 700; }

/* наклейка «сдано» */
.seal { font-family: var(--display); font-weight: 700; font-size: 17px; line-height: .95; text-transform: uppercase; text-align: center; padding: 6px 8px; background: var(--lime); border: var(--b); box-shadow: 2px 2px 0 var(--black); transform: rotate(-7deg); white-space: nowrap; }
.seal br { display: none; }
.seal.big { font-size: 46px; padding: 10px 26px; box-shadow: var(--sh); display: inline-block; animation: stamp .5s cubic-bezier(.3,1.6,.5,1) both .2s; }
.seal.fail { background: var(--yellow); }
@keyframes stamp { from { transform: rotate(-7deg) scale(2); opacity: 0; } to { transform: rotate(-7deg) scale(1); opacity: 1; } }

.final { padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; background: var(--green); color: #fff; text-align: left; width: 100%; border: var(--b); box-shadow: var(--sh); }
.final .eyebrow { color: var(--lime); }
.final h3 { font-size: 28px; margin: 2px 0 4px; color: #fff; }
.final p { margin: 0; font-size: 13px; opacity: .85; }
.final.locked { filter: grayscale(.7); }
.final .seal { background: var(--yellow); color: var(--black); }

/* ---------- модуль ---------- */
.back { display: inline-flex; gap: 6px; align-items: center; font-family: var(--display); font-size: 20px; font-weight: 600; text-transform: uppercase; padding: 0 0 14px; }
.page-head { margin-bottom: 20px; }
.page-head h1 { margin-top: 2px; }
.page-head .lead { color: var(--ink-2); margin-top: 10px; }
.lesson-row { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; width: 100%; text-align: left; }
.dot { width: 30px; height: 30px; border: var(--b); display: grid; place-items: center; font-family: var(--display); font-size: 18px; font-weight: 700; background: var(--white); }
.dot.done { background: var(--lime); }
.lesson-row b { font-weight: 700; font-size: 15.5px; line-height: 1.3; display: block; }
.lesson-row small { color: var(--ink-3); font-size: 12.5px; }

.btn { display: flex; justify-content: center; align-items: center; gap: 8px; width: 100%; padding: 13px 18px; font-weight: 700; font-size: 17px; text-transform: uppercase; background: var(--red); color: var(--black); border: var(--b); box-shadow: var(--sh); }
.btn.ghost { background: var(--white); }
.btn.jade { background: var(--lime); }
.btn.red { background: var(--red); }
.btn.yellow { background: var(--yellow); }
.btn:disabled { opacity: .45; }
.btns { display: grid; gap: 14px; margin-top: 20px; }
.note { font-size: 13px; color: var(--ink-3); text-align: center; margin-top: 12px; }

/* ---------- урок ---------- */
.prose { font-size: 16.5px; line-height: 1.65; background: var(--white); border: var(--b); box-shadow: var(--sh); padding: 18px 18px 8px; }
.prose h2, .prose h3 { font-size: 26px; margin: 22px 0 8px; }
.prose > h2:first-child, .prose > h3:first-child { margin-top: 0; }
.prose ul { margin: 0 0 14px; padding-left: 0; list-style: none; }
.prose li { position: relative; padding-left: 22px; margin-bottom: 6px; }
.prose li::before { content: ""; position: absolute; left: 3px; top: .55em; width: 9px; height: 9px; background: var(--red); border: 2px solid var(--black); }
.prose strong { font-weight: 700; background: linear-gradient(transparent 62%, rgba(255,220,90,.75) 62%); }

.box { padding: 16px 16px 8px; margin: 22px 0; }
.box h3 { font-size: 24px; margin-bottom: 10px; }
.facts { list-style: none; margin: 0; padding: 0; counter-reset: f; }
.facts li { counter-increment: f; display: grid; grid-template-columns: 30px 1fr; gap: 8px; padding: 8px 0; border-top: 2px dashed var(--black); font-size: 15px; }
.facts li:first-child { border-top: 0; }
.facts li::before { content: counter(f); font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1; color: var(--red); }
.box.yellowbox { background: var(--yellow); }
.pitch { background: var(--lime); }
.pitch p { font-size: 15.5px; font-style: italic; }
.pages { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; }

/* ---------- тест ---------- */
.quiz-top { display: flex; justify-content: space-between; align-items: center; font-family: var(--display); font-size: 20px; font-weight: 600; text-transform: uppercase; margin-bottom: 8px; }
.steps { display: flex; gap: 0; margin-bottom: 20px; border: var(--b); background: var(--white); height: 14px; }
.steps i { flex: 1; }
.steps i + i { border-left: 1px solid rgba(0,0,0,.25); }
.steps i.ok { background: var(--lime); } .steps i.bad { background: var(--red); } .steps i.cur { background: var(--yellow); } .steps i.done { background: var(--green); }
.question { font-family: var(--body); font-weight: 700; font-size: 20px; line-height: 1.35; margin-bottom: 18px; background: var(--white); border: var(--b); box-shadow: var(--sh); padding: 16px; }
.diff { display: inline-block; font-size: 13px; letter-spacing: 3px; color: var(--red); margin-bottom: 4px; }
.options { display: grid; gap: 12px; }
.opt { display: grid; grid-template-columns: 32px 1fr; gap: 10px; align-items: center; padding: 12px; text-align: left; width: 100%; font-size: 15.5px; line-height: 1.35; }
.opt .l { width: 30px; height: 30px; border: var(--b); display: grid; place-items: center; font-family: var(--display); font-size: 19px; font-weight: 700; background: var(--yellow); }
.opt.picked { background: var(--yellow); }
.opt.right { background: var(--lime); }
.opt.right .l { background: var(--white); }
.opt.wrong { background: var(--red); }
.opt.wrong .l { background: var(--white); }
.opt.dim { opacity: .5; box-shadow: none; }
.explain { margin-top: 16px; padding: 12px 14px; background: var(--white); border: var(--b); box-shadow: var(--sh); font-size: 15px; animation: rise .3s both; }
.explain b { display: block; font-family: var(--display); font-size: 24px; text-transform: uppercase; line-height: 1; margin-bottom: 4px; color: var(--green); }
.explain.bad b { color: var(--red); }

/* ---------- результат ---------- */
.result { text-align: center; padding-top: 10px; }
.result .big { font-family: var(--display); font-weight: 700; font-size: 96px; line-height: 1; margin: 10px 0 4px; }
.result .seal { margin: 8px auto 0; }
.review { text-align: left; margin-top: 26px; }
.review .card { padding: 12px 14px; margin-bottom: 14px; font-size: 14.5px; }
.review .q { font-weight: 700; margin-bottom: 6px; }
.review .y { color: #c0321f; font-weight: 500; } .review .r { color: var(--green); font-weight: 700; }

/* ---------- админка ---------- */
.tabs { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { padding: 6px 12px; border: var(--b); background: var(--white); box-shadow: 2px 2px 0 var(--black); font-weight: 700; font-size: 13.5px; text-transform: uppercase; }
.tabs button.on { background: var(--yellow); }
.user-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 12px 14px; width: 100%; text-align: left; align-items: center; }
.user-row b { font-weight: 700; display: block; font-size: 15px; }
.user-row small { color: var(--ink-3); font-size: 12.5px; }
.pill { font-size: 11.5px; padding: 2px 7px; border: 2px solid var(--black); font-weight: 700; white-space: nowrap; text-transform: uppercase; }
.pill.pending { background: var(--yellow); }
.pill.active { background: var(--lime); }
.pill.blocked { background: #ddd; }
.pill.gold { background: var(--red); }
.row-actions { display: flex; gap: 12px; margin-top: 4px; }
.row-actions .btn { padding: 9px; font-size: 14px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.mini-table td { padding: 9px 4px; border-top: 2px solid var(--black); vertical-align: top; }
.mini-table tr:first-child td { border-top: 0; }
.mini-table td:last-child { text-align: right; white-space: nowrap; }

.empty { text-align: center; padding: 40px 20px; }
.empty .icon { font-size: 56px; margin-bottom: 8px; }

#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 30px); background: var(--yellow); border: var(--b); box-shadow: var(--sh); padding: 10px 16px; font-size: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: all .25s; z-index: 10; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 360px) { h1, .hero h1 { font-size: 32px; } .bowl { width: 92px; height: 92px; } .quick { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- ассортимент ---------- */
.catalog-cta { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 14px 16px; margin-top: 14px; background: var(--red); }
.catalog-cta b { display: block; font-family: var(--display); font-weight: 700; font-size: 26px; text-transform: uppercase; line-height: 1; }
.catalog-cta span { font-size: 13px; }
.search { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border: var(--b); box-shadow: var(--sh); background: var(--white); border-radius: 0; outline: none; -webkit-appearance: none; }
.search:focus { background: #fffbe6; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 16px 4px 10px 0; margin: 0 -16px 8px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; padding: 6px 12px; border: var(--b); background: var(--white); box-shadow: 2px 2px 0 var(--black); font-weight: 700; font-size: 13px; text-transform: uppercase; white-space: nowrap; }
.chips button.on { background: var(--yellow); }
.product { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: start; width: 100%; text-align: left; padding: 12px 14px; }
.product small { display: block; font-size: 11.5px; color: var(--ink-3); text-transform: uppercase; font-weight: 500; }
.product b { display: block; font-weight: 700; font-size: 15.5px; line-height: 1.3; margin: 1px 0 3px; }
.product span { font-size: 13.5px; color: var(--ink-2); line-height: 1.4; }
.price { font-family: var(--display); font-weight: 700; font-size: 22px; white-space: nowrap; }
.price-line { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pricetag { font-family: var(--display); font-weight: 700; font-size: 22px; padding: 2px 10px; background: var(--yellow); border: var(--b); }
.pack { font-size: 12.5px; font-weight: 700; padding: 5px 8px; border: 2px solid var(--black); background: var(--white); align-self: center; }
.related .rel { display: block; width: 100%; text-align: left; padding: 9px 0; border-top: 2px dashed var(--black); font-weight: 700; font-size: 15px; }
.related .rel:first-of-type { border-top: 0; }
.related { padding-bottom: 6px; }
details.related summary { font-family: var(--display); font-weight: 700; font-size: 22px; text-transform: uppercase; cursor: pointer; list-style: none; padding-bottom: 8px; }
details.related summary::-webkit-details-marker { display: none; }
details.related summary::after { content: " ▾"; }
details.related[open] summary::after { content: " ▴"; }
details.related { margin: 6px 0 18px; }
