:root {
  --gold: #ffd35d;
  --gold-dark: #b7771f;
  --blue: #061d39;
  --blue-2: rgba(3, 20, 43, 0.92);
  --white: #fff8e8;
  --green: #28c76f;
  --red: #ff4d4d;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  min-height: 100%;
  background: #020916;
  font-family: "Cairo", Tahoma, Arial, sans-serif;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  overflow: auto;
}

/* 
  التصميم الأصلي Landscape بنسبة 1536 / 1024 = 3 / 2
  ممنوع نمده 100% طول وعرض عشان ميتضغطش على الموبايل
*/
.app {
  position: relative;
  width: min(100vw, 150dvh);
  aspect-ratio: 3 / 2;
  max-width: 1536px;
  max-height: 1024px;
  overflow: hidden;

  background-image: url("assets/badeel-bg.jpeg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  isolation: isolate;
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.55);
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background-image: url("assets/badeel-bg.jpeg");
  background-size: 100% 100%;
  background-position: center;
  background-repeat: no-repeat;
  isolation: isolate;
}

.night-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: rgba(0, 10, 35, 0.35);
  opacity: 0;
  transition: 0.25s;
}

.app.is-night .night-layer {
  opacity: 1;
}

.student-input {
  position: absolute;
  z-index: 8;
  direction: rtl;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--white);
  text-align: right;
  font-family: inherit;
  font-weight: 900;
  font-size: clamp(10px, 1.05vw, 18px);
  padding: 0 4.2% 0 1%;
  text-shadow: 0 2px 6px #000;
}

.student-input:focus {
  border-radius: 7px;
  background: rgba(3, 21, 42, 0.18);
  box-shadow:
    inset 0 0 0 2px rgba(255, 211, 93, 0.85),
    0 0 20px rgba(255, 211, 93, 0.3);
}

.name-input {
  left: 2.25%;
  top: 12.9%;
  width: 18.75%;
  height: 5.65%;
}

.class-input {
  left: 2.25%;
  top: 21.4%;
  width: 18.75%;
  height: 5.9%;
}

.seat-input {
  left: 2.25%;
  top: 30.5%;
  width: 18.75%;
  height: 5.8%;
}

.hotspot {
  position: absolute;
  z-index: 7;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: transparent;
  border-radius: 18px;
  transition: 0.15s ease;
}

.hotspot:hover,
.hotspot:focus-visible {
  outline: 0;
  background: rgba(255, 213, 93, 0.12);
  box-shadow:
    inset 0 0 0 2px rgba(255, 213, 93, 0.8),
    0 0 24px rgba(255, 213, 93, 0.34);
}

.hotspot:active {
  transform: scale(0.985);
}

.start-btn {
  left: 2.2%;
  top: 41.55%;
  width: 18.85%;
  height: 6.1%;
}

.exam {
  width: 17.25%;
  height: 6.3%;
}

.exam-1,
.exam-2,
.exam-3,
.exam-4,
.exam-5 {
  left: 28.45%;
}

.exam-6,
.exam-7,
.exam-8,
.exam-9,
.exam-10 {
  left: 48.35%;
}

.exam-1,
.exam-6 {
  top: 42.95%;
}

.exam-2,
.exam-7 {
  top: 50.58%;
}

.exam-3,
.exam-8 {
  top: 58.17%;
}

.exam-4,
.exam-9 {
  top: 65.82%;
}

.exam-5,
.exam-10 {
  top: 73.48%;
}

.exam.is-selected {
  background: rgba(255, 213, 93, 0.18);
  box-shadow:
    inset 0 0 0 3px rgba(255, 213, 93, 0.95),
    0 0 28px rgba(255, 213, 93, 0.38);
}

.random-btn {
  left: 33.25%;
  top: 81.65%;
  width: 26.55%;
  height: 8.95%;
  border-radius: 7px;
}

.side {
  left: 91.35%;
  width: 7.65%;
  height: 5.45%;
  border-radius: 12px;
}

.side-day {
  top: 51.1%;
}

.side-night {
  top: 57.25%;
}

.side-sound {
  top: 63.45%;
}

.side-help {
  top: 69.65%;
}

.side.is-active {
  background: rgba(255, 213, 93, 0.18);
  box-shadow:
    inset 0 0 0 2px rgba(255, 213, 93, 0.95),
    0 0 22px rgba(255, 213, 93, 0.35);
}

.settings-btn {
  left: 2.1%;
  top: 83.55%;
  width: 8.45%;
  height: 5.7%;
}

.bg-btn {
  left: 11.25%;
  top: 83.55%;
  width: 9.9%;
  height: 5.7%;
}

.stat {
  position: absolute;
  z-index: 8;
  left: 3.1%;
  width: 7%;
  color: var(--white);
  direction: ltr;
  text-align: left;
  font-weight: 900;
  font-size: clamp(10px, 1.15vw, 20px);
  line-height: 1;
  text-shadow: 0 3px 8px #000;
  pointer-events: none;
}

.stat-tests {
  top: 56.35%;
}

.stat-free {
  top: 64.2%;
}

.stat-high {
  top: 72.15%;
}

.stat-average {
  top: 79.85%;
}

.quiz-screen {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 32px);
  background:
    radial-gradient(circle at center, rgba(12, 40, 72, 0.35), rgba(0, 5, 18, 0.82)),
    rgba(0, 6, 20, 0.55);
  backdrop-filter: blur(5px);
}

.quiz-screen[hidden] {
  display: none;
}

.quiz-shell {
  width: min(980px, 96vw);
  max-height: 94dvh;
  overflow: auto;
  padding: clamp(14px, 2vw, 26px);
  border-radius: clamp(18px, 2vw, 30px);
  color: var(--white);
  background:
    linear-gradient(160deg, rgba(4, 24, 48, 0.97), rgba(2, 10, 27, 0.97));
  border: 1px solid rgba(255, 211, 93, 0.45);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.6),
    inset 0 0 36px rgba(255, 211, 93, 0.06);
}

.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.quiz-head {
  text-align: center;
}

.quiz-head h1 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(24px, 3vw, 42px);
  font-weight: 900;
}

.quiz-head p {
  margin: 4px 0 0;
  font-weight: 800;
  opacity: 0.9;
}

.back-home,
.quiz-progress {
  min-width: 90px;
  border-radius: 14px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 211, 93, 0.55);
  background: rgba(4, 22, 43, 0.85);
  color: var(--white);
  font-family: inherit;
  font-weight: 900;
}

.back-home {
  cursor: pointer;
}

.progress-bar {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  margin-bottom: 18px;
}

.progress-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #94621a, #ffe27a);
  transition: width 0.25s ease;
}

.question-card {
  padding: clamp(16px, 2vw, 28px);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.question-number {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 211, 93, 0.12);
  color: var(--gold);
  font-weight: 900;
}

.question-text {
  margin: 0 0 18px;
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.8;
  font-weight: 900;
}

.options-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.option-btn {
  min-height: 62px;
  border: 1px solid rgba(255, 211, 93, 0.35);
  border-radius: 18px;
  padding: 12px 16px;
  cursor: pointer;
  color: var(--white);
  background: rgba(1, 17, 38, 0.82);
  font-family: inherit;
  font-size: clamp(15px, 1.35vw, 20px);
  font-weight: 800;
  line-height: 1.6;
  text-align: right;
  transition: 0.15s;
}

.option-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.22);
}

.option-btn.correct {
  border-color: rgba(40, 199, 111, 0.9);
  background: rgba(40, 199, 111, 0.22);
}

.option-btn.wrong {
  border-color: rgba(255, 77, 77, 0.9);
  background: rgba(255, 77, 77, 0.2);
}

.option-btn:disabled {
  cursor: default;
  transform: none;
}

.feedback {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.feedback strong {
  display: block;
  margin-bottom: 6px;
  color: var(--gold);
  font-size: clamp(16px, 1.6vw, 22px);
}

.feedback p {
  margin: 0;
  line-height: 1.8;
  font-weight: 700;
}

.quiz-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}

.quiz-btn {
  min-width: 150px;
  border: 0;
  border-radius: 16px;
  padding: 12px 22px;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(15px, 1.4vw, 20px);
  font-weight: 900;
}

.quiz-btn.primary {
  color: #071b33;
  background: linear-gradient(#ffe69a, #c98b2b);
}

.quiz-btn.secondary {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.quiz-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.modal {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: none;
  place-items: center;
  padding: 22px;
  background: rgba(0, 7, 21, 0.58);
  backdrop-filter: blur(4px);
}

.modal.is-open {
  display: grid;
}

.modal-card {
  position: relative;
  width: min(520px, 92vw);
  padding: 32px 30px 28px;
  border-radius: 24px;
  color: var(--white);
  text-align: center;
  background: linear-gradient(160deg, rgba(5, 26, 50, 0.98), rgba(4, 13, 31, 0.98));
  border: 1px solid rgba(255, 211, 93, 0.45);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.55);
}

.modal-card h2 {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 900;
}

.modal-card p {
  margin: 0;
  font-size: clamp(15px, 1.7vw, 21px);
  line-height: 1.9;
  font-weight: 700;
  white-space: pre-line;
}

.modal-close {
  position: absolute;
  top: 10px;
  left: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modal-action {
  margin-top: 22px;
  min-width: 130px;
  border: 1px solid rgba(255, 211, 93, 0.6);
  border-radius: 14px;
  padding: 11px 22px;
  color: #071b33;
  background: linear-gradient(#ffe69a, #c98b2b);
  font-family: inherit;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

@media (max-width: 900px) and (orientation: portrait) {
  html,
  body {
    width: 100%;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #020916;
  }

  body {
    display: block;
  }

  .app {
    position: fixed;
    top: 50%;
    left: 50%;

    width: 100dvh;
    height: 66.6667dvh;

    max-width: none;
    max-height: none;
    aspect-ratio: auto;

    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;

    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;

    border-radius: 0;
    box-shadow: none;
  }

  .student-input {
    font-size: clamp(7px, 1.8dvh, 13px);
  }

  .stat {
    font-size: clamp(7px, 1.8dvh, 13px);
  }

  .quiz-screen {
    position: absolute;
    inset: 0;
    padding: 12px;
  }

  .quiz-shell {
    width: 94%;
    max-height: 92%;
  }

  .options-list {
    grid-template-columns: 1fr;
  }

  .quiz-top {
    align-items: stretch;
    flex-direction: column;
  }

  .back-home,
  .quiz-progress {
    width: 100%;
  }

  .quiz-actions {
    flex-direction: column-reverse;
  }

  .quiz-btn {
    width: 100%;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #020916;
  }

  body {
    display: grid;
    place-items: center;
  }

  .app {
    width: 100vw;
    height: 66.6667vw;
    max-height: 100dvh;
    max-width: 150dvh;
    aspect-ratio: 3 / 2;

    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
  }
}

.celebration-layer {
  position: absolute;
  inset: 0;
  z-index: 90;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 18px;
  border-radius: 4px;
  opacity: 0.95;
  animation: confettiFall var(--fall-time, 1.8s) linear forwards;
}

.firework-dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  animation: fireworkBoom 700ms ease-out forwards;
}

.correct-pop {
  position: absolute;
  left: 50%;
  top: 24%;
  transform: translate(-50%, -50%);
  padding: 12px 24px;
  border-radius: 999px;
  color: #071b33;
  background: linear-gradient(#fff2a8, #ffbf35);
  border: 2px solid rgba(255, 255, 255, 0.65);
  font-weight: 900;
  font-size: clamp(18px, 2vw, 34px);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
  animation: correctPop 950ms ease forwards;
}

@keyframes confettiFall {
  0% {
    transform: translateY(0) rotate(0deg);
  }

  100% {
    transform: translateY(110vh) rotate(720deg);
  }
}

@keyframes fireworkBoom {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(var(--x), var(--y)) scale(0.2);
    opacity: 0;
  }
}

@keyframes correctPop {
  0% {
    transform: translate(-50%, -50%) scale(0.6);
    opacity: 0;
  }

  18% {
    transform: translate(-50%, -50%) scale(1.12);
    opacity: 1;
  }

  70% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -70%) scale(0.95);
    opacity: 0;
  }
}


html,
body,
.app {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img,
button,
input,
textarea {
  -webkit-user-drag: none;
}

#protectionScreen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #fff8e8;
  background: rgba(0, 5, 18, 0.97);
  text-align: center;
  font-family: "Cairo", Tahoma, Arial, sans-serif;
}

#protectionScreen div {
  max-width: 520px;
  padding: 30px;
  border-radius: 24px;
  background: rgba(8, 35, 66, 0.95);
  border: 1px solid rgba(255, 211, 93, 0.45);
}

#protectionScreen h1 {
  margin: 0 0 12px;
  color: #ffd35d;
  font-size: 32px;
}

#protectionScreen p {
  margin: 0;
  font-size: 20px;
  font-weight: 800;
}
.option-btn.selected-correct {
  box-shadow:
    0 0 0 3px rgba(40, 199, 111, 0.35),
    0 12px 28px rgba(40, 199, 111, 0.18);

.option-btn {
  pointer-events: auto !important;
}

.option-btn.selected-answer {
  transform: translateY(-2px);
  box-shadow:
    0 0 0 3px rgba(255, 211, 93, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.22);
}

.option-btn.correct.selected-answer {
  border-color: rgba(40, 199, 111, 0.95);
  background: rgba(40, 199, 111, 0.28);
}

.option-btn.wrong.selected-answer {
  border-color: rgba(255, 77, 77, 0.95);
  background: rgba(255, 77, 77, 0.25);
}
