/* ------------------------------------------------------------------
   حارس كنوز جنوب الباطنة — website
   One deliberate dark look taken from the game: cabinet black, parchment
   text, desert gold, with the sarooj-plaster and night tones of the stages.
   Layout: full-bleed hero, then alternating bands (light-dark) with a
   centred 1120px column; grids collapse to one column on phones.
   © 2026 Khalid Alsalhi
   ------------------------------------------------------------------ */
:root {
  --bg: #0b0806;          /* cabinet black (the game's background) */
  --band: #15100b;        /* night band */
  --band2: #1d1510;       /* sarooj shadow */
  --line: #3a2d20;
  --ink: #f3e3c3;         /* parchment */
  --muted: #bda98a;
  --gold: #f5c36c;        /* desert gold */
  --gold-d: #c9902f;
  --ember: #e0703a;
  --font-display: "Reem Kufi", Tahoma, "Segoe UI", sans-serif;
  --font-arcade: "Press Start 2P", ui-monospace, monospace;
  --font-body: Tahoma, "Segoe UI", system-ui, -apple-system, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.75 var(--font-body); -webkit-text-size-adjust: 100%; }
img { max-width: 100%; display: block; }
a { color: var(--gold); }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; text-wrap: balance; }
h2 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.6vw, 2.3rem); color: var(--ink); margin-bottom: 1.2rem; }
h3 { font-family: var(--font-display); font-size: 1.2rem; }
p { margin: 0 0 0.9rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.kicker { font-family: var(--font-arcade); font-size: 0.62rem; letter-spacing: 0.08em; color: var(--gold); text-transform: uppercase; margin-bottom: 0.6rem; }
html[lang="ar"] .kicker { font-family: var(--font-display); font-size: 0.95rem; letter-spacing: 0; }
.prose { max-width: 62ch; min-width: 0; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(11, 8, 6, 0.9); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 21; background: var(--bg); }
.bar { display: flex; align-items: center; gap: 1rem; min-height: 56px; }
.brand { display: flex; align-items: center; gap: 0.55rem; text-decoration: none; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; white-space: nowrap; }
.brand img { border-radius: 8px; }
.nav { display: flex; gap: 1.1rem; margin-inline-start: auto; }
.nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; }
.nav a:hover { color: var(--gold); }
.lang { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.lang button { font: 600 0.85rem var(--font-body); background: transparent; color: var(--muted); border: 0; padding: 0.4rem 0.75rem; cursor: pointer; }
.lang button[aria-pressed="true"] { background: var(--gold); color: #1a130a; }
.lang button:focus-visible, .play:focus-visible, .ghost:focus-visible, .nav a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 760px) { .nav { display: none; } .lang { margin-inline-start: auto; } }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero-bg { position: absolute; inset: 0; background: url("img/hero-bg.jpg") center 40% / cover no-repeat; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,8,6,.35) 0%, rgba(11,8,6,.55) 45%, rgba(11,8,6,.96) 100%), radial-gradient(ellipse at 50% 30%, rgba(0,0,0,0) 0%, rgba(11,8,6,.55) 75%); }
.hero-in { position: relative; padding-block: clamp(4rem, 12vw, 8rem) clamp(3rem, 8vw, 5rem); display: grid; gap: 1rem; justify-items: center; text-align: center; }
.eyebrow { font-family: var(--font-arcade); font-size: clamp(0.55rem, 1.6vw, 0.7rem); color: var(--gold); letter-spacing: 0.06em; margin: 0; text-shadow: 0 2px 0 #000; }
html[lang="ar"] .eyebrow { font-family: var(--font-display); font-size: clamp(0.95rem, 2.4vw, 1.15rem); letter-spacing: 0; }
.logo { display: grid; gap: 0.6rem; justify-items: center; }
.logo-ar { font-family: var(--font-display); font-size: clamp(2.3rem, 8vw, 4.6rem); color: var(--gold); text-shadow: 0 3px 0 #3b2208, 0 0 30px rgba(245,195,108,.35); line-height: 1.25; }
.logo-en { font-family: var(--font-arcade); font-size: clamp(0.62rem, 2.1vw, 1.05rem); color: var(--ink); letter-spacing: 0.04em; text-shadow: 0 2px 0 #000; line-height: 1.6; text-transform: uppercase; }
.tagline { max-width: 56ch; font-size: clamp(1rem, 2.4vw, 1.2rem); text-shadow: 0 2px 6px #000; margin: 0.4rem 0 0.6rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.8rem; justify-content: center; align-items: center; }
.play { display: inline-flex; align-items: center; gap: 0.7rem; font-family: var(--font-arcade); font-size: clamp(0.85rem, 2.4vw, 1.05rem); text-decoration: none; color: #1a130a;
  background: linear-gradient(180deg, #ffe39b, var(--gold) 45%, var(--gold-d)); border: 2px solid #ffe9a8; border-radius: 12px; padding: 1rem 1.6rem; box-shadow: 0 6px 0 #6b4310, 0 10px 30px rgba(0,0,0,.6); cursor: pointer; }
html[lang="ar"] .play { font-family: var(--font-display); font-size: clamp(1.1rem, 3vw, 1.35rem); }
.play:hover { filter: brightness(1.06); }
.play:active { transform: translateY(3px); box-shadow: 0 3px 0 #6b4310, 0 6px 20px rgba(0,0,0,.6); }
.play .tri { width: 0; height: 0; border-top: 8px solid transparent; border-bottom: 8px solid transparent; border-left: 12px solid #1a130a; }   /* a play sign points right in both languages */
.play.small { padding: 0.7rem 1.2rem; font-size: 0.8rem; box-shadow: 0 4px 0 #6b4310; }
html[lang="ar"] .play.small { font-size: 1.05rem; }
.ghost { font: 600 1rem var(--font-body); color: var(--gold); background: rgba(11,8,6,.55); border: 1px solid var(--gold); border-radius: 10px; padding: 0.75rem 1.1rem; cursor: pointer; text-decoration: none; }
.ghost:hover { background: rgba(60,38,16,.7); }
.facts { list-style: none; padding: 0; margin: 0.8rem 0 0; display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; }
.facts li { font-size: 0.85rem; color: var(--ink); background: rgba(11,8,6,.6); border: 1px solid var(--line); border-radius: 99px; padding: 0.15rem 0.75rem; }

/* ---------- bands ---------- */
.band { padding-block: clamp(3rem, 7vw, 5rem); background: var(--band); }
.band.dark { background: var(--bg); }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: center; }
@media (max-width: 800px) { .two { grid-template-columns: 1fr; } }
.hero-fig { margin: 0; justify-self: center; display: grid; justify-items: center; gap: 0.4rem; }
.hero-fig img { width: min(220px, 50vw); height: auto; filter: drop-shadow(0 12px 24px rgba(0,0,0,.7)); }
.hero-fig figcaption { font-family: var(--font-display); color: var(--gold); font-size: 1.1rem; }

.grid { display: grid; gap: 1rem; }
.stages { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--band2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.card-in { padding: 0.9rem 1rem 1rem; display: grid; align-content: start; gap: 0.35rem; }
.card .num { font-family: var(--font-arcade); font-size: 0.58rem; color: var(--gold); letter-spacing: 0.06em; }
html[lang="ar"] .card .num { font-family: var(--font-display); font-size: 0.9rem; }
.card h3 { color: var(--ink); }
.card p { margin: 0; font-size: 0.93rem; color: var(--muted); }
.card .boss { color: var(--ink); font-size: 0.9rem; margin-top: 0.3rem; }
.card .boss b { color: var(--gold); font-weight: 600; }

h3.sub { color: var(--gold); margin: 1.6rem 0 0.8rem; }
.foes { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.foe { background: radial-gradient(ellipse at 50% 40%, #2a1d12, var(--band2) 70%); border: 1px solid var(--line); border-radius: 12px; padding: 1rem; display: grid; justify-items: center; text-align: center; gap: 0.4rem; min-width: 0; }
.foe img { height: 170px; width: auto; object-fit: contain; filter: drop-shadow(0 8px 14px rgba(0,0,0,.6)); }
.foe h4 { font-family: var(--font-display); font-size: 1.1rem; color: var(--ink); }
.foe p { margin: 0; font-size: 0.9rem; color: var(--muted); }
.bosses { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.boss-card { margin: 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); position: relative; background: var(--band2); }
.boss-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: 62% 50%; }
.boss-card figcaption { position: absolute; inset: auto 0 0 0; padding: 2.2rem 0.9rem 0.7rem; background: linear-gradient(180deg, rgba(11,8,6,0), rgba(11,8,6,.92)); display: grid; }
.boss-card b { font-family: var(--font-display); color: var(--gold); font-size: 1.1rem; }
.boss-card span { font-size: 0.85rem; color: var(--ink); }

/* ---------- controls ---------- */
.table-scroll { overflow-x: auto; min-width: 0; }
.keys { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.keys th, .keys td { text-align: start; padding: 0.55rem 0.6rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.keys th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
kbd { display: inline-block; min-width: 1.9em; text-align: center; font: 600 0.82rem ui-monospace, Consolas, monospace; color: var(--ink); background: #2a2016; border: 1px solid #5a4630; border-bottom-width: 3px; border-radius: 6px; padding: 0.1rem 0.4rem; direction: ltr; }
#controls h3 { color: var(--gold); margin: 0.6rem 0 0.4rem; }
#controls .prose p { color: var(--muted); }

/* ---------- install ---------- */
.howto { display: grid; gap: 0.8rem; min-width: 0; }
.step { background: var(--band2); border: 1px solid var(--line); border-radius: 12px; padding: 0.9rem 1rem; }
.step h3 { font-family: var(--font-body); font-weight: 700; font-size: 1rem; color: var(--gold); margin-bottom: 0.3rem; direction: ltr; text-align: start; }
.step p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.status { font-size: 0.92rem; color: var(--muted); min-height: 1.5em; }
.status.ok { color: #9fe08a; }

/* ---------- footer, toast ---------- */
.foot { border-top: 1px solid var(--line); padding-block: 1.6rem calc(1.6rem + env(safe-area-inset-bottom, 0px)); }
.foot-in { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.foot p { margin: 0; color: var(--muted); font-size: 0.88rem; }
.toast { position: fixed; z-index: 30; inset-inline: 0; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); margin: 0 auto; width: max-content; max-width: calc(100% - 32px);
  background: #1d1510; border: 1px solid var(--gold); color: var(--ink); border-radius: 10px; padding: 0.7rem 1rem; font-size: 0.95rem; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
