/* Agent English — gaya misi neon (identiti asal inovasi), diskop dalam .ae sahaja.
   Saiz teks dalam em (Bhg 16A); tajuk besar ikut --fs-scale. */
.ae {
  --cyan:#00eaff; --blue:#1177ff; --green:#3cff9b; --red:#ff3e5f; --yellow:#ffd740;
  position: relative; overflow: hidden; color: #fff; border-radius: var(--radius, 14px);
  border: 1px solid rgba(0,234,255,.35);
  background: radial-gradient(circle at top,#123a68 0%,#06152a 36%,#01050c 100%);
  font-family: Arial, Helvetica, sans-serif;
}
.ae::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(rgba(0,234,255,.035) 1px,transparent 1px), linear-gradient(90deg,rgba(0,234,255,.035) 1px,transparent 1px);
  background-size: 35px 35px; animation: aeGrid 12s linear infinite;
}
@keyframes aeGrid { from { background-position: 0 0 } to { background-position: 35px 35px } }
.ae > * { position: relative; }
.ae .aei { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.2em; flex: 0 0 auto; }
.ae button { font: inherit; }

.ae-bar { min-height: 56px; padding: 10px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  background: rgba(0,8,22,.95); border-bottom: 1px solid rgba(0,234,255,.5); box-shadow: 0 0 25px rgba(0,234,255,.12); }
.ae-logo { font-size: calc(clamp(17px,3vw,26px) * var(--fs-scale,1)); font-weight: 900; letter-spacing: 2px; color: var(--cyan); text-shadow: 0 0 12px rgba(0,234,255,.7); }
.ae-logo span { color: #fff; }
.ae-stats { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ae-stat { padding: 7px 11px; border: 1px solid rgba(0,234,255,.4); border-radius: 8px; background: rgba(0,234,255,.07); font-size: .92em; font-weight: bold; display: inline-flex; align-items: center; gap: 5px; }
.ae-stat .aei { color: var(--red); fill: var(--red); }

.ae-isi { padding: 20px 16px 26px; }

/* START */
#startScreen { min-height: 60vh; display: flex; align-items: center; justify-content: center; }
.mission-card { width: min(760px,100%); padding: 34px 24px; text-align: center; border: 1px solid rgba(0,234,255,.6); border-radius: 22px;
  background: linear-gradient(145deg,rgba(7,32,61,.98),rgba(2,10,24,.98)); box-shadow: 0 0 40px rgba(0,234,255,.13), inset 0 0 35px rgba(0,234,255,.04);
  position: relative; overflow: hidden; }
.mission-card::before, .mission-card::after { content: ""; position: absolute; width: 65px; height: 65px; border-color: var(--cyan); }
.mission-card::before { left: 10px; top: 10px; border-left: 3px solid; border-top: 3px solid; }
.mission-card::after { right: 10px; bottom: 10px; border-right: 3px solid; border-bottom: 3px solid; }
.classified { color: var(--cyan); letter-spacing: 5px; font-size: .92em; margin-bottom: 12px; }
.big-title { margin: 0; font-size: calc(clamp(34px,7vw,72px) * var(--fs-scale,1)); font-weight: 900; line-height: 1; text-shadow: 0 0 18px rgba(0,234,255,.65); }
.big-title span { color: var(--cyan); }
.ae .intro { max-width: 600px; margin: 20px auto; color: #b6d7e9; line-height: 1.6; font-size: 1.2em; }
.guide { display: grid; grid-template-columns: repeat(2,1fr); gap: 12px; margin: 24px 0; }
.guide-box { padding: 16px; border-radius: 13px; border: 1px solid rgba(0,234,255,.3); background: rgba(0,234,255,.055); }
.guide-icon { color: var(--cyan); }
.guide-icon .aei { width: calc(40px * var(--fs-scale,1)); height: calc(40px * var(--fs-scale,1)); stroke-width: 1.6; }
.guide-title { font-weight: 900; color: var(--cyan); margin-top: 5px; }
.guide-small { margin-top: 6px; color: #a7bfd0; font-size: .92em; line-height: 1.45; }
.ae .primary { border: 0; border-radius: 9px; padding: 14px 30px; cursor: pointer; background: linear-gradient(90deg,#0787ff,#00eaff); color: #00131e;
  font-size: 1.12em; font-weight: 900; letter-spacing: 1px; box-shadow: 0 0 25px rgba(0,234,255,.38); transition: .2s; min-height: 44px; }
.ae .primary:hover { transform: translateY(-2px); box-shadow: 0 0 35px rgba(0,234,255,.6); }
.ae-kecil { margin-top: 15px; color: #8fb0c6; font-size: .82em; }

/* GAME */
#gameScreen { display: none; }
.progress-row { display: grid; grid-template-columns: 1fr auto; gap: 15px; align-items: center; margin-bottom: 15px; }
.progress-shell { height: 10px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(0,234,255,.2); overflow: hidden; }
#progressBar { width: 0; height: 100%; background: linear-gradient(90deg,#0878ff,#00eaff,#44ff9c); box-shadow: 0 0 12px rgba(0,234,255,.6); transition: .3s; }
#questionCounter { min-width: 110px; text-align: right; color: #c9f7ff; font-weight: bold; font-size: .92em; }
.game-grid { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 18px; }
.quiz-panel { min-height: 520px; position: relative; padding: 24px; border: 1px solid rgba(0,234,255,.42); border-radius: 18px;
  background: linear-gradient(145deg,rgba(5,25,49,.98),rgba(2,10,22,.98)); box-shadow: 0 0 30px rgba(0,0,0,.35), inset 0 0 35px rgba(0,234,255,.025); }
#topicLabel { display: inline-block; padding: 7px 12px; color: var(--cyan); background: rgba(0,234,255,.08); border: 1px solid rgba(0,234,255,.35); border-radius: 6px; font-size: .85em; font-weight: 900; letter-spacing: 1px; }
#questionText { min-height: 100px; margin: 20px 0 24px; display: flex; align-items: center; font-size: calc(clamp(21px,3.2vw,34px) * var(--fs-scale,1)); line-height: 1.35; color: #fff; overflow-wrap: anywhere; }
.answers { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.answer { position: relative; min-height: 96px; padding: 16px; border-radius: 13px; border: 2px solid rgba(0,174,255,.3);
  background: linear-gradient(145deg,rgba(0,106,190,.11),rgba(3,14,33,.92)); display: flex; align-items: center; cursor: pointer; transition: .14s; overflow: hidden; user-select: none; color: #fff; }
.answer:hover, .answer.targeted { border-color: var(--cyan); background: rgba(0,234,255,.13); box-shadow: 0 0 25px rgba(0,234,255,.3), inset 0 0 20px rgba(0,234,255,.07); transform: scale(1.015); }
.answer.targeted::after { content: "TARGET LOCK"; position: absolute; right: 8px; top: 7px; font-size: .64em; color: var(--cyan); font-weight: 900; letter-spacing: 1px; }
.answer.correct { border-color: var(--green); background: rgba(60,255,155,.13); box-shadow: 0 0 28px rgba(60,255,155,.28); }
.answer.wrong { border-color: var(--red); background: rgba(255,62,95,.13); animation: aeShake .3s; }
@keyframes aeShake { 25% { transform: translateX(-7px) } 50% { transform: translateX(7px) } 75% { transform: translateX(-4px) } }
.answer-letter { min-width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; margin-right: 14px; border: 1px solid var(--cyan); background: rgba(0,234,255,.08); color: var(--cyan); font-weight: 900; }
.answer-value { font-size: 1.35em; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
#feedback { display: none; margin-top: 18px; padding: 14px; border-radius: 7px; border-left: 4px solid var(--cyan); background: rgba(0,234,255,.07); line-height: 1.5; }
#feedback .aei { margin-right: 4px; }

/* CAMERA */
.camera-panel { height: max-content; padding: 14px; border-radius: 15px; border: 1px solid rgba(0,234,255,.4); background: rgba(1,9,22,.97); }
.camera-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: var(--cyan); font-size: .85em; font-weight: bold; letter-spacing: 1px; }
#cameraStatus { color: #ff647c; }
.camera-wrap { position: relative; width: 100%; aspect-ratio: 4/3; overflow: hidden; border-radius: 10px; background: #000; border: 1px solid rgba(0,234,255,.28); }
#webcam { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
#handCanvas { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); pointer-events: none; }
.scanner { position: absolute; height: 2px; left: 0; right: 0; background: var(--cyan); box-shadow: 0 0 12px var(--cyan); opacity: .7; animation: aeScan 2.3s linear infinite; pointer-events: none; }
@keyframes aeScan { from { top: 0 } to { top: 100% } }
#gestureState { min-height: 44px; margin-top: 11px; padding: 10px; border-radius: 8px; text-align: center; background: rgba(0,234,255,.07); font-size: .92em; font-weight: bold;
  display: flex; justify-content: center; align-items: center; gap: 6px; }
.ae-kamera-nota { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; background: rgba(255,215,64,.1); border: 1px solid rgba(255,215,64,.4); color: #ffe9a3; font-size: .88em; line-height: 1.5; }
.mini-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-top: 9px; }
.mini { padding: 10px 5px; text-align: center; border-radius: 7px; background: rgba(255,255,255,.035); border: 1px solid rgba(255,255,255,.08); }
.mini-num { font-size: 1.5em; font-weight: 900; color: var(--cyan); }
.mini-label { color: #8da7b8; font-size: .72em; margin-top: 3px; }
.ae .help { margin-top: 12px; color: #91aabd; font-size: .8em; line-height: 1.7; }
.ae .help .aei { color: var(--cyan); }

/* RESULT */
#resultScreen { display: none; min-height: 60vh; align-items: center; justify-content: center; }
.result-card { width: min(650px,100%); padding: 34px 22px; text-align: center; border: 1px solid var(--cyan); border-radius: 20px;
  background: linear-gradient(145deg,rgba(5,29,57,.98),rgba(2,9,20,.98)); box-shadow: 0 0 38px rgba(0,234,255,.18); }
#rankIcon { margin: 14px 0; color: var(--yellow); }
#rankIcon .aei { width: calc(82px * var(--fs-scale,1)); height: calc(82px * var(--fs-scale,1)); stroke-width: 1.4; filter: drop-shadow(0 0 14px rgba(255,215,64,.5)); }
#finalTitle { color: var(--cyan); font-size: 2.1em; margin: 0; }
#finalXP { font-size: calc(clamp(38px,8vw,55px) * var(--fs-scale,1)); font-weight: 900; margin-top: 8px; }
.results { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 22px 0; }
.result-box { padding: 14px 5px; border-radius: 8px; background: rgba(0,234,255,.055); border: 1px solid rgba(0,234,255,.22); }
.result-number { color: var(--cyan); font-size: 1.75em; font-weight: 900; }
.result-label { font-size: .72em; color: #8da8ba; margin-top: 4px; }
.ae-kaki { text-align: center; padding: 14px; font-size: .8em; color: #7d9bb0; border-top: 1px solid rgba(0,234,255,.15); }
.ae-kaki strong { color: #a3d6ea; }

/* CROSSHAIR & XP (fixed, di luar panel) */
#crosshair { display: none; position: fixed; z-index: 1000; width: 46px; height: 46px; transform: translate(-50%,-50%); pointer-events: none; border: 2px solid #00eaff; border-radius: 50%;
  box-shadow: 0 0 20px rgba(0,234,255,.9), inset 0 0 10px rgba(0,234,255,.25); transition: width .08s, height .08s, border-color .08s; }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: #00eaff; }
#crosshair::before { width: 62px; height: 2px; top: 20px; left: -10px; }
#crosshair::after { width: 2px; height: 62px; top: -10px; left: 20px; }
#crosshair.fire { width: 32px; height: 32px; border-color: #ffd740; box-shadow: 0 0 35px #ffd740; }
#xpBurst { position: fixed; left: 50%; top: 42%; opacity: 0; z-index: 1200; pointer-events: none; font-family: Arial, Helvetica, sans-serif;
  font-size: calc(44px * var(--fs-scale,1)); font-weight: 900; color: #3cff9b; text-shadow: 0 0 20px rgba(60,255,155,.9); }
#xpBurst.show { animation: aeXp .9s ease-out; }
@keyframes aeXp { 0% { opacity: 0; transform: translate(-50%,30px) scale(.4) } 30% { opacity: 1 } 100% { opacity: 0; transform: translate(-50%,-60px) scale(1.5) } }

@media (max-width: 1099px) {
  .game-grid { grid-template-columns: 1fr; }
  .camera-panel { order: -1; }
  .camera-wrap { max-height: 240px; aspect-ratio: auto; height: 240px; }
}
@media (max-width: 580px) {
  .answers { grid-template-columns: 1fr; }
  .quiz-panel { padding: 16px; min-height: auto; }
  .answer { min-height: 70px; }
  .ae-isi { padding: 14px 10px 20px; }
  .mission-card { padding: 28px 16px; }
  .guide-box { padding: 12px; }
  .ae-stats .ae-stat:nth-child(3) { display: none; } .ae-stats .iv-sp-btn [data-iv-skrin-lbl] { display: none; }
  .results { gap: 6px; }
  .result-card { padding: 26px 14px; }
  .camera-wrap { height: 200px; }
}
@media (prefers-reduced-motion: reduce) { .ae::before, .scanner { animation: none; } }
.ae-cuba { margin-top: 8px; display: inline-flex; border: 1px solid #ffd740; background: transparent; color: #ffd740; border-radius: 8px; padding: 6px 12px; font-weight: 700; cursor: pointer; min-height: 36px; }
#gameScreen, #resultScreen { scroll-margin-top: calc(var(--kepala-h, 62px) + 10px); }
html.embed #gameScreen, html.embed #resultScreen { scroll-margin-top: 8px; }
.ae.iv-skrin-penuh { --iv-sp-latar: #01050c; display: flex; flex-direction: column; }
