/* ==========================================================================
   GAMETHON / Chromafall — ورقٌ وحبر، واللون يرجع
   ========================================================================== */

@font-face {
  font-family: "Crayon";
  src: url("../fonts/crayon.ttf") format("truetype");
  font-display: swap;
}

:root {
  --ink: #16151a;
  --ink-2: #26242c;
  --paper: #f2ece0;
  --paper-2: #e6ddcb;
  --muted: #6d675c;
  --gold: #ffc93f;
  --gutter: clamp(16px, 4vw, 56px);
  --max: 1240px;
  --display: "Crayon", "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --lx: 50%;
  --ly: 45%;
  --lr: 220px;
}

[dir="rtl"] {
  --display: "Lalezar", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --body: "IBM Plex Sans Arabic", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 clamp(16px, 1.05vw + 12px, 19px)/1.6 var(--body);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; }

/* حبيبات الورق فوق كل شيء */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  opacity: .09;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1.4 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.skip {
  position: fixed;
  inset-inline-start: 8px;
  top: 8px;
  background: var(--paper);
  padding: 8px 14px;
  z-index: 100;
  transform: translateY(-160%);
}
.skip:focus { transform: none; }
html, body { overflow-x: clip; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* ---------- الشريط العلوي ---------- */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px var(--gutter);
  color: var(--paper);
  transition: background .35s ease, padding .35s ease, box-shadow .35s ease;
}
.bar.solid {
  background: rgba(22, 21, 26, .92);
  padding-block: 10px;
  box-shadow: 0 1px 0 rgba(242, 236, 224, .08);
  backdrop-filter: blur(6px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  letter-spacing: .14em;
  font-size: 15px;
}
.brand img { width: 40px; height: auto; }
.links { display: flex; gap: 22px; margin-inline-start: auto; }
.links a {
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  opacity: .78;
  transition: opacity .2s;
}
.links a:hover { opacity: 1; }
.bar-end { display: flex; align-items: center; gap: 12px; }
.lang {
  background: none;
  color: inherit;
  border: 1.5px solid rgba(242, 236, 224, .5);
  border-radius: 999px;
  padding: 5px 14px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
[dir="rtl"] .lang { font-family: "Bricolage Grotesque", sans-serif; }
[dir="ltr"] .lang { font-family: "IBM Plex Sans Arabic", sans-serif; }
.lang:hover { border-color: var(--paper); }

/* ---------- الأزرار ---------- */

.play {
  --press: 0px;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px 13px;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 15px;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--ink);
  transform: translateY(var(--press));
  transition: transform .12s ease, box-shadow .12s ease;
}
.play:hover { --press: 2px; box-shadow: 0 4px 0 var(--ink); }
.play:active { --press: 6px; box-shadow: 0 0 0 var(--ink); }
.play--small { padding: 8px 16px 7px; font-size: 13px; box-shadow: 0 4px 0 var(--ink); border-width: 2px; }
[dir="rtl"] .play { letter-spacing: 0; }

.ghost {
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 2px;
  opacity: .9;
}
.ghost:hover { opacity: 1; }

/* ---------- البطل: الفانوس ---------- */

.hero {
  position: relative;
  min-height: max(100svh, 560px);
  display: grid;
  align-items: end;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  isolation: isolate;
}
.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero-art--color {
  -webkit-mask-image: radial-gradient(circle var(--lr) at var(--lx) var(--ly), #000 0%, #000 45%, rgba(0, 0, 0, .55) 70%, transparent 100%);
          mask-image: radial-gradient(circle var(--lr) at var(--lx) var(--ly), #000 0%, #000 45%, rgba(0, 0, 0, .55) 70%, transparent 100%);
}
.all-color .hero-art--color { -webkit-mask-image: none; mask-image: none; }
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(22, 21, 26, .55) 0%, transparent 22%, transparent 45%, rgba(22, 21, 26, .92) 100%);
  pointer-events: none;
}
.hero-copy {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding: 0 var(--gutter) clamp(56px, 10vh, 110px);
}
.kicker {
  margin: 0 0 6px;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .32em;
  text-transform: uppercase;
  opacity: .85;
}
[dir="rtl"] .kicker { letter-spacing: 0; font-size: 15px; }
.kicker--ink { color: var(--muted); }

.title {
  margin: 0;
  font: 400 clamp(64px, 13vw, 210px)/.86 var(--display);
  letter-spacing: -.01em;
  text-shadow: 6px 7px 0 rgba(22, 21, 26, .85);
}
.title-ar { display: none; }
[dir="rtl"] .title-en { display: none; }
[dir="rtl"] .title-ar { display: inline; font-size: .78em; }
.hero-line {
  margin: 18px 0 30px;
  font-size: clamp(19px, 1.6vw + 10px, 28px);
  font-weight: 600;
  max-width: 30ch;
}
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.hero-hint {
  position: absolute;
  inset-inline-end: var(--gutter);
  bottom: 22px;
  margin: 0;
  font: 400 22px/1 var(--display);
  opacity: .7;
  transition: opacity .8s ease;
}
.hero-hint.gone { opacity: 0; }

/* ---------- عناوين الأقسام ---------- */

.section-head {
  width: min(var(--max), 100%);
  margin: 0 auto clamp(32px, 5vw, 64px);
  padding-inline: var(--gutter);
}
.heading {
  margin: 0;
  font: 400 clamp(38px, 5.2vw, 76px)/1 var(--display);
  max-width: 18ch;
}
.heading--paper { color: var(--paper); }

/* ---------- العوالم: اللون يُرسم ---------- */

.worlds { padding: clamp(90px, 12vw, 160px) 0 clamp(40px, 6vw, 90px); position: relative; }
.worlds .section-head { margin-bottom: clamp(150px, 13vw, 190px); }
.world {
  position: relative;
  width: min(var(--max), 100%);
  margin: 0 auto clamp(150px, 13vw, 190px);
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.world--flip { grid-template-columns: 5fr 7fr; }
.world--flip .world-frame { order: 2; }
.world-frame { position: relative; }
.world-art {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--ink);
  border-radius: 6px;
  overflow: hidden;
  background: var(--ink);
  box-shadow: 10px 12px 0 var(--ink);
  transform: rotate(-.6deg);
}
.world--flip .world-art { transform: rotate(.7deg); box-shadow: -10px 12px 0 var(--ink); }
.world-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.paint {
  -webkit-mask-image: linear-gradient(100deg, #000 42%, transparent 58%);
          mask-image: linear-gradient(100deg, #000 42%, transparent 58%);
  -webkit-mask-size: 280% 100%;
          mask-size: 280% 100%;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0;
          mask-position: 100% 0;
  transition: -webkit-mask-position 2.2s cubic-bezier(.2, .7, .1, 1), mask-position 2.2s cubic-bezier(.2, .7, .1, 1);
}
.lit .paint, .all-color .paint { -webkit-mask-position: 0 0; mask-position: 0 0; }
.world-copy h3 {
  margin: 0 0 10px;
  font: 400 clamp(40px, 4.4vw, 64px)/1 var(--display);
}
.world-copy p { margin: 0; max-width: 36ch; color: #3a3731; }
.world-no {
  display: block;
  font: 400 clamp(54px, 6vw, 90px)/1 var(--display);
  color: transparent;
  -webkit-text-stroke: 1.5px var(--ink);
  opacity: .35;
  margin-bottom: 4px;
}

/* ---------- في جيبك: قصاصات ورق ---------- */

.pockets { padding: clamp(40px, 6vw, 80px) 0 clamp(90px, 11vw, 150px); }
.notes {
  list-style: none;
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: min(var(--max), 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(18px, 2.4vw, 30px);
}
.note {
  flex: 1 1 210px;
  max-width: 270px;
  position: relative;
  background: #fbf7ee;
  border: 2.5px solid var(--ink);
  border-radius: 4px 14px 6px 12px;
  padding: 22px 22px 24px;
  transform: rotate(var(--tilt));
  box-shadow: 6px 7px 0 var(--ink);
  transition: transform .25s ease;
}
.note:hover { transform: rotate(0deg) translateY(-4px); }
.note img { position: absolute; top: -22px; inset-inline-end: 14px; width: 54px; height: 54px; }
.note h3 { margin: 0 0 6px; font: 400 34px/1 var(--display); }
.note p { margin: 0; font-size: 16px; color: #3a3731; }

/* ---------- العرض ---------- */

.trailer {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(90px, 11vw, 150px) 0;
}
.screen {
  position: relative;
  width: min(1100px, calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  border: 3px solid var(--paper);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 0 10px var(--ink-2), 0 0 0 13px rgba(242, 236, 224, .25);
}
.screen-poster, .screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.screen-poster { object-fit: cover; filter: grayscale(1) contrast(1.05) brightness(.7); transition: filter .6s ease; }
.screen:hover .screen-poster, .screen:focus-within .screen-poster { filter: none; }
.screen-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  cursor: pointer;
  font: 400 clamp(26px, 3.2vw, 44px)/1 var(--display);
  text-shadow: 4px 5px 0 var(--ink);
}
.screen-disc {
  display: grid;
  place-items: center;
  width: clamp(76px, 9vw, 116px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--ink);
  box-shadow: 0 7px 0 var(--ink);
  transition: transform .2s ease, box-shadow .2s ease;
}
.screen-disc svg { width: 46%; fill: var(--ink); margin-left: 8%; }
.screen-play:hover .screen-disc { transform: translateY(3px) scale(1.04); box-shadow: 0 4px 0 var(--ink); }

/* ---------- الاستوديو ---------- */

.studio {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: clamp(100px, 12vw, 170px) var(--gutter);
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: clamp(30px, 6vw, 90px);
  align-items: center;
  position: relative;
}
.studio-mark img { width: 100%; height: auto; }
[data-build] img {
  -webkit-mask-image: linear-gradient(0deg, #000 50%, transparent 50%);
          mask-image: linear-gradient(0deg, #000 50%, transparent 50%);
  -webkit-mask-size: 100% 200%;
          mask-size: 100% 200%;
  -webkit-mask-position: 0 0;
          mask-position: 0 0;
}
[data-build].built img {
  -webkit-mask-position: 0 100%;
          mask-position: 0 100%;
  transition: -webkit-mask-position 1.4s steps(14, end), mask-position 1.4s steps(14, end);
}
.studio-copy p { margin: 22px 0 0; max-width: 44ch; font-size: clamp(17px, 1vw + 12px, 21px); }

/* ---------- الفريق ---------- */

.team {
  position: relative;
  padding: clamp(110px, 12vw, 170px) 0 clamp(120px, 11vw, 160px);
  background: var(--paper-2);
  border-top: 3px solid var(--ink);
  overflow: hidden;
}
.runner {
  --w: 58px;
  position: absolute;
  bottom: 14px;
  left: 0;
  width: var(--w);
  height: calc(var(--w) * 1.497);
  background: url("../img/runner.webp") 0 0 / calc(var(--w) * 8) 100% no-repeat;
  opacity: 0;
  pointer-events: none;
}
/* يركض حين يُطلقه site.js: عبورٌ سريع ثم يختفي ويرتاح */
.runner.running { opacity: 1; animation: runFrames .58s steps(8) infinite; }
@keyframes runFrames { to { background-position-x: calc(var(--w) * -8); } }
.cards {
  list-style: none;
  margin: 0 auto;
  padding: 0 var(--gutter);
  width: min(var(--max), 100%);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}
.card {
  flex: 1 1 200px;
  max-width: 280px;
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 8px;
  padding: 26px 20px 22px;
  box-shadow: 0 6px 0 var(--ink);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 0 var(--ink); }

/* ---------- المركز الأول: الضوء علينا ---------- */

.award {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(90px, 10vw, 150px) 0;
}
.award-inner {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.award-head .kicker { color: rgba(242, 236, 224, .7); }
.award-title {
  margin: 6px 0 0;
  font: 400 clamp(64px, 8vw, 132px)/.9 var(--display);
  color: var(--gold);
  text-shadow: 6px 7px 0 #000;
}
[dir="rtl"] .award-title { font-size: clamp(56px, 6.5vw, 110px); line-height: 1.1; }
.award-line {
  margin: 20px 0 0;
  max-width: 30ch;
  font-size: clamp(17px, 1vw + 11px, 21px);
  font-weight: 600;
  opacity: .85;
}
.award-photo {
  margin: 0;
  width: 100%;
  max-width: 680px;
  justify-self: end;
}
.award-photo img {
  width: 100%;
  height: auto;
  filter: drop-shadow(10px 12px 0 #000);
}
.card h3 { margin: 0 0 8px; font: 400 30px/1.05 var(--display); }
.card p { margin: 0; color: var(--muted); font-size: 15px; font-weight: 600; }

/* ---------- الفوتر ---------- */

.foot {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(70px, 9vw, 120px) var(--gutter) 40px;
  display: grid;
  justify-items: center;
  gap: 34px;
  text-align: center;
}
.foot-logo { width: min(320px, 70vw); height: auto; }
.foot .play { background: var(--gold); box-shadow: 0 6px 0 var(--paper); border-color: var(--paper); }
.foot .play:hover { box-shadow: 0 4px 0 var(--paper); }
.foot-small { margin: 0; font-size: 14px; opacity: .6; letter-spacing: .04em; }

/* ---------- الوجوه المخبّأة ---------- */

.face {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: url("../img/face.webp") center / contain no-repeat;
  cursor: pointer;
  opacity: .92;
  animation: bob 3.2s ease-in-out infinite;
  z-index: 5;
}
[dir="rtl"] .face:not(.face--inline) { left: auto; right: var(--x); }
.face--inline { position: relative; left: auto; top: auto; display: inline-block; vertical-align: middle; margin-top: 14px; width: 34px; height: 34px; }
.face:hover { transform: scale(1.15); }
.face.found { animation: found .5s cubic-bezier(.3, 1.8, .5, 1) forwards; pointer-events: none; }
@keyframes bob { 50% { translate: 0 -6px; } }
@keyframes found { 40% { transform: scale(1.6) rotate(-12deg); opacity: 1; } 100% { transform: scale(0) rotate(30deg); opacity: 0; } }

.hud {
  position: fixed;
  bottom: 18px;
  inset-inline-end: 18px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px 6px 8px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--paper);
  border-radius: 999px;
  font: 400 26px/1 var(--display);
  font-family: "Crayon", sans-serif;
}
.hud[hidden] { display: none; }
.hud img { margin-inline-end: 6px; }
.hud.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.18); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  z-index: 46;
  translate: -50% 140%;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 5px 0 var(--ink);
  padding: 10px 18px;
  font: 400 24px/1.1 var(--display);
  white-space: nowrap;
  transition: translate .35s cubic-bezier(.3, 1.4, .5, 1), visibility 0s linear .35s;
  max-width: calc(100vw - 32px);
  visibility: hidden;
}
.toast.show { translate: -50% 0; visibility: visible; transition: translate .35s cubic-bezier(.3, 1.4, .5, 1), visibility 0s; }

/* ---------- الشاشات الصغيرة ---------- */

@media (max-width: 900px) {
  .world, .world--flip { grid-template-columns: 1fr; }
  .world--flip .world-frame { order: 0; }
  .world-art { box-shadow: 6px 8px 0 var(--ink); }
  .world--flip .world-art { box-shadow: -6px 8px 0 var(--ink); }
  .studio { grid-template-columns: 1fr; }
  .studio-mark { max-width: 360px; }
  .award-inner { grid-template-columns: 1fr; }
  .award-photo { justify-self: center; }
}
@media (max-width: 720px) {
  .links { display: none; }
  .bar { gap: 12px; }
  .bar-end { margin-inline-start: auto; }
  .brand span { display: none; }
  .hero-hint { display: none; }
  .toast { white-space: normal; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .paint { -webkit-mask-position: 0 0; mask-position: 0 0; }
  .runner { display: none; }
}

/* ==========================================================================
   الأعلام: اغرسها فيعود اللون
   ========================================================================== */

.worlds-hint {
  margin: 18px 0 0;
  font: 400 clamp(22px, 1.6vw + 12px, 30px)/1.2 var(--display);
  color: var(--muted);
}

.flag {
  position: absolute;
  bottom: calc(100% - 16px);
  inset-inline-start: 30px;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.flag svg { position: relative; width: 92px; height: 132px; overflow: visible; filter: drop-shadow(3px 4px 0 rgba(22, 21, 26, .35)); transition: transform .2s ease; }
.flag::before {
  content: "";
  position: absolute;
  left: 4px;
  top: -6px;
  width: 104px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cloth), transparent 68%);
  opacity: .45;
  animation: halo 1.8s ease-in-out infinite;
  pointer-events: none;
}
[dir="rtl"] .flag::before { left: auto; right: 4px; }
@keyframes halo { 50% { transform: scale(1.18); opacity: .2; } }
.flag-pole { stroke: var(--ink); stroke-width: 5; stroke-linecap: round; }
.flag-top { fill: var(--ink); }
.flag-cloth {
  fill: var(--cloth);
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
  transform-origin: 14px 24px;
  animation: wave 1.6s ease-in-out infinite;
}
@keyframes wave { 50% { transform: skewY(-6deg) scaleX(.94); } }
.flag-tip {
  margin-top: 12px;
  padding: 7px 14px 5px;
  background: var(--paper);
  color: var(--ink);
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  font: 400 26px/1 var(--display);
  white-space: nowrap;
  box-shadow: 0 4px 0 var(--ink);
  animation: nudge 2.4s ease-in-out infinite;
}
@keyframes nudge { 50% { transform: translateX(5px); } }
[dir="rtl"] .flag-tip { animation-name: nudgeRtl; }
@keyframes nudgeRtl { 50% { transform: translateX(-5px); } }
.flag:hover svg { transform: translateY(-5px) rotate(-3deg); }
.flag.planted { visibility: hidden; }

/* الشريط: ثلاث قواعد تنتظر أعلامها */
.flagbar {
  position: fixed;
  bottom: 18px;
  inset-inline-start: 18px;
  z-index: 45;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px 6px 10px;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--paper);
  border-radius: 999px;
  font: 400 24px/1 "Crayon", sans-serif;
  transform: translateY(160%);
  transition: transform .45s cubic-bezier(.3, 1.4, .5, 1);
}
.flagbar.shown { transform: none; }
.slot svg { width: 22px; height: 32px; display: block; overflow: visible; }
.slot .flag-pole { stroke: var(--paper); stroke-width: 6; opacity: .5; }
.slot .flag-cloth { fill: transparent; stroke: rgba(242, 236, 224, .45); stroke-dasharray: 5 5; animation: none; }
.slot.filled .flag-pole { opacity: 1; }
.slot.filled .flag-cloth { fill: var(--cloth); stroke: var(--paper); stroke-dasharray: none; animation: wave 1.6s ease-in-out infinite; }
.slot.pop { animation: bump .45s ease; }
.flagbar-count { margin-inline-start: 6px; }

/* العلم في طريقه للشريط، وموجة اللون من حيث غُرس */
.flying { position: fixed; z-index: 60; pointer-events: none; width: 92px; height: 132px; }
.flying svg { width: 100%; height: 100%; overflow: visible; }
.flying .flag-cloth { animation: none; }
.burst {
  position: fixed;
  z-index: 55;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, var(--c) 0%, rgba(255, 255, 255, 0) 70%);
  mix-blend-mode: screen;
  animation: burst 1.3s cubic-bezier(.2, .7, .2, 1) forwards;
}
@keyframes burst { from { transform: scale(0); opacity: .85; } to { transform: scale(var(--s)); opacity: 0; } }

/* قصاصات */
.confetti {
  position: fixed;
  top: -20px;
  z-index: 58;
  width: 10px;
  height: 16px;
  pointer-events: none;
  border-radius: 2px;
  animation: fall var(--d) cubic-bezier(.3, .6, .4, 1) forwards;
}
@keyframes fall { to { transform: translate(var(--dx), 110vh) rotate(var(--r)); } }

/* الأعلام الثلاثة: الموقع كله يضيء */
main::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 2.4s ease;
  background:
    radial-gradient(circle at 12% 18%, rgba(229, 138, 47, .22), transparent 42%),
    radial-gradient(circle at 88% 42%, rgba(143, 99, 242, .2), transparent 45%),
    radial-gradient(circle at 30% 88%, rgba(229, 72, 77, .18), transparent 45%),
    radial-gradient(circle at 75% 92%, rgba(46, 196, 182, .16), transparent 40%);
}
.all-color main::before { opacity: 1; }
.all-color .kicker--ink { color: var(--ink); }
.all-color .worlds-hint { color: #b9771f; }
.all-color .card { box-shadow: 0 6px 0 var(--ink), 0 0 0 4px rgba(255, 201, 63, .35); }

/* المركز الأول: "1st" واضح */
.award-title { display: flex; flex-direction: column; gap: 0; }
.award-title span:empty { display: none; }
.award-big {
  font: 400 clamp(120px, 14vw, 240px)/.82 var(--display);
  color: var(--gold);
  text-shadow: 7px 8px 0 #000;
}
.award-pre, .award-post {
  font: 400 clamp(34px, 3.6vw, 60px)/1 var(--display);
  color: var(--paper);
  text-shadow: 4px 5px 0 #000;
}
.award-post { margin-top: 6px; }
[dir="rtl"] .award-big { font-size: clamp(96px, 10vw, 180px); line-height: 1.05; }

@media (max-width: 720px) {
  .flag { inset-inline-start: 18px; bottom: calc(100% - 12px); }
  .flag svg { width: 66px; height: 95px; }
  .flag::before { width: 76px; height: 58px; }
  .flag-tip { font-size: 20px; margin-top: 8px; }
  .flying { width: 66px; height: 95px; }
  .world { margin-bottom: 130px; }
  .worlds .section-head { margin-bottom: 120px; }
  .flagbar { bottom: 12px; inset-inline-start: 12px; padding: 4px 10px 4px 8px; font-size: 19px; }
  .slot svg { width: 17px; height: 25px; }

  /* الجوال: أعمدةٌ مرتّبة بعرض النصّ */
  .note { flex-basis: 100%; max-width: none; transform: rotate(calc(var(--tilt) * .4)); }
  .cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
  .card { max-width: none; padding: 18px 14px 16px; }
  .card:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .card h3 { font-size: 23px; }
  .card p { font-size: 13px; }
  .studio { gap: 26px; }
  .studio-mark { max-width: 230px; margin-inline: auto; }
  .hero .face { --y: 16% !important; }
  .runner { --w: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .flagbar { transform: none; }
}


/* ---------- الخزانة: ستّة أزياء بشيدر اللعبة ---------- */

.looks {
  background: var(--paper-2);
  padding: clamp(80px, 10vw, 140px) 0 clamp(70px, 9vw, 120px);
  border-top: 2.5px solid var(--ink);
  outline: none;
  --accent: #5a5a66;
}
.looks-body {
  width: min(var(--max), 100%);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(26px, 4vw, 64px);
  align-items: center;
}
.stage {
  position: relative;
  aspect-ratio: 1 / 1;
  border: 2.5px solid var(--ink);
  border-radius: 16px 26px 14px 22px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 36%, #2a2830, var(--ink) 72%);
  box-shadow: 8px 9px 0 var(--ink);
  transform: rotate(-1deg);
}
.orb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: pan-y;
}
.orb:active { cursor: grabbing; }
.stage.flat .orb { display: none; }
.stage.flat::before {
  content: "";
  position: absolute;
  inset: 24%;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .55), transparent 38%), var(--accent);
  box-shadow: 0 0 90px var(--accent);
}
.stamp {
  position: absolute;
  top: 18px;
  inset-inline-start: 18px;
  margin: 0;
  padding: 8px 14px 5px;
  font: 400 30px/1 var(--display);
  color: var(--ink);
  background: var(--paper);
  border: 2.5px solid var(--ink);
  border-radius: 6px;
  transform: rotate(-7deg);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, .55);
}
.stamp[hidden] { display: none; }
.drag {
  position: absolute;
  bottom: 14px;
  inset-inline-end: 18px;
  margin: 0;
  font: 400 21px/1 var(--display);
  color: var(--paper);
  opacity: .5;
  pointer-events: none;
}
.look-card {
  background: #fbf7ee;
  border: 2.5px solid var(--ink);
  border-radius: 6px 16px 8px 14px;
  padding: clamp(22px, 3vw, 36px);
  box-shadow: 8px 9px 0 var(--ink);
  transform: rotate(1.2deg);
}
.look-card.pop { animation: look-pop .45s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes look-pop {
  0% { transform: rotate(1.2deg) scale(.95); }
  60% { transform: rotate(1.2deg) scale(1.03); }
  100% { transform: rotate(1.2deg) scale(1); }
}
.look-count { margin: 0; font-weight: 800; font-size: 13px; letter-spacing: .3em; color: var(--muted); text-align: center; }
.look-name-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0 8px; }
.look-name {
  flex: 1;
  margin: 0;
  text-align: center;
  font: 400 clamp(44px, 5vw, 72px)/1 "Crayon", system-ui, sans-serif;
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--ink);
  letter-spacing: .02em;
  transition: color .3s ease;
}
.look-arrow {
  flex: none;
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  font: 400 40px/1 "Crayon", system-ui, sans-serif;
  color: var(--ink);
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform .15s ease, box-shadow .15s ease;
}
.look-arrow:hover { transform: translateY(-2px); }
.look-arrow:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
[dir="rtl"] .look-arrow span { display: inline-block; transform: scaleX(-1); }
.look-line { margin: 0 0 18px; min-height: 2.9em; text-align: center; font-size: 18px; color: #3a3731; }
.swatches { display: flex; justify-content: center; gap: 10px; margin-bottom: 18px; }
.swatches span { width: 34px; height: 34px; border: 2.5px solid var(--ink); border-radius: 50%; box-shadow: 2px 2px 0 var(--ink); }
.look-state { margin: 0 0 8px; text-align: center; font-weight: 700; }
.look-bar { height: 13px; margin-bottom: 22px; border: 2.5px solid var(--ink); border-radius: 99px; overflow: hidden; background: var(--paper); }
.look-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .6s cubic-bezier(.3, 1.2, .5, 1), background .3s ease; }
.look-tabs { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.look-tab {
  width: 40px;
  height: 40px;
  border: 2.5px solid var(--ink);
  border-radius: 10px;
  background: #cfc8b8;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .3s ease;
}
.look-tab.open { background: var(--c); }
.look-tab.on { transform: translateY(-5px); box-shadow: 0 5px 0 var(--ink); }
.looks-hint { margin: clamp(28px, 4vw, 46px) auto 0; padding: 0 var(--gutter); text-align: center; font: 400 26px/1.2 var(--display); opacity: .7; }

@media (max-width: 900px) {
  .looks-body { grid-template-columns: 1fr; }
  .stage, .look-card { transform: none; }
  .look-card.pop { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .look-card.pop { animation: none; }
}
