* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    background-color: #0a0a0a;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}
body {
    width: 100%;
    position: relative;
}

.hero {
    width: 100%;
    height: 100vh;
    overflow: hidden; 
    position: relative;
}


.h{
    width: 100%;
    height: 100%;
    object-fit: cover; 
    object-position: center; 
}

.bt{
   width: 20%;
    cursor: pointer;
    animation: pulseBtn 2.5s infinite ease-in-out;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
}


.logo {
    
   
    animation: magicFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.2)); 
}

@keyframes magicFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-15px); 
    }
}



@keyframes pulseBtn {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.08); 
    }
}

.bt:hover, .bt:active {
    animation: none; 
    transform: scale(1.15) translateY(-2px);
    filter: drop-shadow(0 0 25px rgba(168, 85, 247, 0.9)); 
}


.btn {
    position: absolute;
    z-index: 9999;
    bottom: 8%; 
    width: 15%; 
    right: 60px;
    cursor: pointer;
    
  
    animation: mysticFloat 3s infinite ease-in-out;
    transition: all 0.4s ease;
}


@keyframes mysticFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
    }
    50% {
        transform: translateY(-8px) scale(1.05); 
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.9)); 
    }
}
.btn:hover, .btn:active {
    transition: all 0.4s ease;
    animation: none; 
    transform: scale(1.15) translateY(-5px); 
    filter: drop-shadow(0 0 25px rgba(186, 120, 247, 0.545)); 
}


.fade-out {
    animation: fadeOutAnim 0.9s forwards ease-in-out;
}

@keyframes fadeOutAnim {
    0% { opacity: 1; }
    100% { opacity: 0; }
}

.fade-in {
    animation: fadeInAnim 0.9s forwards ease-in-out;
}

@keyframes fadeInAnim {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
.hero {
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: relative;
}

.hero div {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.h {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.imgg{
    width: 30%;
    position: absolute;
    top: 5%;
}


.gif{
    width: 42%;
    top: 20%;
    position: absolute;
    z-index: 1;
    
}

.imfff{
    position: relative;
}

.hhh{
    position: absolute;
    z-index: 100;
    width: 500%;
    top: 30%;
    border-radius: 10px;
 
}


.hero .ui-elements{
    position: absolute;
    left: 0;
  
    
    padding-right: 800px;
}

.hero > div:not(.ss) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    
}
.ss {
    position: absolute;
    z-index: 9999;
    width:100%;
  
 bottom:  50%;
     display: flex;
 padding: 0 00px;
    pointer-events: auto;
   justify-content: center;
}

.ss .option-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ss .option-box:hover {
    transform: scale(1.05); 
}

.ss .option-box img {
    width: 80%; 
    height: auto;
  
}

.ss .option-box p {
    position: absolute;
    z-index: 10;
    margin: 0;
    color: #2c1a0d;
  
    font-weight: bold;
    text-align: center;
    pointer-events: none; 
}


@keyframes magicFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes pulseBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes mysticFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
    }
    50% {
        transform: translateY(-8px) scale(1.05); 
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.9)); 
    }
}

.fade-out { animation: fadeOutAnim 0.9s forwards ease-in-out; }
@keyframes fadeOutAnim { 0% { opacity: 1; } 100% { opacity: 0; } }

.fade-in { animation: fadeInAnim 0.9s forwards ease-in-out; }
@keyframes fadeInAnim { 0% { opacity: 0; } 100% { opacity: 1; } }



.ss-1 {
    position: absolute;
    z-index: 9999; 
    width:100%;

 bottom:  10%;
     display: flex;
 padding: 0 00px;
    pointer-events: auto; 
   justify-content: center;
   box-sizing: border-box;
}

.ss-1 .option-box {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.ss-1 .option-box:hover {
    transform: scale(1.05);
}

.ss-1 .option-box img {
    width: 80%; 
    height: auto;
  
}

.ss-1 .option-box p {
    position: absolute;
    z-index: 10;
    margin: 0;
    color: #2c1a0d;

    font-weight: bold;
    text-align: center;
    pointer-events: none;
}


@keyframes magicFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

@keyframes pulseBtn {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

@keyframes mysticFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4));
    }
    50% {
        transform: translateY(-8px) scale(1.05); 
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.9)); 
    }
}

.fade-out { animation: fadeOutAnim 0.9s forwards ease-in-out; }
@keyframes fadeOutAnim { 0% { opacity: 1; } 100% { opacity: 0; } }

.fade-in { animation: fadeInAnim 0.9s forwards ease-in-out; }
@keyframes fadeInAnim { 0% { opacity: 0; } 100% { opacity: 1; } }





.ss .option-box:hover,
.ss-1 .option-box:hover {
  
    animation: wiggleShake 0.4s ease-in-out infinite; 
}


@keyframes wiggleShake {
    0% { transform: scale(1.05) rotate(0deg); }
    20% { transform: scale(1.05) rotate(-3deg); } 
    40% { transform: scale(1.05) rotate(3deg); }  
    60% { transform: scale(1.05) rotate(-3deg); } 
    80% { transform: scale(1.05) rotate(3deg); }  
    100% { transform: scale(1.05) rotate(0deg); } 
}


.ss .option-box:hover img,
.ss-1 .option-box:hover img {
    filter: drop-shadow(0px 15px 25px rgba(186, 120, 247, 0.9)); 
}


.top-left-box {
    position: absolute;
    top: 20px;  
    left: 100px; 
    z-index: 9999; 
    
    display: flex;
    justify-content: center; 
    align-items: center; 
}

.top-left-box img {
    width: 250px;
    height: auto;
    display: block;
}

p{
     font-family: "Bigelow Rules", serif;
     letter-spacing: 1px;
     font-size: 30px;
}
.number-text {
    position: absolute; 
    z-index: 10;
     color: #2c1a0d;
    font-size: 44px; 
    font-weight: bold;
    margin: 0;
    left: 40%;
    top: 50%;
    pointer-events: none; 
}


#game { position: relative; overflow: hidden; }
.screen-area { position: relative; }
.option-box { cursor: pointer; transition: transform .2s ease, filter .3s ease; }
.option-box:hover { transform: scale(1.04) rotate(-.6deg); }
.option-box:active { transform: scale(.97); }


.option-box.enter { animation: optIn .55s cubic-bezier(.34,1.56,.64,1) both; }
@keyframes optIn {
  from { opacity: 0; transform: translateY(40px) scale(.85) rotate(-3deg); }
  to   { opacity: 1; transform: none; }
}

.option-box.fall {
  animation: fall 1.1s cubic-bezier(.55,0,1,.45) forwards;
  pointer-events: none; z-index: 20;
}
@keyframes fall {
  0%   { transform: translateY(0) rotate(0); }
  14%  { transform: translateY(-26px) rotate(-5deg); }          
  100% { transform: translateY(130vh) rotate(38deg); }
}
.option-box.dim { filter: grayscale(.8) brightness(.7); pointer-events: none; }


.option-box.correct {
  animation: correctPop .7s ease both; filter: drop-shadow(0 0 18px #7ae582); z-index: 10;
}
@keyframes correctPop {
  0% { transform: scale(1); } 40% { transform: scale(1.14) rotate(1.5deg); } 100% { transform: scale(1.06); }
}


#game.shake { animation: hardShake .9s linear; }
@keyframes hardShake {
  0%,100% { transform: translate(0,0) rotate(0); }
  10% { transform: translate(-26px, 14px) rotate(-1.6deg); }
  20% { transform: translate(24px, -18px) rotate(1.4deg); }
  30% { transform: translate(-30px, -10px) rotate(-1.2deg); }
  40% { transform: translate(28px, 16px) rotate(1.8deg); }
  50% { transform: translate(-20px, 20px) rotate(-1deg); }
  60% { transform: translate(22px, -14px) rotate(.8deg); }
  70% { transform: translate(-14px, 10px) rotate(-.6deg); }
  80% { transform: translate(10px, -8px) rotate(.4deg); }
  90% { transform: translate(-6px, 4px) rotate(-.2deg); }
}
#game.hurt { filter: sepia(.6) saturate(3) hue-rotate(-30deg) contrast(1.1); }


#red-flash {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0;
  background: radial-gradient(circle at center, rgba(255,0,0,.35) 0%, rgba(190,0,0,.8) 100%);
  mix-blend-mode: multiply;
}
#red-flash.show { animation: flash 1s ease-out; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }


#score-box.bump { animation: bump .6s cubic-bezier(.34,1.56,.64,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.3) rotate(-4deg); } 100% { transform: scale(1); } }


#confetti-layer { position: fixed; inset: 0; z-index: 95; pointer-events: none; overflow: hidden; }
.confetti {
  position: absolute; top: 45vh; width: 10px; height: 16px; border-radius: 2px;
  animation: confettiFly 1.6s cubic-bezier(.2,.7,.3,1) forwards;
}
@keyframes confettiFly {
  0%   { transform: translate(0,0) rotate(0); opacity: 1; }
  40%  { transform: translate(calc(var(--dx) * .6), -30vh) rotate(calc(var(--rot) * .5)); }
  100% { transform: translate(var(--dx), 55vh) rotate(var(--rot)); opacity: 0; }
}


#popup-overlay {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
  background: rgba(10, 5, 14, .72); backdrop-filter: blur(4px); transition: opacity .3s ease;
}
#popup-overlay.hidden { opacity: 0; pointer-events: none; visibility: hidden; }

.popup {
  width: min(520px, 88vw); padding: 34px 30px 28px; text-align: center;
  background: #c9b08a; color: #2b1d12;
  border: 6px solid #3a2a1a; border-radius: 14px; outline: 3px solid #8a7350; outline-offset: -14px;
  box-shadow: 0 0 0 4px #1b120a, 0 30px 80px rgba(0,0,0,.7);
  font-family: "Bigelow Rules", "Cinzel Decorative", serif;
  animation: popIn .6s cubic-bezier(.34,1.56,.64,1);
}
#popup-overlay.hidden .popup { animation: none; }
@keyframes popIn { from { opacity: 0; transform: scale(.5) rotate(-6deg) translateY(60px); } to { opacity: 1; transform: none; } }

.popup h2 { margin: 0; font-size: clamp(30px, 4vw, 46px); }
.popup.win h2  { color: #1f6b2a; }
.popup.lose h2 { color: #9b1c1c; }
.popup.lose { animation: popIn .6s cubic-bezier(.34,1.56,.64,1), wobble .5s .6s ease; }
@keyframes wobble { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-2deg); } 75% { transform: rotate(2deg); } }

#popup-points { margin: 4px 0 14px; font-size: 40px; font-weight: 900; }
#popup-label  { margin: 0; font: 600 14px "Inter", sans-serif; letter-spacing: 1px; text-transform: uppercase; opacity: .75; }
#popup-answer {
  margin: 6px 0 10px; padding: 10px 14px; border-radius: 8px;
  background: rgba(43,29,18,.15); font: 800 19px "Inter", sans-serif;
}
#popup-why { margin: 0 0 18px; font: 500 14px/1.45 "Inter", sans-serif; opacity: .9; }

#next-btn {
  cursor: pointer; padding: 12px 34px; font: 700 20px "Bigelow Rules", serif; color: #f1e3c4;
  background: #3a2a1a; border: 3px solid #1b120a; border-radius: 10px;
  transition: transform .2s cubic-bezier(.34,1.56,.64,1), background .2s;
}
#next-btn:hover { transform: scale(1.08) rotate(-1deg); background: #5a3f27; }
#next-btn:active { transform: scale(.95); }

@media (prefers-reduced-motion: reduce) {
  #game.shake { animation: none; }
  .option-box.enter { animation: none; }
}



#options {
  position: absolute; z-index: 5;
  left: 50%; bottom: 5%; transform: translateX(-50%);
  width: 52%; max-width: 1100px;
  display: grid; grid-template-columns: 1fr 1fr;
  column-gap: 12.5%; row-gap: 5.6%;
}

#options .ss-1, #options .ss, #options .dd { display: contents; }

#options .option-box {
  position: relative; width: 100%; aspect-ratio: 4.2 / 1;
  margin: 0; padding: 0; top: auto; left: auto; right: auto; bottom: auto;
  display: flex; align-items: center; justify-content: center;
}
#options .option-box img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: 0; pointer-events: none;
}
#options .option-box p {
  position: relative; z-index: 1; margin: 0; padding: 0 8%; text-align: center;
  font-family: "Bigelow Rules", "Cinzel Decorative", serif;
  font-size: clamp(13px, 1.75vw, 30px); line-height: 1.1; color: #3a2a1a;
}


.option-box.hide-opt { animation: optOut .35s ease forwards; pointer-events: none; }
.option-box.fall.hide-opt { animation: none; opacity: 0; }
@keyframes optOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(30px) scale(.9); }
}



.lalala img {
  

    position: absolute;
    left: 34%;
    top: 31%;               

    width:  490px;
    height:  320px;
    object-fit: cover;       
    display: block;
}


:root{
  --dw: 1536;
  --dh: 730;
  --u: calc(100cqw / var(--dw));   
}

html { -webkit-tap-highlight-color: transparent; }


@media (orientation: landscape) and (max-width: 1024px),
       (orientation: landscape) and (hover: none) and (pointer: coarse) {

  html, body { height: 100vh; height: 100dvh; overflow: hidden; }
  body { display: grid; place-items: center; }

  #game {
    container-type: inline-size;
    width: min(100vw, calc(100dvh * var(--dw) / var(--dh)));
    height: auto;
    aspect-ratio: calc(var(--dw) / var(--dh));
  }

  .top-left-box      { top: calc(20 * var(--u)); left: calc(100 * var(--u)); }
  .top-left-box img  { width: calc(250 * var(--u)); }
  .number-text       { font-size: calc(44 * var(--u)); }

  .lalala img {
    width:  calc(490 * var(--u));
    height: calc(320 * var(--u));
  }

  #options .option-box p { font-size: 1.75cqw; }   
}


@media (orientation: portrait) and (max-width: 1024px),
       (orientation: portrait) and (hover: none) and (pointer: coarse) {

  html, body { height: 100vh; height: 100dvh; overflow: hidden; }

  #game {
    container-type: inline-size;
    --s: 1.8;                                 
    width: 100vw;
    height: 100vh; height: 100dvh;
    background: #0a0a0a;
  }

  /* الـ stage بنفس نسبة الديسكتوب فوق، والاختيارات تحته */
  #screen-area {
    inset: 0 0 auto 0;
    width: 100%;
    height: calc(100cqw * var(--dh) / var(--dw));
  }

  .top-left-box      { top: calc(14 * var(--u) * var(--s)); left: 3cqw; }
  .top-left-box img  { width: calc(250 * var(--u) * var(--s)); }
  .number-text       { font-size: calc(44 * var(--u) * var(--s)); }

  .lalala img {
    width:  calc(490 * var(--u));
    height: calc(320 * var(--u));
  }

  #options {
    width: 88%;
    max-width: none;
    bottom: 4%;
    column-gap: 5cqw;
    row-gap: 3cqw;
  }
  #options .option-box p { font-size: 3cqw; }
}

@media (orientation: portrait) and (max-width: 600px) {
  #options { width: 90%; grid-template-columns: 1fr; row-gap: 3cqw; }
  #options .option-box { aspect-ratio: 5 / 1; }
  #options .option-box p { font-size: 4.6cqw; }

  @keyframes hardShake {
    0%,100% { transform: translate(0,0) rotate(0); }
    20% { transform: translate(-8px, 5px) rotate(-.6deg); }
    40% { transform: translate(8px, -5px) rotate(.6deg); }
    60% { transform: translate(-6px, -3px) rotate(-.4deg); }
    80% { transform: translate(5px, 3px) rotate(.3deg); }
  }
}


@media (max-width: 600px), (max-height: 480px) {
  .popup { width: 90vw; padding: 22px 16px 18px; border-width: 4px;
           outline-offset: -10px; max-height: 94dvh; overflow: auto; }
  .popup h2 { font-size: clamp(24px, 7vw, 34px); }
  #popup-points { font-size: 30px; margin: 2px 0 8px; }
  #popup-answer { font-size: 16px; padding: 8px 10px; }
  #popup-why    { font-size: 13px; margin-bottom: 12px; }
  #next-btn     { padding: 9px 26px; font-size: 17px; }
}
@media (max-height: 480px) and (orientation: landscape) {
  .popup { width: min(520px, 70vw); padding: 12px 18px; }
  .popup h2 { font-size: 24px; }
  #popup-points { font-size: 24px; margin: 0 0 6px; }
  #popup-why { margin-bottom: 8px; }
}

/* ---------- اللمس: مفيش hover ---------- */
@media (hover: none) {
  .option-box:hover { transform: none; }
  .ss .option-box:hover,
  .ss-1 .option-box:hover { animation: none; }
}root { --logo-d: 420; --dw-intro: 1536; }

body:has(.ui-elements) { display: block; }          /* يلغي الـ grid بتاع الصفحة التانية */
.hero:has(.ui-elements) { height: 100vh; height: 100dvh; }

/* ---------- تابلت + موبايل أفقي ---------- */
@media (max-width: 1024px) and (orientation: landscape),
       (max-height: 480px) and (orientation: landscape) {

  .hero .ui-elements {
    padding-right: 52.08%;            /* = 800 / 1536 زي الديسكتوب بالظبط */
  }
  .hero .ui-elements .logo {
    width: calc(var(--logo-d) / var(--dw-intro) * 100vw);
    max-width: 100%;
    height: auto;
  }
  /* .bt بيتصغر لوحده (20% من الحيز) */
}

/* ---------- تابلت طولي + موبايل ---------- */
@media (orientation: portrait) and (max-width: 1024px) {

  .hero .ui-elements {
    padding-right: 0;
    justify-content: center;
    gap: 5vh;
  }
  .hero .ui-elements .logo { width: 78vw; max-width: 560px; height: auto; }
  .hero .ui-elements .bt   { width: 38vw; max-width: 260px; }


  .hero:has(.ui-elements) .h { object-position: 70% center; }
}

/* ---------- لمس ---------- */
@media (hover: none) {
  .bt:hover { transform: none; filter: drop-shadow(0 4px 6px rgba(0,0,0,.5)); animation: pulseBtn 2.5s infinite ease-in-out; }
}
/* =====================================================
   NEXT PAGE (img/Wh 1.svg + زرار next) — responsive
   ===================================================== */

body:has(#next-btn-2) { display: block; }            /* يلغي grid بتاع صفحة اللعبة */
.hero:has(#next-btn-2) { height: 100vh; height: 100dvh; }

/* ---------- تابلت + موبايل أفقي ---------- */
@media (max-width: 1024px) and (orientation: landscape),
       (max-height: 480px) and (orientation: landscape) {

  .hero > #next-btn-2 {
    right: 3.9vw;                 /* = 60 / 1536 زي الديسكتوب */
    bottom: 8%;
    width: 15%;                   /* نفس نسبة الديسكتوب */
    min-width: 90px;              /* حد أدنى للمس */
  }
}

/* ---------- تابلت طولي + موبايل ---------- */
@media (orientation: portrait) and (max-width: 1024px) {

  .hero > #next-btn-2 {
    right: 6vw;
    bottom: 5%;
    width: 34vw;
    max-width: 240px;
    min-width: 110px;
  }

  /* ظبطي النسبة دي عشان الجزء المهم من الخلفية يفضل ظاهر
     (0% يسار، 50% نص، 100% يمين) */
  .hero:has(#next-btn-2) .h { object-position: 60% center; }
}

/* ---------- شاشات اللمس: مفيش hover ---------- */
@media (hover: none) {
  .hero > #next-btn-2:hover {
    transform: none;
    filter: none;
    animation: mysticFloat 3s infinite ease-in-out; 
  }
}

.page-intro { --focus: 70% 50%; }
.page-wh    { --focus: 60% 50%; }
.page-gem   { --focus: 50% 50%; }

@media (orientation: portrait) and (max-width: 1024px) {
  .hero .h { object-position: var(--focus, center); }
}