/* «مدينة القصص» — أنماط اللعبة الكبرى */
.g-map, .g-place, .g-album, .g-practice { position: absolute; inset: 0; overflow: hidden; color: var(--ink); background: var(--night); }
.g-head { position: absolute; top: 0; right: 0; left: 0; z-index: 6; height: 58px; display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: linear-gradient(180deg, rgba(27,31,59,.85), rgba(27,31,59,0)); color: #fff; }
.g-head b { flex: 1; font-size: 20px; font-weight: 800; text-shadow: 0 2px 4px rgba(0,0,0,.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-back { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; display: flex; align-items: center; justify-content: center; padding: 0; }
.g-pts { flex: none; display: flex; align-items: center; gap: 4px; background: var(--blue); color: #fff; border-radius: 999px; padding: 5px 12px; font-weight: 800; font-size: 16px; box-shadow: 0 3px 0 var(--blue-d); }
.g-pts i { display: inline-flex; color: #FFD24A; }
.g-stars { display: inline-flex; gap: 1px; }
.g-stars i { display: inline-flex; color: rgba(255,255,255,.35); font-style: normal; }
.g-stars i.on { color: #FFB200; }
.g-stars.big i svg { width: 34px; height: 34px; }
.g-btn { border: 0; border-radius: 999px; padding: 10px 20px; font-size: 17px; font-weight: 800; background: var(--green); color: #fff; box-shadow: 0 4px 0 #13813C; }
.g-btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 4px 0 #9AA0C2; }
.g-btn:active { transform: translateY(2px); }

/* الخريطة */
.g-mapbox { position: absolute; top: 0; right: 0; width: 390px; height: 693px; }
.g-mapbox > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-spot { position: absolute; transform: translate(50%, -50%); border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.g-spot .dot { width: 44px; height: 44px; border-radius: 50%; background: var(--orange); color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 var(--orange-d), 0 0 0 3px #fff; }
.g-spot .lbl { background: rgba(255,255,255,.95); border-radius: 12px; padding: 2px 9px; font-size: 13px; font-weight: 800; white-space: nowrap; box-shadow: 0 2px 0 rgba(27,31,59,.3);
  display: flex; align-items: center; gap: 4px; }
.g-spot .lbl .stars i { color: #D5D9EA; } .g-spot .lbl .stars i.on { color: #FFB200; }
.g-spot .lbl .cost { display: inline-flex; align-items: center; color: var(--blue-d); font-size: 12px; }
.g-spot .lbl .cost svg { width: 12px; height: 12px; color: #FFB200; }
.g-spot .lbl .lk { display: inline-flex; color: #7A80A6; }
.g-spot.done .dot { background: var(--green); box-shadow: 0 4px 0 #13813C, 0 0 0 3px #fff; }
.g-spot.cur .dot { animation: g-pulse 1.4s ease-in-out infinite; }
.g-spot.locked .dot { background: #9AA0C2; box-shadow: 0 4px 0 #7A80A6, 0 0 0 3px #fff; }
.g-spot.locked .lbl { opacity: .8; }
@keyframes g-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }
.g-bottom { position: absolute; bottom: 0; right: 0; left: 0; height: 92px; padding: 0 16px 20px; display: flex; gap: 10px; justify-content: center; align-items: flex-end;
  background: linear-gradient(0deg, var(--night) 55%, rgba(27,31,59,0)); }
.g-bottom .g-btn { flex: 1; max-width: 190px; }
.g-say { position: absolute; z-index: 7; right: 12px; left: 12px; top: 60px; display: flex; align-items: flex-end; gap: 8px; }
.g-map .g-say { top: auto; bottom: 96px; }
.g-say .who { width: 60px; flex: none; }
.g-say p { margin: 0 0 8px; flex: 1; background: #fff; border-radius: 16px; padding: 9px 13px; font-family: 'Noto Naskh Arabic', serif; font-size: 17px; font-weight: 700; line-height: 1.6;
  box-shadow: 0 3px 0 rgba(27,31,59,.35); }
.g-say.pop { animation: g-in .35s ease-out; }
@keyframes g-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.g-intro, .g-modal { position: absolute; inset: 0; z-index: 20; background: rgba(27,31,59,.78); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; }
.g-intro .dove { width: 180px; margin-bottom: -16px; position: relative; z-index: 1; animation: g-float 3s ease-in-out infinite; }
@keyframes g-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.g-intro .card, .g-modal .card { background: #fff; border-radius: 22px; padding: 18px; text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.25); max-width: 340px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 10px; }
.g-intro p, .g-modal p { margin: 0; font-family: 'Noto Naskh Arabic', serif; font-size: 17.5px; font-weight: 700; line-height: 1.7; }
.g-intro p.hd { color: var(--blue-d); }
.g-modal b { font-size: 20px; font-weight: 800; line-height: 1.5; font-family: 'Noto Naskh Arabic', serif; }
.g-modal p.sub { font-family: inherit; font-size: 15px; color: var(--muted); }
.g-modal p.warn { color: var(--orange-d); }
.g-modal .g-neighbor { height: 210px; margin-bottom: -18px; position: relative; z-index: 1; }

/* المكان */
.g-scene { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.g-scene.before { filter: saturate(.75) brightness(.95); }
.g-scene.after { clip-path: inset(0 0 0 100%); transition: clip-path .9s ease, -webkit-clip-path .9s ease; }
.g-stop { position: absolute; z-index: 3; transform: translate(50%, -50%); border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.g-stop .dot { width: 46px; height: 46px; border-radius: 50%; background: #9AA0C2; color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 0 #7A80A6, 0 0 0 3px #fff; }
.g-stop .lbl { background: rgba(255,255,255,.95); border-radius: 12px; padding: 1px 9px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.g-stop.cur .dot { background: var(--orange); box-shadow: 0 4px 0 var(--orange-d), 0 0 0 3px #fff, 0 0 0 9px rgba(255,138,31,.35); animation: g-pulse 1.4s ease-in-out infinite; }
.g-stop.done .dot { background: var(--green); box-shadow: 0 4px 0 #13813C, 0 0 0 3px #fff; color: #FFD24A; }
.g-stop.locked { opacity: .85; }
.g-hero { position: absolute; z-index: 2; bottom: 6%; height: 168px; translate: 50% 0; transition: right 1s ease; pointer-events: none; }
/* ذَهِين ينظر إلى المحطة التي أمامه (يمينه)، وحين يمشي إلى التالية (يساراً) يلتفت إليها، والحمامة معه في الاتجاه نفسه */
.g-hero.walking, .g-dove.walking { scale: -1 1; }
.g-dove { position: absolute; z-index: 2; bottom: calc(6% + 182px); height: 72px; translate: 50% 0; transition: right 1s ease; pointer-events: none; animation: g-bob 2.6s ease-in-out infinite; }
@keyframes g-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.g-place .g-head .g-stars i { color: rgba(255,255,255,.4); }
.g-place .g-head .g-stars i.on { color: #FFB200; }
.g-donebar { position: absolute; z-index: 6; bottom: 22px; right: 0; left: 0; display: flex; gap: 10px; justify-content: center; }

/* ورقة المحطة */
.g-sheet { position: absolute; z-index: 10; right: 0; left: 0; bottom: 0; height: 548px; background: var(--cream); border-radius: 26px 26px 0 0; box-shadow: 0 -6px 24px rgba(0,0,0,.35);
  display: flex; flex-direction: column; padding: 10px 14px 14px; transform: translateY(100%); transition: transform .35s ease; }
.g-sheet.in { transform: none; }
.g-sheet.full { top: 60px; height: auto; border-radius: 26px 26px 0 0; }
.g-sh-head { display: flex; align-items: center; gap: 8px; }
.g-sh-head b { flex: 1; text-align: center; font-size: 18px; font-weight: 800; }
.g-x, .g-spk, .g-listen, .g-mini { flex: none; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; padding: 0; }
.g-x { width: 36px; height: 36px; background: #E6E8F3; color: var(--ink); }
.g-spk, .g-listen { width: 38px; height: 38px; background: var(--blue); color: #fff; box-shadow: 0 3px 0 var(--blue-d); }
.g-mini { width: 30px; height: 30px; background: #E8F1FF; color: var(--blue-d); }
.g-ins { margin: 6px 4px 6px; font-family: 'Noto Naskh Arabic', serif; font-size: 15.5px; font-weight: 700; line-height: 1.6; color: var(--muted); text-align: center; }
.g-prog { height: 8px; background: #E6E8F3; border-radius: 99px; overflow: hidden; margin: 0 4px 8px; flex: none; }
.g-prog i { display: block; height: 100%; width: 0; background: var(--green); border-radius: 99px; transition: width .5s ease; }
.g-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; position: relative; overflow: hidden; }
.g-hint { display: flex; align-items: center; gap: 8px; background: #FFF2D9; border: 2px solid #FFC56B; border-radius: 16px; padding: 6px 10px; margin-top: 8px; flex: none; animation: g-in .3s ease-out; }
.g-hint img { width: 40px; flex: none; }
.g-hint p { margin: 0; font-family: 'Noto Naskh Arabic', serif; font-size: 15px; font-weight: 700; line-height: 1.6; }
.g-help { margin: 8px auto 0; border: 0; border-radius: 999px; padding: 7px 18px; font-size: 16px; font-weight: 800; background: #FFD24A; color: var(--ink); box-shadow: 0 3px 0 #C9A11A; flex: none; }
.g-cheer { position: absolute; top: 46px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; align-items: center; gap: 6px; background: #fff; border-radius: 999px; padding: 4px 14px 4px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2); font-family: 'Noto Naskh Arabic', serif; font-weight: 700; font-size: 15px; white-space: nowrap; animation: g-in .3s ease-out; transition: opacity .5s; }
.g-cheer img { width: 34px; }
.g-cheer.out { opacity: 0; }
.g-stopdone { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; }
.g-stopdone img { width: 130px; }
.g-stopdone b { font-family: 'Noto Naskh Arabic', serif; font-size: 21px; line-height: 1.6; }
.g-stopdone p { margin: 0; font-size: 15px; font-weight: 700; color: var(--muted); }
.g-stopdone .g-stars i { color: #D5D9EA; } .g-stopdone .g-stars i.on { color: #FFB200; }

/* السؤال والخيارات */
.g-q { position: relative; background: #fff; border-radius: 20px; padding: 14px 14px 14px 58px; box-shadow: 0 4px 0 #D9DCEB; min-height: 64px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.g-q.center { justify-content: center; padding: 14px; }
.g-q .g-listen { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); }
.g-text { margin: 0; font-family: 'Noto Naskh Arabic', serif; font-size: 22px; font-weight: 700; line-height: 1.9; }
.g-text.sm { font-size: 18px; }
.g-ask { margin: 0; width: 100%; font-size: 14px; font-weight: 800; color: var(--muted); }
.g-mean { display: inline-block; background: #EAF3FF; color: var(--blue-d); border-radius: 999px; padding: 2px 12px; font-family: 'Noto Naskh Arabic', serif; font-size: 15px; font-weight: 700; }
.blank { display: inline-block; min-width: 56px; height: 1.4em; border-bottom: 3px dashed var(--orange); vertical-align: -0.2em; margin: 0 4px; }
.blank.sm { min-width: 28px; }
.blank.filled { border-bottom-style: solid; border-color: var(--green); min-width: 0; color: var(--green); padding: 0 4px; }
.g-sign { margin: 0 auto; background: linear-gradient(180deg, #C98B4D, #A86A33); border-radius: 12px; padding: 8px 22px; box-shadow: 0 5px 0 #7A4A20, inset 0 0 0 3px rgba(255,255,255,.18); }
.g-sign .w { font-family: 'Noto Naskh Arabic', serif; font-size: 40px; font-weight: 700; color: #fff; line-height: 1.5; text-shadow: 0 2px 0 rgba(0,0,0,.25); }
.g-sign .blank { border-color: #FFE07A; min-width: 34px; }
.g-sign.done { background: linear-gradient(180deg, #4CC97A, #22B357); box-shadow: 0 5px 0 #13813C; }
.g-opts { display: flex; flex-direction: column; gap: 10px; }
.g-opts.letters, .g-opts.two { flex-direction: row; justify-content: center; flex-wrap: wrap; }
.g-optw { display: flex; align-items: center; gap: 6px; }
.g-opts.letters .g-optw, .g-opts.two .g-optw { flex-direction: column; }
.g-opts:not(.letters):not(.two) .g-optw .g-opt { flex: 1; }
.g-opt { border: 0; border-radius: 18px; background: #fff; color: var(--ink); padding: 10px 16px; font-family: 'Noto Naskh Arabic', serif; font-size: 20px; font-weight: 700; line-height: 1.6;
  box-shadow: 0 4px 0 #C8CDE3; min-height: 54px; text-align: center; }
.g-opt.big { min-width: 84px; font-size: 30px; padding: 6px 18px; }
.g-opt.tf { min-width: 140px; font-size: 22px; }
.g-opt.ok { background: var(--green); color: #fff; box-shadow: 0 4px 0 #13813C; }
.g-opt:disabled:not(.ok) { opacity: .45; }
.bad { animation: dh-shake .42s ease-in-out; }
.glow { animation: g-glow 1s ease-in-out 3; }
@keyframes g-glow { 0%, 100% { box-shadow: 0 4px 0 #C8CDE3, 0 0 0 0 rgba(255,210,74,0); } 50% { box-shadow: 0 4px 0 #C8CDE3, 0 0 0 8px rgba(255,210,74,.9); } }
@keyframes dh-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.g-bigspk { border: 0; border-radius: 22px; background: var(--blue); color: #fff; padding: 12px 26px; display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 800; box-shadow: 0 5px 0 var(--blue-d); }
.g-bigspk svg { width: 30px; height: 30px; }

/* التصنيف والوصل */
.g-bins { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.g-bins.n3 { grid-template-columns: 1fr 1fr 1fr; }
.g-bin { border: 3px dashed #B8BFDA; border-radius: 18px; background: #fff; min-height: 128px; padding: 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); }
.g-bin b { font-size: 15px; font-weight: 800; color: var(--blue-d); font-family: 'Noto Naskh Arabic', serif; }
.g-bin .in { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.g-bin .in i { font-style: normal; background: #E3F7EA; color: #13813C; border-radius: 10px; padding: 1px 8px; font-family: 'Noto Naskh Arabic', serif; font-weight: 700; font-size: 16px; }
.g-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.g-word { border: 0; border-radius: 14px; background: #fff; padding: 6px 14px; font-family: 'Noto Naskh Arabic', serif; font-size: 20px; font-weight: 700; box-shadow: 0 4px 0 #C8CDE3; color: var(--ink); }
.g-word.sel { background: #FFE9C7; box-shadow: 0 4px 0 var(--orange), 0 0 0 3px var(--orange); }
.g-word.gone { visibility: hidden; }
.g-word.ok { background: var(--green); color: #fff; box-shadow: 0 4px 0 #13813C; }
.g-word.big { font-size: 34px; background: none; box-shadow: none; color: #13813C; }
.g-pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.g-pairs .col { display: flex; flex-direction: column; gap: 10px; }
.g-ropes { display: flex; justify-content: center; gap: 10px; color: #C8CDE3; }
.g-ropes i.on { color: #8C5A2B; }

/* الترتيب والبناء */
.g-line, .g-slots { min-height: 62px; background: #fff; border-radius: 18px; padding: 10px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; box-shadow: inset 0 0 0 3px #E6E8F3; }
.g-line.done, .g-slots.done { box-shadow: inset 0 0 0 3px var(--green); }
.g-wtile { background: #E3F7EA; border-radius: 12px; padding: 3px 10px; font-family: 'Noto Naskh Arabic', serif; font-size: 20px; font-weight: 700; color: #13813C; }
.g-wtile.dot { background: none; padding: 0; }
.g-tiles { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.g-tile { border: 0; border-radius: 14px; background: #fff; padding: 6px 14px; font-family: 'Noto Naskh Arabic', serif; font-size: 21px; font-weight: 700; box-shadow: 0 4px 0 #C8CDE3; color: var(--ink); }
.g-tile.big { min-width: 58px; font-size: 32px; padding: 4px 12px; }
.g-tile.gone { visibility: hidden; }
.g-slots { direction: rtl; }
.g-slot { width: 46px; height: 52px; border-radius: 12px; background: #F1F2F8; border-bottom: 3px solid #B8BFDA; font-family: 'Noto Naskh Arabic', serif; font-size: 30px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.g-slot.on { background: #E3F7EA; border-color: var(--green); color: #13813C; }

/* السباق */
.g-race { display: flex; align-items: center; gap: 8px; margin: 0 4px 8px; flex: none; }
.g-race .lanterns { display: flex; gap: 2px; flex: 1; }
.g-race .lanterns i { color: #9AA0C2; display: inline-flex; }
.g-race .lanterns i .glass { fill: #5A5F86; }
.g-race .lanterns i.on { color: #8C5A2B; } .g-race .lanterns i.on .glass { fill: #FFD24A; }
.g-race .clock { background: var(--ink); color: #fff; border-radius: 999px; padding: 2px 10px; font-weight: 800; font-size: 15px; }
.g-race .best { font-size: 12px; font-weight: 800; color: var(--muted); }

/* البالونات */
.g-sky { flex: 1; position: relative; border-radius: 18px; background: linear-gradient(180deg, #BFE3FF, #E9F6FF); overflow: hidden; min-height: 300px; }
.g-balloon { position: absolute; bottom: -120px; width: 92px; height: 112px; border: 0; padding: 0; background: none; animation: g-rise 6.5s linear infinite; }
.g-sky.slow .g-balloon { animation-duration: 9.5s; }
.g-balloon::before { content: ''; position: absolute; top: 0; left: 6px; right: 6px; height: 92px; border-radius: 50% 50% 46% 46%; background: var(--c); box-shadow: inset -8px -10px 0 rgba(0,0,0,.12), inset 8px 8px 0 rgba(255,255,255,.25); }
.g-balloon::after { content: ''; position: absolute; top: 92px; left: 50%; width: 2px; height: 20px; background: #7A80A6; }
.g-balloon span { position: absolute; top: 26px; left: 0; right: 0; text-align: center; font-family: 'Noto Naskh Arabic', serif; font-weight: 700; font-size: 17px; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.45); line-height: 1.3; padding: 0 4px; }
.g-balloon.hold { animation-play-state: paused; }
.g-balloon.popped { animation: g-pop .35s ease-out forwards; }
.g-balloon.away { animation: g-away .6s ease-in forwards; }
@keyframes g-rise { from { transform: translateY(0); } to { transform: translateY(-480px); } }
@keyframes g-pop { to { transform: scale(1.5); opacity: 0; } }
@keyframes g-away { to { transform: translate(-40px, -200px) rotate(-20deg); opacity: 0; } }

/* الحديقة */
.g-garden { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.g-garden.n4 { grid-template-columns: 1fr 1fr; }
.g-potw { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.g-pot { width: 100%; border: 0; border-radius: 18px; background: #fff; box-shadow: 0 4px 0 #C8CDE3; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #E95D8B; }
.g-pot .pl svg { width: 52px; height: 52px; }
.g-pot b { font-family: 'Noto Naskh Arabic', serif; font-size: 17px; color: var(--ink); }
.g-pot.bloom { background: #FFF0F5; box-shadow: 0 4px 0 #F2A7BF; }
.g-pot.weed { background: #EFEBE2; box-shadow: 0 4px 0 #C9BFA8; }
.g-pot.gone { opacity: 0; transition: opacity .8s; }

/* الألبوم وزِدْ رَصيدَكَ */
.g-album { background: linear-gradient(180deg, #2A2F5A, var(--night)); }
.g-cards { position: absolute; top: 64px; bottom: 0; right: 0; left: 0; overflow-y: auto; padding: 4px 14px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.g-card { border: 0; border-radius: 18px; background: #fff; padding: 0; overflow: hidden; text-align: right; box-shadow: 0 4px 0 #9AA0C2; display: flex; flex-direction: column; color: var(--ink); }
.g-card img { width: 100%; height: 130px; object-fit: cover; flex: none; }
.g-card > span, .g-card .q { flex: none; }
.g-cards { grid-auto-rows: max-content; }
.g-card.hero { grid-column: span 2; }
.g-card.hero img { height: 190px; object-fit: contain; background: #FFE9C7; }
.g-card > span { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 2px; font-family: 'Noto Naskh Arabic', serif; font-size: 14px; font-weight: 700; line-height: 1.5; }
.g-card > span b { font-family: 'Baloo Bhaijaan 2', sans-serif; font-size: 16px; }
.g-card.empty { background: #DADDEB; box-shadow: 0 4px 0 #8E93B3; }
.g-card.empty .q { height: 150px; display: flex; align-items: center; justify-content: center; font-size: 60px; font-weight: 800; color: #9AA0C2; }
.g-card .g-stars i { color: #D5D9EA; } .g-card .g-stars i.on { color: #FFB200; }
.g-card.mini { flex-direction: row; align-items: center; width: 100%; box-shadow: 0 0 0 2px #E6E8F3; }
.g-card.mini img { width: 96px; height: 96px; }
.g-practice { background: linear-gradient(180deg, #2A2F5A, var(--night)); }
.g-pins { position: absolute; top: 58px; right: 16px; left: 16px; margin: 0; color: #fff; font-family: 'Noto Naskh Arabic', serif; font-size: 14px; line-height: 1.6; text-align: center; }
.g-practice .g-sheet.full { top: 118px; }
.game-card .tag.go { background: var(--green); color: #fff; }
