/*
  Oyun Qurdu — dizayn sistemi.

  Duruş: redaksiya. Dərinlik haşiyə və kölgə ilə yox, boşluq və tipoqrafiya
  ilə qurulur. Qayda: bir səthi digərindən ayıran şey saç qalınlığında
  xəttdir — 2px haşiyə və sərt ofset kölgə yoxdur.

  Üç tipoqrafik registr var və hər birinin öz işi:
    · display — nəhəng, sıx, səhifədə bir dəfə;
    · meta    — kiçik, aralıqlı, BÖYÜK HƏRF; nişan, etiket, naviqasiya;
    · mətn    — qalan hər şey.

  Vurğu (qırmızı) az işlədilir: qiymət, aktiv vəziyyət, kiçik kvadrat nişan.
  Hər yerə paylananda vurğu olmaqdan çıxır.
*/

:root {
  --ink:        #121212;
  --ink-soft:   #3A3A3A;
  --mute:       #737373;
  --paper:      #FFFFFF;
  --shell:      #FFFFFF;

  --accent:       #E52E2E;
  --accent-press: #C42525;
  --wash:         #FDECEC;
  --slab:         #121212;
  --slab-ink:     #FFFFFF;
  --tile:         #EFEFEF;

  --good:       #0F8F5C;
  --good-wash:  #F0FAF5;
  --bad:        #C41E1E;
  --bad-wash:   #FDF0F0;
  --warn:       #B67400;
  --warn-wash:  #FFF8EC;

  /* Bütün ayırıcılar bu bir dəyərdən gəlir. */
  --hair:       rgba(18, 18, 18, .14);
  --hair-soft:  rgba(18, 18, 18, .07);
  /* Pərdə: mətn oxunaqlı qalsın deyə fonun üstündən keçir. */
  --scrim:      rgba(255, 255, 255, .86);
  /* Köhnə adlar — şablonlarda hələ istinad var, qırılmasın. */
  --line:       var(--hair);
  --edge:       var(--hair);
  --r-xs:       4px;
  --r-xl:       8px;

  --font: Archivo, "Segoe UI", system-ui, sans-serif;
  /* Kiçik registr artıq monoşrift deyil: DM Sans dar və səliqəlidir,
     böyük hərfdə də adi mətn kimi oxunur. Aralıq ona görə azaldılıb —
     monoşriftin öz boşluğu vardı, sans-da .19em çox açıq düşürdü. */
  --meta: "DM Sans", Archivo, system-ui, sans-serif;

  --r:    4px;
  --r-lg: 6px;
  --pill: 999px;

  --tap: 46px;
  --bar: 62px;
}

:root.dark, .dark {
  --ink:        #FFFFFF;
  --ink-soft:   #C9C9C9;
  --mute:       #8A8A8A;
  --paper:      #1A1A1A;
  --shell:      #121212;

  --wash:         #2A1616;
  --slab:         #121212;
  --slab-ink:     #FFFFFF;
  --tile:         #232323;

  --good-wash:  #10231B;
  --bad-wash:   #2A1414;
  --warn-wash:  #241C0D;

  --hair:       rgba(255, 255, 255, .16);
  --hair-soft:  rgba(255, 255, 255, .08);
  --scrim:      rgba(18, 18, 18, .80);
}

*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; margin: 0; padding: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Fon kadrları yalnız ana səhifədədir. Kök həmişə şəffafdır; fon kadrı olan
   səhifədə gövdə də şəffaf olur və rəngi pərdə verir, çünki gövdənin fonu
   şəffaf deyilsə kökə ötürülür və tuvalın üstünü örtür. Qalan səhifələrdə
   məhz o ötürmə səhifəyə rəngini verir. */
html { background: transparent; }
#bgSeq, #bgScrim {
  position: fixed; inset: 0; pointer-events: none; contain: strict;
}
/* Qatlar: səhifə rəngi ən altda, personaj onun üstündə, məzmun hamısının
   üstündə. Kadrlarda artıq fon yoxdur, ona görə pərdə örtmür — səhifənin
   öz rəngini verir və tuvalın ARXASINDA dayanır. */
#bgScrim { z-index: -3; background: var(--shell); }
#bgSeq   { z-index: -2; width: 100%; height: 100%; display: block; opacity: .55; }

body {
  background: var(--shell);
  color: var(--ink);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  overflow-x: hidden;
  padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased;
}
body.has-bg { background: transparent; }
@media (min-width: 768px) { body { padding-bottom: 0; } }

/* ── tipoqrafiya ───────────────────────────────────────────────────────── */
.t-display { font-stretch: 118%; font-weight: 800; letter-spacing: -.042em; line-height: .96; }
.t-title   { font-stretch: 108%; font-weight: 700; letter-spacing: -.022em; line-height: 1.15; }
.t-price   { font-weight: 700; letter-spacing: -.01em; }

/* Meta registri: nişan, etiket, bölmə başlığı — hamısı bu formadadır. */
.t-label, .meta {
  font-family: var(--meta); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--mute);
}
/* Vurğu kvadratı — referansdakı nöqtə. Sözün yanında dayanır, bəzək deyil:
   harada olsa, "bura bax" deməkdir. */
.sq::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--accent); margin-right: 10px; vertical-align: middle;
  position: relative; top: -1px;
}

/* ── karkas ────────────────────────────────────────────────────────────── */
.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
@media (min-width: 768px) { .wrap { padding-inline: 32px; } }
.sec { padding-block: 40px; }
@media (min-width: 768px) { .sec { padding-block: 56px; } }

.panel { background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r); }

/* Bölmə başlığı. Hap deyil — etiket, yanında səhifəni kəsən nazik xətt. */
.pill-label {
  display: inline-flex; align-items: center;
  font-family: var(--meta); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  white-space: nowrap;
}
.pill-label::before {
  content: ""; width: 6px; height: 6px; background: var(--accent);
  margin-right: 10px; flex: 0 0 auto;
}
.pill-label svg { display: none; }        /* etiket ikona ehtiyac duymur */
.pill-label--accent { color: var(--accent); }

.head { display: flex; align-items: center; justify-content: space-between;
        gap: 20px; margin-bottom: 20px;
        border-bottom: 1px solid var(--hair); padding-bottom: 12px; }
.head h2 { font-size: 20px; }
.head a { font-family: var(--meta); font-size: 10.5px; letter-spacing: .14em;
          text-transform: uppercase; color: var(--mute); white-space: nowrap; }
@media (hover: hover) { .head a:hover { color: var(--ink); } }

/* ── məhsul kartı ──────────────────────────────────────────────────────── */
.plate { display: block; background: none; }
.plate__art {
  aspect-ratio: 1/1; background: var(--tile); display: grid; place-items: center;
  overflow: hidden; position: relative; border-radius: var(--r);
}
.plate__art img { width: 100%; height: 100%; object-fit: cover;
                  transition: transform .5s cubic-bezier(.2,.7,.3,1); }
@media (hover: hover) { .plate:hover .plate__art img { transform: scale(1.05); } }
.plate:active .plate__art { opacity: .82; }
/* Endirim: doldurulmuş iri nişan yox, küncdə kiçik meta yazı. */
.plate__off {
  position: absolute; left: 10px; top: 10px;
  font-family: var(--meta); font-size: 10px; letter-spacing: .12em;
  color: #fff; background: var(--accent); padding: 3px 7px; border-radius: 2px;
}
.plate__body { padding: 12px 2px 0; }
.plate__cat  { font-family: var(--meta); font-size: 10px; font-weight: 600;
               letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
.plate__name { font-size: 14px; font-weight: 600; line-height: 1.35; margin-top: 6px;
               letter-spacing: -.01em;
               display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
               overflow: hidden; min-height: 2.7em; }
.plate__row  { display: flex; align-items: baseline; gap: 8px; margin-top: 10px;
               padding-top: 10px; border-top: 1px solid var(--hair-soft); }
.plate__now  { font-size: 15px; color: var(--ink); }
.plate__was  { font-family: var(--meta); font-size: 11px; color: var(--mute);
               text-decoration: line-through; }
.plate--out .plate__art::after {
  content: attr(data-out); position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(18,18,18,.72); color: #fff;
  font-family: var(--meta); font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
}

/* ── düymələr ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tap); padding: 0 24px;
  border: 1px solid var(--ink); border-radius: var(--r);
  background: transparent; color: var(--ink);
  font-family: var(--meta); font-size: 11.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease, opacity .18s ease;
}
@media (hover: hover) { .btn:hover { background: var(--ink); color: var(--shell); } }
.btn:active { opacity: .7; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: hover) {
  .btn--primary:hover { background: var(--accent-press); border-color: var(--accent-press); color: #fff; }
}
.btn--slab { background: var(--slab); border-color: var(--slab); color: var(--slab-ink); }
.btn--ghost { border-color: transparent; }
@media (hover: hover) { .btn--ghost:hover { background: none; color: var(--accent); } }
.btn--danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn--block { width: 100%; }
.btn--sm { min-height: 38px; padding: 0 16px; font-size: 10px; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.field {
  width: 100%; min-height: var(--tap); padding: 0 16px; font-size: 15px;
  background: transparent; color: var(--ink);
  border: 1px solid var(--hair); border-radius: var(--r);
  transition: border-color .18s ease;
}
.field:focus { outline: none; border-color: var(--accent); }
.field::placeholder { color: var(--mute); }
textarea.field { padding: 14px 16px; min-height: 110px; resize: vertical; }

/* ── alt naviqasiya ────────────────────────────────────────────────────── */
.bottombar {
  position: fixed; inset: auto 0 0 0; z-index: 60;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--shell); border-top: 1px solid var(--hair);
  padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) { .bottombar { display: none; } }
.bottombar a { display: flex; flex-direction: column; align-items: center; justify-content: center;
               gap: 5px; height: var(--bar); color: var(--mute);
               font-family: var(--meta); font-size: 9.5px; font-weight: 600; letter-spacing: .1em;
               text-transform: uppercase; position: relative; transition: color .18s ease; }
.bottombar a i { display: block; line-height: 0; }
.bottombar a[aria-current="page"] { color: var(--ink); }
/* Aktivlik dolu kvadratla yox, üstdəki qısa qırmızı cizgi ilə göstərilir. */
.bottombar a[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 2px; background: var(--accent);
}
.bottombar .dot { position: absolute; top: 8px; left: 50%; margin-left: 6px;
                  background: var(--accent); color: #fff;
                  font-family: var(--meta); font-size: 9px;
                  min-width: 16px; height: 16px; display: grid; place-items: center;
                  padding: 0 4px; border-radius: var(--pill); }

.bottombar .bottombar__fab {
  align-self: center; justify-self: center; margin-top: 0;
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--accent); color: #fff; border-radius: var(--r);
  transition: opacity .18s ease;
}
.bottombar .bottombar__fab:active { opacity: .7; }
.bottombar .bottombar__fab[aria-current="page"] { background: var(--ink); color: var(--shell); }
.bottombar .bottombar__fab[aria-current="page"]::before { display: none; }

/* ── başlıq ────────────────────────────────────────────────────────────── */
.topbar { position: sticky; top: 0; z-index: 50;
          border-bottom: 1px solid var(--hair);
          /* Birinci elan ehtiyatdır: color-mix tanınmayan brauzerdə zolaq
             şəffaf qalıb məzmunun üstünə düşməsin. */
          background: var(--shell);
          background: color-mix(in srgb, var(--shell) 10%, transparent); }
.topbar .brand { color: var(--ink); }
.topbar .brand-name { white-space: nowrap; font-size: clamp(14px, 4.4vw, 16px); }
@media (max-width: 430px) { .topbar .brand-name { display: none; } }
.topbar nav a { font-family: var(--meta); font-size: 11px; font-weight: 600;
                letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
@media (hover: hover) { .topbar nav a:hover { color: var(--ink); } }
.topbar .pillbtn {
  display: grid; place-items: center; min-width: 38px; height: 36px; padding: 0 12px;
  white-space: nowrap; flex: 0 0 auto;
  background: transparent; color: var(--ink);
  border: 1px solid var(--hair); border-radius: var(--r);
  cursor: pointer; list-style: none;
  font-family: var(--meta); font-size: 10.5px; letter-spacing: .12em;
  transition: border-color .18s ease, color .18s ease;
}
@media (hover: hover) { .topbar .pillbtn:hover { border-color: var(--ink); } }
.topbar .pillbtn--accent { border-color: var(--accent); color: var(--accent); }
.topbar .pillbtn::-webkit-details-marker { display: none; }

/* ── lentlər və çiplər ─────────────────────────────────────────────────── */
.rail { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
        padding-block: 2px; scroll-snap-type: x proximity; }
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; flex: 0 0 auto; }
.chip { display: inline-flex; align-items: center; height: 38px; padding: 0 16px;
        border: 1px solid var(--hair); border-radius: var(--r);
        background: transparent;
        font-family: var(--meta); font-size: 10.5px; letter-spacing: .14em;
        text-transform: uppercase; white-space: nowrap;
        transition: border-color .18s ease, color .18s ease; }
@media (hover: hover) { .chip:hover { border-color: var(--ink); } }
.chip[aria-current="true"] { border-color: var(--accent); color: var(--accent); }

.grid-plates { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
@media (min-width: 560px) { .grid-plates { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .grid-plates { grid-template-columns: repeat(5, 1fr); gap: 32px 20px; } }

/* ── bildiriş qutuları ─────────────────────────────────────────────────── */
.note { border: 1px solid var(--hair); border-left: 2px solid var(--ink);
        border-radius: var(--r); padding: 12px 16px; font-size: 13.5px;
        background: var(--paper); }
.note--ok   { border-left-color: var(--good); background: var(--good-wash); color: var(--good); }
.note--bad  { border-left-color: var(--bad);  background: var(--bad-wash);  color: var(--bad); }
.note--warn { border-left-color: var(--warn); background: var(--warn-wash); color: var(--warn); }

.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px;
       border: 1px solid var(--hair); border-radius: 2px;
       font-family: var(--meta); font-size: 9.5px; letter-spacing: .14em;
       text-transform: uppercase; color: var(--mute); }
.tag--accent {border-color:var(--accent);color:var(--accent)}
.tag--slab   {background:var(--slab);border-color:var(--slab);color:var(--slab-ink)}
.tag--ok     {border-color:var(--good);color:var(--good)}
.tag--bad    {border-color:var(--bad);color:var(--bad)}
.tag--warn   {border-color:var(--warn);color:var(--warn)}

.empty { padding: 64px 16px; text-align: center; color: var(--mute);
         font-family: var(--meta); font-size: 11px; letter-spacing: .14em;
         text-transform: uppercase; }

/* ── utilit qatı ───────────────────────────────────────────────────────── */
.stack{display:flex;flex-direction:column}.row{display:flex;align-items:center}
.between{justify-content:space-between}.center{justify-content:center}
.wide{flex:1 1 auto;min-width:0}
.g4{gap:4px}.g6{gap:6px}.g8{gap:8px}.g10{gap:10px}.g12{gap:12px}.g16{gap:16px}.g24{gap:24px}
.mt8{margin-top:8px}.mt12{margin-top:12px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mt32{margin-top:32px}
.mb8{margin-bottom:8px}.mb12{margin-bottom:12px}.mb16{margin-bottom:16px}.mb24{margin-bottom:24px}
.pad12{padding:12px}.pad16{padding:16px}.pad20{padding:20px}
.s11{font-size:11px}.s12{font-size:12px}.s13{font-size:13px}.s14{font-size:14px}
.s15{font-size:15px}.s17{font-size:17px}.s20{font-size:20px}.s26{font-size:26px}
.w600{font-weight:600}.w700{font-weight:700}.w800{font-weight:800}
.mute{color:var(--mute)}.accent{color:var(--accent)}.bad{color:var(--bad)}.good{color:var(--good)}
.right{text-align:right}.middle{text-align:center}
.hide-sm{display:none}
@media (min-width:768px){ .hide-sm{display:revert} .only-sm{display:none} }
.trunc{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.divide > * + * { border-top: 1px solid var(--hair); }

/* ── üzən dəstək düyməsi ───────────────────────────────────────────────── */
.fab {
  position: fixed; right: 20px; z-index: 55;
  bottom: calc(var(--bar) + 20px + env(safe-area-inset-bottom));
  width: 48px; height: 48px; display: grid; place-items: center;
  background: var(--accent); color: #fff; border-radius: var(--r);
  transition: opacity .18s ease;
}
.fab:active { opacity: .7; }
@media (min-width: 768px) { .fab { bottom: 28px; right: 28px; } }

/* ── quraşdırma / icazə kartı ──────────────────────────────────────────── */
.install {
  position: fixed; left: 16px; right: 16px; z-index: 70;
  bottom: calc(var(--bar) + 16px + env(safe-area-inset-bottom));
  background: var(--paper); border: 1px solid var(--hair); border-left: 2px solid var(--accent);
  border-radius: var(--r); padding: 18px; display: none;
  animation: rise .3s cubic-bezier(.22,.9,.3,1);
}
@media (min-width: 768px) { .install { left: auto; right: 28px; bottom: 28px; width: 380px; } }
.install[data-open] { display: block; }
.install-open .fab { display: none; }
@keyframes rise { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }

/* ── canlı dəstək ──────────────────────────────────────────────────────── */
.chat__thread { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
                padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 84%; padding: 12px 16px; font-size: 14.5px; line-height: 1.5;
       white-space: pre-wrap; word-break: break-word; border-radius: var(--r); }
.msg--them { align-self: flex-start; background: var(--paper); border: 1px solid var(--hair); }
.msg--me   { align-self: flex-end; background: var(--accent); color: #fff; }
.typing { align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px;
          background: var(--paper); border: 1px solid var(--hair); border-radius: var(--r); }
.typing i { width: 5px; height: 5px; background: var(--mute); border-radius: 50%;
            display: block; animation: blip 1s infinite ease-in-out; }
.typing i:nth-child(2){animation-delay:.16s} .typing i:nth-child(3){animation-delay:.32s}
@keyframes blip { 0%,80%,100%{opacity:.28} 40%{opacity:1} }

dialog { border: 1px solid var(--hair); border-radius: var(--r); background: var(--paper);
         color: var(--ink); padding: 0; max-width: 92vw; width: 400px; }
dialog::backdrop { background: rgba(18,18,18,.6); }

/* ── qəhrəman bölməsi ──────────────────────────────────────────────────── */
/* Sol kənardakı şaquli xətt referansın imzasıdır: səhifənin harada
   başladığını göstərir və başlığı yerində saxlayır. */
.hero { position: relative; padding-block: 52px 40px; }
@media (min-width: 768px) { .hero { padding-block: 92px 68px; } }
.hero::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 30px;
  width: 1px; background: var(--hair);
}
.hero__meta { margin-bottom: 22px; }
/* Referansda başlıq bir sözdür və ekranı doldura bilər; bizimki tam
   cümlədir — eyni ölçüdə beş sətrə düşüb qəhrəmanı tamamilə udurdu. */
.hero__title { font-size: clamp(31px, 8.6vw, 66px); max-width: 17ch; }
/* Başlığın sonundakı kvadrat — cümlənin nöqtəsi. */
.hero__title::after {
  content: ""; display: inline-block; width: .15em; height: .15em;
  background: var(--accent); margin-left: .1em;
}
.hero__foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--hair);
}

/* ── hesab səhifəsi ────────────────────────────────────────────────────── */
/* Fon temaya görə çevrilmir: --ink işlədiləndə tünd rejimdə panel ağarırdı. */
.acct-hero { background: #121212; color: #fff; border-radius: var(--r); padding: 24px 20px 20px; }
.dark .acct-hero { background: var(--paper); border: 1px solid var(--hair); }
.acct-hero__id  { color: rgba(255,255,255,.55); }
.acct-hero__sum { font-size: clamp(34px, 11vw, 52px); margin-top: 10px; }
.acct-hero__stats { display: flex; flex-wrap: wrap; gap: 22px; margin-top: 18px;
                    padding-top: 16px; border-top: 1px solid rgba(255,255,255,.14); }
.acct-hero__stats span { display: flex; flex-direction: column; gap: 5px; }
.acct-hero__stats .meta { color: rgba(255,255,255,.5); }
.acct-hero__stats b { font-size: 15px; font-weight: 700; }

.acct-menu { display: grid; gap: 0; margin-top: 22px;
             border: 1px solid var(--hair); border-radius: var(--r); overflow: hidden; }
@media (min-width: 640px) { .acct-menu { grid-template-columns: 1fr 1fr; } }
.acct-menu a { display: flex; align-items: center; gap: 14px; padding: 16px 18px;
               border-bottom: 1px solid var(--hair); transition: background .18s ease; }
@media (min-width: 640px) { .acct-menu a:nth-child(odd) { border-right: 1px solid var(--hair); } }
.acct-menu a:last-child, .acct-menu a:nth-last-child(2):nth-child(odd) { border-bottom: 0; }
@media (hover: hover) { .acct-menu a:hover { background: var(--wash); } }
.acct-menu i { flex: 0 0 auto; width: 22px; height: 22px; color: var(--accent); }
.acct-menu i svg { width: 100%; height: 100%; display: block; }
.acct-menu span { flex: 1 1 auto; font-size: 14.5px; font-weight: 600; }
.acct-menu em { font-style: normal; color: var(--mute); font-size: 14px; }

.acct-card { display: flex; align-items: center; gap: 16px; }
