/* ==========================================================================
   The Darb Nar store (store.html): the game's koshk, online. The one page on
   the site that does NOT wear the dossier: it wears the game's street at night
   (the Yafta kit's tokens, NarYafta.cs in the game repo): asphalt, a sodium
   lamp, LED prices, steel plates, a receipt with a rubber stamp. DESIGN.md,
   "The store", says why and where it stops: only inside main.koshk.
   ========================================================================== */

.koshk {
  --asphalt: #0D0E10;
  --asphalt-2: #15181A;
  --sign-off: #1A1D20;
  --sign-off-2: #2B3034;
  --panel-deep: #0E1012;
  --tube: #E3F7EE;
  --tube-dim: rgba(227, 247, 238, .70);
  --tube-faint: rgba(227, 247, 238, .46);
  --hairline: rgba(227, 247, 238, .13);
  --sodium: #FFAA2B;
  --sodium-hot: #FFD47E;
  --sodium-deep: #E4830C;
  --sodium-ink: #1C1204;
  --ko: #FF3B2F;
  --steel-top: #3A3C40;
  --steel-bot: #17181B;
  --receipt: #F7F5ED;
  --receipt-ink: #1C1A17;
  --stamp-blue: rgba(36, 66, 168, .88);

  background: var(--asphalt);
  color: var(--tube);
  font-family: "Alexandria", "Archivo", system-ui, sans-serif;
  padding-bottom: 48px;
}
.koshk [data-l="ar"], .koshk [lang="ar"] { font-family: "El Messiri", "Cairo", sans-serif; }
.koshk .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- the head: a lit sign over the window ------------------------- */
.kk-head { padding-block: 40px 22px; }
.kk-stencil { font: 600 11px/1 "Handjet", monospace; letter-spacing: .3em; color: var(--tube-faint); margin: 0 0 14px; }
.kk-title {
  font: 400 clamp(34px, 6vw, 64px)/1.05 "Rakkas", serif; margin: 0; color: var(--sodium-hot);
  text-shadow: 0 0 18px rgba(255, 170, 43, .45);
}
.kk-title [lang="ar"] { font-family: "El Messiri", sans-serif; font-weight: 700; }
.kk-lede { max-width: 62ch; margin: 14px 0 0; color: var(--tube-dim); font-size: 16px; line-height: 1.6; }
.kk-pay { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 18px 0 0; }
.kk-pay li {
  font: 600 12px/1 "Alexandria", sans-serif; letter-spacing: .04em; padding: 7px 10px;
  border: 1px solid var(--hairline); color: var(--tube-dim); background: var(--sign-off);
}

/* ---------- steel ---------------------------------------------------------- */
.kk-steel, .kk-plate {
  background: linear-gradient(180deg, var(--steel-top), var(--steel-bot));
  border: 1px solid rgba(0, 0, 0, .7);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
}
.kk-plate { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.kk-way { padding: 22px; }
.kk-way + .kk-way { border-inline-start: 1px solid rgba(0, 0, 0, .55); }
.kk-way h2 { font: 700 20px/1.2 "Alexandria", sans-serif; margin: 0 0 6px; color: var(--tube); }
.kk-way h2 [lang="ar"] { font-family: "El Messiri", sans-serif; }
.kk-way p { margin: 0 0 14px; color: var(--tube-dim); font-size: 14px; line-height: 1.55; }
.kk-small { font-size: 12px !important; color: var(--tube-faint) !important; }
.kk-gsi { min-height: 44px; }
.kk-fb { margin-top: 10px; background: #1877F2; border-color: #1877F2; color: #fff; }
@media (max-width: 720px) {
  .kk-plate { grid-template-columns: 1fr; }
  .kk-way + .kk-way { border-inline-start: 0; border-top: 1px solid rgba(0, 0, 0, .55); }
}

/* the signed-in strip: who, and the two LED wallet boards */
.kk-me { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 22px; }
.kk-me .who { flex: 1 1 220px; }
.kk-me .who b { display: block; font-size: 18px; }
.kk-me .who span { color: var(--tube-faint); font: 500 13px/1.4 "Handjet", monospace; letter-spacing: .08em; }
.kk-board {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px;
  background: var(--panel-deep); border: 2px solid rgba(0, 0, 0, .8);
}
.kk-board img { width: 22px; height: 22px; }
.kk-led { font: 700 20px/1 "Handjet", monospace; color: var(--sodium); text-shadow: 0 0 8px rgba(255, 170, 43, .55); letter-spacing: .04em; }

/* ---------- buttons: one lit sign at a time --------------------------------- */
.kk-btn {
  font: 700 14px/1 "Alexandria", sans-serif; padding: 12px 16px; cursor: pointer;
  color: var(--tube); background: var(--sign-off-2); border: 1px solid var(--hairline);
}
.kk-btn [lang="ar"] { font-family: "El Messiri", sans-serif; }
.kk-btn:hover { border-color: var(--tube-faint); }
.kk-btn.lit {
  color: var(--sodium-ink); background: var(--sodium); border-color: var(--sodium-hot);
  box-shadow: 0 0 16px rgba(255, 170, 43, .4);
}
.kk-btn[disabled] { opacity: .45; cursor: default; box-shadow: none; }
.kk-btn:focus-visible, .kk-card:focus-visible, .kk-rail button:focus-visible { outline: 2px solid var(--sodium-hot); outline-offset: 2px; }
.kk-link { background: none; border: 0; color: var(--tube-faint); text-decoration: underline; cursor: pointer; font: inherit; }

.kk-id { display: flex; gap: 8px; }
.kk-id input {
  flex: 1; min-width: 0; font: 700 22px/1 "Handjet", monospace; letter-spacing: .14em; padding: 10px 12px;
  color: var(--sodium); background: var(--panel-deep); border: 2px solid rgba(0, 0, 0, .8);
}
.kk-id input::placeholder { color: rgba(255, 170, 43, .3); }
/* a creator's code on the receipt's sheet: the same LED field, a size down */
.kk-code { margin-top: 14px; }
.kk-code input { font-size: 18px; text-transform: uppercase; }
.kk-code-on { margin-top: 12px; color: var(--sodium); }
.kk-found { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--hairline); }

/* ---------- the window: a rail of shelves, and the shelf ------------------ */
.kk-window { display: grid; grid-template-columns: 170px 1fr; gap: 18px; margin-top: 22px; }
.kk-rail { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 80px; align-self: start; }
.kk-rail button {
  display: flex; align-items: center; gap: 9px; text-align: start; padding: 9px 10px; cursor: pointer;
  color: var(--tube-dim); background: transparent; border: 0; border-inline-start: 2px solid var(--hairline);
  font: 600 14px/1.2 "Alexandria", sans-serif;
}
.kk-rail button [lang="ar"] { font-family: "El Messiri", sans-serif; }
.kk-rail button::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--sign-off-2); flex: none; }
.kk-rail button[aria-current="true"] { color: var(--tube); border-color: var(--sodium); background: rgba(255, 170, 43, .07); }
.kk-rail button[aria-current="true"]::before { background: var(--sodium); box-shadow: 0 0 6px var(--sodium); }
@media (max-width: 720px) {
  .kk-window { grid-template-columns: 1fr; }
  .kk-rail { position: static; flex-direction: row; overflow-x: auto; padding-bottom: 4px; }
  .kk-rail button { flex: none; border-inline-start: 0; border-bottom: 2px solid var(--hairline); }
  .kk-rail button[aria-current="true"] { border-color: var(--sodium); }
}
.kk-shelf h2 { font: 400 28px/1.1 "Rakkas", serif; margin: 0 0 4px; color: var(--tube); }
.kk-shelf h2 [lang="ar"] { font-family: "El Messiri", sans-serif; font-weight: 700; }
.kk-shelf > p { color: var(--tube-dim); margin: 0 0 16px; max-width: 70ch; font-size: 14px; line-height: 1.55; }
.kk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }

/* a product: a poster for a skin, a swinging tag for the rest */
.kk-card {
  position: relative; display: flex; flex-direction: column; text-align: start; padding: 0; cursor: pointer;
  background: var(--asphalt-2); border: 1px solid var(--hairline); color: inherit; font: inherit;
}
.kk-card:hover { border-color: var(--tube-faint); }
.kk-card .pic { aspect-ratio: 16 / 9; background: var(--panel-deep); overflow: hidden; }
.kk-card.square .pic { aspect-ratio: 1 / 1; }
.kk-card .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kk-card .body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 6px; }
.kk-card .kind { font: 600 10px/1 "Alexandria", sans-serif; letter-spacing: .12em; text-transform: uppercase; color: var(--tube-faint); }
.kk-card .name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.kk-card.poster { transform: rotate(var(--tilt, 0deg)); }
.kk-card .owned { position: absolute; inset-inline-end: 8px; top: 8px; font: 700 11px/1 "Alexandria", sans-serif; padding: 5px 7px; background: var(--tube); color: var(--asphalt); }
.kk-swatch { display: flex; flex-wrap: wrap; gap: 4px; }
.kk-swatch i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .6); }

/* prices: LED plates */
.kk-prices { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.kk-price {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px;
  background: var(--panel-deep); font: 700 16px/1 "Handjet", monospace; color: var(--sodium); letter-spacing: .04em;
}
.kk-price img { width: 14px; height: 14px; }
.kk-was { font: 600 13px/1 "Handjet", monospace; color: var(--tube-faint); text-decoration: line-through; }
.kk-save { font: 700 11px/1 "Alexandria", sans-serif; padding: 4px 6px; background: var(--ko); color: #fff; }

/* top-up cards, like the phone credit a koshk sells */
.kk-topup {
  aspect-ratio: 1.58; color: #fff; border: 1px solid rgba(255, 255, 255, .14); border-radius: 10px;
  background: linear-gradient(160deg, var(--c1, #1E3A59), var(--c2, #0C1726));
  display: flex; flex-direction: column; justify-content: space-between; padding: 12px 14px; cursor: pointer; text-align: start; font: inherit;
}
.kk-topup .top { display: flex; justify-content: space-between; align-items: start; font: 600 10px/1.2 "Alexandria", sans-serif; letter-spacing: .1em; opacity: .8; }
.kk-topup .top img { width: 30px; height: 30px; }
.kk-topup .amount { font: 700 34px/1 "Handjet", monospace; color: var(--sodium-hot); text-shadow: 0 0 10px rgba(255, 212, 126, .5); }
.kk-topup .foot { display: flex; justify-content: space-between; align-items: end; gap: 8px; font: 600 10px/1.2 "Alexandria", sans-serif; letter-spacing: .1em; }
.kk-topup .foot .money { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; white-space: nowrap; letter-spacing: 0; }
.kk-topup .foot b { font: 700 18px/1 "Alexandria", sans-serif; }
.kk-topup[disabled] { filter: grayscale(1); opacity: .5; cursor: default; }

/* ---------- the sheet: the steel door with the receipt ------------------ */
.kk-sheet { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(5, 6, 7, .78); }
.kk-sheet[hidden] { display: none; }
.kk-sheet .door { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 22px; color: var(--tube); }
.kk-sheet .door h3 { font: 400 26px/1.15 "Rakkas", serif; margin: 0 0 6px; color: var(--sodium-hot); }
.kk-sheet .door h3 [lang="ar"] { font-family: "El Messiri", sans-serif; font-weight: 700; }
.kk-sheet .door p { color: var(--tube-dim); line-height: 1.55; }
.kk-sheet .actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.kk-close { float: inline-end; }

.kk-receipt {
  position: relative; width: min(320px, 100%); margin: 14px 0 6px; padding: 14px 16px 22px;
  background: var(--receipt); color: var(--receipt-ink); font: 600 13px/1.5 "Handjet", monospace; letter-spacing: .03em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 8px), 95% 100%, 90% calc(100% - 8px), 85% 100%, 80% calc(100% - 8px), 75% 100%, 70% calc(100% - 8px), 65% 100%, 60% calc(100% - 8px), 55% 100%, 50% calc(100% - 8px), 45% 100%, 40% calc(100% - 8px), 35% 100%, 30% calc(100% - 8px), 25% 100%, 20% calc(100% - 8px), 15% 100%, 10% calc(100% - 8px), 5% 100%, 0 calc(100% - 8px));
}
.kk-receipt .c { text-align: center; }
.kk-receipt .row { display: flex; justify-content: space-between; gap: 12px; }
.kk-receipt .rule { border-top: 1px dashed rgba(0, 0, 0, .35); margin: 6px 0; }
.kk-receipt .total { font-size: 16px; font-weight: 700; }
.kk-stamp {
  position: absolute; inset-inline-end: 16px; top: 38%; transform: rotate(-13deg);
  font: 700 22px/1 "El Messiri", sans-serif; color: var(--stamp-blue); border: 3px solid var(--stamp-blue);
  padding: 4px 10px; border-radius: 6px; animation: kk-stamp .34s ease-out both;
}
.kk-stamp.wait { color: rgba(28, 26, 23, .55); border-color: rgba(28, 26, 23, .45); animation: none; }
.kk-stamp.bad { color: rgba(200, 30, 30, .85); border-color: rgba(200, 30, 30, .8); }
@keyframes kk-stamp { from { transform: rotate(-13deg) scale(2); opacity: 0; } to { transform: rotate(-13deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .kk-stamp { animation: none; } .kk-card.poster { transform: none; } }

/* ---------- the LED ticker: what just happened -------------------------- */
.kk-ticker {
  position: fixed; inset-inline: 0; bottom: 18px; margin-inline: auto; width: max-content; max-width: calc(100% - 32px); z-index: 70;
  padding: 9px 16px; background: var(--panel-deep); border: 2px solid #000;
  font: 700 16px/1.2 "Handjet", monospace; letter-spacing: .06em; color: var(--sodium); text-shadow: 0 0 8px rgba(255, 170, 43, .5);
}
.kk-ticker[hidden] { display: none; }

.kk-foot { margin-top: 36px; color: var(--tube-faint); font-size: 13px; line-height: 1.6; max-width: 80ch; }
.kk-empty { color: var(--tube-dim); padding: 24px 0; }

/* preview: the cards are shown, not sold */
.kk-soon { display: inline-block; margin-top: 12px; padding: 5px 10px; border: 1px dashed var(--sodium); color: var(--sodium); font: 700 11px/1 "Alexandria", sans-serif; letter-spacing: .12em; text-transform: uppercase; }
.kk-topup.soon { cursor: default; }
.kk-window:has(#rail[hidden]) { grid-template-columns: 1fr; }
