:root {
      --primary-color: #7c3aed;
      --primary-light: #a855f7;
      --secondary-color: #c084fc;
      --accent-color: #f59e0b;
      --text-light: #f5f3ff;
      --text-muted: #c4b5fd;
      --border-bright: rgba(168, 85, 247, 0.55);
      --bg-deep: #1a0a2e;
      --bg-mid: #22103a;
      --bg-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 45%, #c084fc 100%);
    }

    * { box-sizing: border-box; }

    html {
      height: 100%;
    }

    body {
      font-family: 'Cairo', sans-serif;
      background:
        radial-gradient(clamp(400px, 85vw, 1200px) clamp(280px, 50vh, 700px) at 85% -10%, rgba(168, 85, 247, 0.2), transparent 60%),
        radial-gradient(clamp(320px, 70vw, 1000px) clamp(240px, 45vh, 600px) at 0% 100%, rgba(245, 158, 11, 0.12), transparent 65%),
        linear-gradient(135deg, var(--bg-deep) 0%, var(--bg-mid) 45%, #2b0e46 100%);
      margin: 0;
      padding: clamp(10px, 2.5vw, 30px) clamp(12px, 3vw, 24px);
      padding-bottom: max(clamp(10px, 2.5vw, 30px), env(safe-area-inset-bottom, 0px));
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      min-height: 100vh;
      min-height: 100dvh;
      width: 100%;
      color: var(--text-light);
    }

    #particles-bg {
      position: fixed;
      inset: 0;
      z-index: 0;
      pointer-events: none;
    }


    .container {
      width: 100%;
      max-width: min(700px, calc(100vw - clamp(20px, 5vw, 48px)));
      background: linear-gradient(145deg, rgba(45, 26, 74, 0.88), rgba(34, 16, 58, 0.82));
      border-radius: clamp(14px, 2.2vw, 22px);
      box-shadow: 0 clamp(10px, 2.5vw, 18px) clamp(24px, 5vw, 44px) rgba(0,0,0,0.45), 0 0 30px rgba(124,58,237,0.18);
      padding: clamp(16px, 4vw, 32px) clamp(18px, 4.5vw, 42px);
      text-align: center;
      user-select: none;
      backdrop-filter: blur(12px);
      border: 1.5px solid var(--border-bright);
      position: relative;
      z-index: 1;
    }

    h2 {
      margin: 0 0 clamp(12px, 2.5vw, 22px);
      color: #fbbf24;
      font-size: clamp(1.2rem, 2.8vw + 0.55rem, 2em);
      line-height: 1.25;
      text-shadow: 0 2px 5px rgba(0,0,0,0.3);
    }

    .container p {
      font-size: clamp(1rem, 2.2vw + 0.55rem, 1.8em);
      color: var(--text-light);
      margin: 0 0 clamp(12px, 2.2vw, 20px);
      line-height: 1.55;
      user-select: text;
      padding: clamp(12px, 2.5vw, 22px);
      background: rgba(255, 255, 255, 0.08);
      border-radius: clamp(10px, 1.8vw, 16px);
      border-left: 4px solid var(--accent-color);
    }

    /* وسيط اختياري تحت نص الإجابة: questionAnswer (صورة / فيديو / صوت) أو صورة تلقائية من اسم الإجابة */
    .answer-media-slot {
      display: none;
      width: 100%;
      margin: 0 auto clamp(14px, 3vw, 28px);
    }

    .answer-media-slot .answer-image,
    .answer-media-slot .answer-question-video {
      max-width: 100%;
      max-height: min(300px, 38vh);
      width: auto;
      height: auto;
      border-radius: clamp(10px, 1.8vw, 16px);
      margin: 0 auto;
      border: clamp(2px, 0.35vw, 3px) solid var(--secondary-color);
      box-shadow: 0 clamp(4px, 1.2vw, 8px) clamp(12px, 3vw, 20px) rgba(0,0,0,0.4);
      display: block;
      object-fit: contain;
      background: #000;
    }

    .answer-media-slot .answer-image {
      cursor: pointer;
    }

    .answer-media-slot .answer-question-audio {
      width: 100%;
      max-width: min(420px, 100%);
      margin: 0 auto;
      display: block;
    }

    .image-lightbox {
      position: fixed;
      inset: 0;
      background: rgba(0, 0, 0, 0.84);
      z-index: 2000;
      display: none;
      align-items: center;
      justify-content: center;
      padding: clamp(12px, 2vw, 28px);
    }

    .image-lightbox.open {
      display: flex;
    }

    .image-lightbox-img {
      max-width: 96vw;
      max-height: 92vh;
      width: auto;
      height: auto;
      border-radius: 12px;
      border: 3px solid var(--primary-light);
      box-shadow: 0 0 30px rgba(0, 0, 0, 0.75);
      object-fit: contain;
      background: #fff;
    }

    .image-lightbox-img.country-upscaled {
      width: clamp(440px, 78vw, 1200px);
      max-width: 96vw;
      max-height: 92vh;
    }

    .image-lightbox-img.lightbox-large-upscaled {
      width: clamp(480px, 88vw, 1400px);
      max-width: 98vw;
      max-height: 94vh;
    }

    .buttons {
      display: flex;
      flex-direction: column;
      gap: clamp(12px, 2.5vw, 22px);
      width: 100%;
    }

    .buttons button {
      background: var(--bg-gradient);
      color: white;
      font-weight: bold;
      font-size: clamp(0.95rem, 1.8vw + 0.45rem, 1.3em);
      padding: clamp(11px, 2.2vw, 16px) clamp(18px, 4vw, 32px);
      border: none;
      border-radius: clamp(28px, 6vw, 40px);
      cursor: pointer;
      transition: all 0.3s ease;
      user-select: none;
      width: 100%;
      box-shadow: 0 6px 15px rgba(0,0,0,0.3);
      position: relative;
      overflow: hidden;
    }

    .buttons button:hover {
      transform: translateY(-5px);
      box-shadow: 0 10px 20px rgba(0,0,0,0.4);
    }

    .buttons button::after {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: linear-gradient(rgba(255,255,255,0.2), rgba(255,255,255,0));
      opacity: 0;
      transition: opacity 0.3s;
    }

    .buttons button:hover::after {
      opacity: 1;
    }

    #whoAnsweredBtn {
      background: linear-gradient(135deg, #27ae60 0%, #219955 100%);
    }

    #whoAnsweredBtn:hover {
      background: linear-gradient(135deg, #219955 0%, #1e8449 100%);
    }

    /* تأثيرات إضافية */
    @keyframes fadeIn {
      from { opacity: 0; transform: translateY(30px); }
      to { opacity: 1; transform: translateY(0); }
    }

    .container {
      animation: fadeIn 0.8s ease-out;
    }

    @media (max-height: 520px) {
      .answer-media-slot .answer-image,
      .answer-media-slot .answer-question-video {
        max-height: min(28vh, 200px);
      }
    }

    @media (max-width: 380px) {
      body {
        padding-left: max(8px, env(safe-area-inset-left, 0px));
        padding-right: max(8px, env(safe-area-inset-right, 0px));
      }
    }
