/* Awwab — Knowledge game (/play). Immersive dark-emerald theme layered on the
   shared tokens in styles.css. Scoped under .game so it never affects other pages. */

.play-main { min-height: calc(100vh - 64px); background:
  radial-gradient(1000px 520px at 80% -10%, rgba(216,183,96,0.14), transparent 60%),
  linear-gradient(165deg, var(--emerald-900), var(--emerald-800) 60%, #0b2419);
  color: #f3efe6; }
.game { max-width: 760px; margin: 0 auto; padding: 28px 20px 80px; }

/* fade/slide between views */
.view { animation: gIn .45s cubic-bezier(.2,.7,.2,1) both; }
@keyframes gIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* Hub */
.g-head { text-align: center; margin-bottom: 22px; }
.g-head .eyebrow { justify-content: center; }
.g-head h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(30px, 6vw, 48px); margin: 6px 0; }
.g-sub { color: #c9d3c9; font-size: 15px; }
.g-name { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; color: var(--gold-bright); font-weight: 600; cursor: pointer; background: none; border: 0; font-size: 15px; }
.g-name svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.g-signin { display: inline-flex; align-items: center; gap: 8px; margin-top: 10px; cursor: pointer;
  background: rgba(216,183,96,0.12); border: 1px solid rgba(216,183,96,0.45); color: #f0e6c8;
  padding: 9px 16px; border-radius: 999px; font-size: 13.5px; font-weight: 600; font-family: var(--sans);
  transition: background .15s ease; }
.g-signin:hover { background: rgba(216,183,96,0.22); }
.g-signin svg { width: 16px; height: 16px; stroke: #d8b760; fill: none; stroke-width: 1.8; }

.g-daily { display: flex; align-items: center; gap: 16px; text-align: left; width: 100%;
  background: linear-gradient(135deg, rgba(216,183,96,0.16), rgba(216,183,96,0.05));
  border: 1px solid rgba(216,183,96,0.4); border-radius: 22px; padding: 22px 24px; cursor: pointer;
  color: inherit; transition: transform .15s ease, box-shadow .15s ease; }
.g-daily:hover { transform: translateY(-2px); box-shadow: 0 20px 50px -30px rgba(216,183,96,0.5); }
.g-daily .ring { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--gold); color: #20170a; }
.g-daily .ring svg { width: 26px; height: 26px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.g-daily h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 2px; font-weight: 600; }
.g-daily p { margin: 0; color: #cbd5cb; font-size: 14px; }
.g-daily .go { margin-left: auto; color: var(--gold-bright); font-size: 22px; }

.g-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.g-mode { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; text-align: left;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(237,224,191,0.18); border-radius: 18px;
  padding: 18px; cursor: pointer; color: inherit; transition: transform .15s ease, border-color .15s ease; }
.g-mode:hover { transform: translateY(-2px); border-color: rgba(216,183,96,0.5); }
.g-mode svg { width: 24px; height: 24px; stroke: var(--gold-bright); fill: none; stroke-width: 1.7; }
.g-mode b { font-size: 16px; }
.g-mode span { font-size: 13px; color: #b7c2b8; }

.g-sectlabel { text-transform: uppercase; letter-spacing: 1.4px; font-size: 12px; font-weight: 700;
  color: var(--gold-bright); margin: 28px 0 12px; }
.g-topics { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.g-topic { display: flex; align-items: center; gap: 12px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(237,224,191,0.16); border-radius: 14px; padding: 13px 15px; cursor: pointer;
  color: inherit; text-align: left; transition: border-color .15s ease, transform .15s ease; }
.g-topic:hover { border-color: rgba(216,183,96,0.45); transform: translateY(-1px); }
.g-topic .tdot { width: 34px; height: 34px; border-radius: 10px; background: rgba(216,183,96,0.16);
  display: grid; place-items: center; flex: none; }
.g-topic .tdot svg { width: 18px; height: 18px; stroke: var(--gold-bright); fill: none; stroke-width: 1.7; }
.g-topic b { font-size: 14px; display: block; }
.g-topic span { font-size: 12px; color: #aab6ab; }

/* Quiz runner */
.q-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.q-close { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,0.08);
  color: #f3efe6; cursor: pointer; font-size: 18px; line-height: 1; }
.q-count { font-size: 13px; font-weight: 600; color: #c9d3c9; }
.q-score { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--gold-bright); font-weight: 700; }
.q-score svg { width: 15px; height: 15px; fill: var(--gold-bright); }
.q-bar { height: 6px; border-radius: 99px; background: rgba(255,255,255,0.1); overflow: hidden; margin-bottom: 6px; }
.q-bar i { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s cubic-bezier(.2,.7,.2,1); }
.q-streak { text-align: right; font-size: 12px; font-weight: 700; color: var(--gold-bright); height: 16px; }
.q-prompt { font-family: var(--serif); font-size: clamp(20px, 3.4vw, 27px); line-height: 1.3; margin: 18px 0 18px; }
.q-template { font-size: 16px; color: #e7e2d4; margin-bottom: 14px; }

.q-opts { display: grid; gap: 10px; }
.q-tf { grid-template-columns: 1fr 1fr; }
.q-opt { text-align: left; width: 100%; border: 1.5px solid rgba(237,224,191,0.22); background: rgba(255,255,255,0.05);
  color: #f3efe6; padding: 15px 18px; border-radius: 14px; font-size: 16px; cursor: pointer; font-family: var(--sans);
  display: flex; align-items: center; gap: 10px; transition: background .15s ease, border-color .15s ease, transform .1s ease; }
.q-opt:hover:not(:disabled) { border-color: rgba(216,183,96,0.6); }
.q-opt:active:not(:disabled) { transform: scale(.99); }
.q-opt:disabled { cursor: default; }
.q-opt.correct { border-color: #7fd39a; background: rgba(127,211,154,0.16); color: #d8f3df; }
.q-opt.wrong { border-color: #e88; background: rgba(220,120,120,0.16); color: #f3d5d5; }
.q-opt.dim { opacity: .5; }
.q-opt .mark { margin-left: auto; }

/* match pairs */
.q-pairs { display: grid; gap: 10px; }
.q-prow { display: grid; grid-template-columns: 1fr 22px 1fr; align-items: center; gap: 8px; }
.q-left { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(237,224,191,0.22); background: rgba(255,255,255,0.05); cursor: pointer; font-size: 14px; transition: border-color .15s ease, background .15s ease; }
.q-left.sel { border-color: var(--gold-bright); background: rgba(216,183,96,0.16); }
.q-left.filled { border-color: rgba(216,183,96,0.3); }
.q-slot { padding: 12px 14px; border-radius: 12px; background: rgba(255,255,255,0.04); font-size: 14px; color: #cbd5cb; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.q-slot.filled { cursor: pointer; background: rgba(216,183,96,0.12); border: 1px solid rgba(216,183,96,0.34); color: #f0e6cf; }
.q-slot.filled > span:first-child { flex: 1; }
.q-slot-x { flex: none; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; color: #c9d3c9; background: rgba(255,255,255,0.08); transition: background .15s ease, color .15s ease; }
.q-slot.filled:hover .q-slot-x { background: rgba(220,120,120,0.3); color: #f3d5d5; }
.q-slot.await { border: 1px dashed rgba(216,183,96,0.55); color: var(--gold-bright); }
.q-slot.correct { background: rgba(127,211,154,0.16); color: #d8f3df; border-color: rgba(127,211,154,0.4); }
.q-slot.wrong { background: rgba(220,120,120,0.16); color: #f3d5d5; border-color: rgba(220,120,120,0.4); }
.q-arrow { text-align: center; color: #9fb0a4; }
.q-pool { display: grid; gap: 8px; margin-top: 12px; }
.q-pool-label { font-size: 12px; font-weight: 700; color: #b7c2b8; }
.q-chip { padding: 11px 14px; border-radius: 12px; border: 1px solid rgba(216,183,96,0.4); background: rgba(216,183,96,0.12); color: var(--gold-soft); cursor: pointer; font-size: 14px; text-align: left; transition: transform .1s ease, border-color .15s ease; }
.q-chip:hover { border-color: var(--gold-bright); }
.q-chip:active { transform: scale(.98); }
.q-match-submit { width: 100%; justify-content: center; border: 0; margin-top: 16px; cursor: pointer; }
.q-match-submit:disabled { opacity: .5; cursor: default; }
.q-match-submit.ready { animation: gIn .3s ease both; }

/* feedback */
.q-fb { margin-top: 16px; border-radius: 16px; padding: 16px 18px; border: 1px solid; animation: gIn .3s ease both; }
.q-fb.ok { background: rgba(127,211,154,0.1); border-color: rgba(127,211,154,0.4); }
.q-fb.no { background: rgba(220,120,120,0.1); border-color: rgba(220,120,120,0.4); }
.q-fb h4 { margin: 0 0 6px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.q-fb.ok h4 { color: #9fe0b1; } .q-fb.no h4 { color: #f0b8b4; }
.q-fb p { margin: 0 0 8px; font-size: 15px; color: #e7e2d4; line-height: 1.55; }
.q-src { font-size: 12px; color: #aeb8af; display: flex; gap: 6px; margin-top: 4px; }
.q-src a { color: var(--gold-bright); text-decoration: none; }
.q-next { margin-top: 14px; }
.q-next .btn { width: 100%; justify-content: center; border: 0; cursor: pointer; }

/* results */
.g-result { text-align: center; padding-top: 14px; }
.g-medal { width: 96px; height: 96px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, rgba(216,183,96,0.4), rgba(216,183,96,0.08)); }
.g-medal svg { width: 52px; height: 52px; stroke: var(--gold-bright); fill: none; stroke-width: 1.4; }
.g-result h2 { font-family: var(--serif); font-size: 34px; margin: 0 0 4px; }
.g-result .g-score { font-family: var(--serif); font-size: 60px; color: var(--gold-bright); line-height: 1; margin: 12px 0; }
.g-stats { display: flex; justify-content: center; gap: 30px; margin: 14px 0 6px; }
.g-stats div b { font-family: var(--serif); font-size: 26px; display: block; }
.g-stats div span { font-size: 12px; color: #b7c2b8; }
.g-rank { display: inline-block; margin: 14px 0; padding: 8px 18px; border-radius: 99px; background: rgba(216,183,96,0.14); border: 1px solid rgba(216,183,96,0.4); color: var(--gold-soft); font-weight: 600; }
.g-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }
.g-actions .btn { border: 0; cursor: pointer; }

/* leaderboard */
.lb-list { margin-top: 16px; display: grid; gap: 8px; }
.lb-row { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(237,224,191,0.14); border-radius: 12px; padding: 12px 14px; }
.lb-row.me { border-color: rgba(216,183,96,0.6); background: rgba(216,183,96,0.1); }
.lb-rank { font-family: var(--serif); font-size: 18px; color: var(--gold-bright); text-align: center; }
.lb-name { font-size: 15px; }
.lb-score { font-weight: 700; color: var(--gold-bright); }
.lb-empty { text-align: center; color: #aab6ab; padding: 30px; }

/* name modal */
.g-modal { position: fixed; inset: 0; background: rgba(6,16,11,0.7); backdrop-filter: blur(4px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.g-modal .box { background: #122a20; border: 1px solid rgba(216,183,96,0.3); border-radius: 20px; padding: 26px; width: 100%; max-width: 380px; }
.g-modal h3 { font-family: var(--serif); font-size: 22px; margin: 0 0 6px; }
.g-modal p { color: #c9d3c9; font-size: 14px; margin: 0 0 14px; }
.g-modal input { width: 100%; padding: 13px 16px; border-radius: 12px; border: 1px solid rgba(237,224,191,0.3); background: rgba(255,255,255,0.06); color: #f3efe6; font-size: 15px; margin-bottom: 14px; }
.g-modal .row { display: flex; gap: 10px; justify-content: flex-end; }
.g-modal .btn { border: 0; cursor: pointer; }

/* ad slots */
.g-ad { margin: 26px auto 8px; max-width: 760px; padding: 0 20px; min-height: 0; text-align: center; }
.g-ad-inline { margin: 30px auto 4px; max-width: 360px; min-height: 0; }
.g-ad-inline::before { content: "advertisement"; display: block; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: #7e8c80; margin-bottom: 6px; }
.g-ad ins { margin: 0 auto; }
/* desktop side rails — only on wide screens, never overlap the centered game */
.ad-rail { display: none; }
@media (min-width: 1200px) {
  .ad-rail { display: block; position: fixed; top: 88px; width: 160px; z-index: 4; }
  .ad-rail-left { left: 18px; }
  .ad-rail-right { right: 18px; }
}
@media (min-width: 1480px) {
  .ad-rail { width: 300px; }
  .ad-rail-left { left: 28px; }
  .ad-rail-right { right: 28px; }
}

/* confetti canvas */
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; }

.g-spin { width: 34px; height: 34px; border: 3px solid rgba(216,183,96,0.25); border-top-color: var(--gold-bright); border-radius: 50%; margin: 50px auto; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 560px) {
  .g-modes, .g-topics { grid-template-columns: 1fr; }
  .g-daily { padding: 18px; }
}
/* ===== per-question timer ===== */
.q-timer { height: 4px; border-radius: 99px; background: rgba(255,255,255,0.08); overflow: hidden; margin: 0 0 14px; }
.q-timer i { display: block; height: 100%; width: 100%; border-radius: 99px;
  background: linear-gradient(90deg, #7fd39a, var(--gold-bright)); transition: width .1s linear; }
.q-timer i.low { background: linear-gradient(90deg, #e8a05a, #d27572); animation: tpulse .5s ease-in-out infinite; }
@keyframes tpulse { 50% { opacity: .55; } }

/* ===== XP / level bar ===== */
.xp-wrap { max-width: 420px; margin: 0 auto 18px; }
.xp-link { display: block; width: 100%; background: none; border: 0; cursor: pointer; padding: 0; }
.xp-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.xp-lvl { font-weight: 700; color: var(--gold-bright); font-size: 14px; }
.xp-num { font-size: 12px; color: #9fb0a4; }
.xp-bar { height: 9px; border-radius: 99px; background: rgba(255,255,255,0.09); overflow: hidden; border: 1px solid rgba(216,183,96,0.18); }
.xp-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 14px -2px rgba(216,183,96,0.7); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.xp-gain { display: inline-block; margin: 2px 0 6px; color: #9fe0b1; font-weight: 700; font-size: 15px; animation: gIn .5s ease both; }
.levelup { display: inline-block; margin: 0 auto 14px; padding: 8px 20px; border-radius: 99px; font-weight: 800; letter-spacing: .3px;
  background: linear-gradient(135deg, rgba(216,183,96,0.95), #bd9740); color: #20170a;
  box-shadow: 0 14px 40px -16px rgba(216,183,96,0.9); animation: pop .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.g-result .g-medal { animation: pop .6s cubic-bezier(.2,1.4,.4,1) both; }

/* ===== mute toggle ===== */
.g-mute { position: absolute; right: 18px; top: 14px; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid rgba(237,224,191,0.2); background: rgba(255,255,255,0.05); color: #f3efe6; cursor: pointer;
  font-size: 16px; line-height: 1; z-index: 6; transition: border-color .15s ease, transform .1s ease; }
.g-mute:hover { border-color: rgba(216,183,96,0.5); }
.g-mute:active { transform: scale(.92); }
.game > .view > div { position: relative; }

/* ===== achievements ===== */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badge { text-align: center; padding: 16px 10px; border-radius: 16px; border: 1px solid rgba(216,183,96,0.35);
  background: linear-gradient(160deg, rgba(216,183,96,0.14), rgba(216,183,96,0.04)); transition: transform .15s ease; }
.badge:hover { transform: translateY(-2px); }
.badge .b-ic { font-size: 26px; display: block; margin-bottom: 6px; filter: drop-shadow(0 4px 10px rgba(216,183,96,0.4)); }
.badge b { font-size: 13px; display: block; }
.badge .b-desc { font-size: 11px; color: #aab6ab; display: block; margin-top: 2px; line-height: 1.3; }
.badge.locked { border-color: rgba(237,224,191,0.12); background: rgba(255,255,255,0.03); opacity: .55; }
.badge.locked .b-ic { filter: grayscale(1); opacity: .7; }

/* ===== topic mastery ===== */
.mastery { display: grid; gap: 10px; }
.m-row { display: grid; grid-template-columns: 1fr 90px 42px; align-items: center; gap: 10px; }
.m-name { font-size: 14px; }
.m-name span { color: #9fb0a4; font-size: 12px; margin-left: 6px; }
.m-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,0.09); overflow: hidden; }
.m-bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold); transition: width .8s cubic-bezier(.2,.7,.2,1); }
.m-pct { font-size: 13px; font-weight: 700; color: var(--gold-bright); text-align: right; }

/* ===== leaderboard toggle ===== */
.lb-toggle { display: flex; width: max-content; gap: 4px; padding: 4px; border-radius: 99px; background: rgba(255,255,255,0.06);
  border: 1px solid rgba(237,224,191,0.16); margin: 4px auto 12px; }
.lb-tab { border: 0; background: none; color: #c9d3c9; cursor: pointer; padding: 8px 20px; border-radius: 99px; font-size: 14px; font-weight: 600; }
.lb-tab.on { background: var(--gold); color: #20170a; }

/* ===== review answers ===== */
.review-list { display: grid; gap: 10px; }
.review-item { border-radius: 14px; padding: 14px 16px; border: 1px solid; }
.review-item.ok { background: rgba(127,211,154,0.08); border-color: rgba(127,211,154,0.32); }
.review-item.no { background: rgba(220,120,120,0.08); border-color: rgba(220,120,120,0.32); }
.review-q { font-size: 15px; line-height: 1.45; display: flex; gap: 8px; align-items: flex-start; }
.review-q .r-ix { font-weight: 800; }
.review-item.ok .r-ix { color: #9fe0b1; } .review-item.no .r-ix { color: #f0b8b4; }
.review-e { margin-top: 6px; font-size: 13.5px; color: #c4cfc4; line-height: 1.5; }

@media (max-width: 560px) { .badges { grid-template-columns: repeat(2, 1fr); } }

/* ===== Qur'an ayah player (single verse) ===== */
.ayah { margin-top: 14px; }
.ayah-toggle { display: flex; align-items: center; gap: 10px; width: 100%; cursor: pointer;
  background: rgba(216,183,96,0.1); border: 1px solid rgba(216,183,96,0.34); color: #f0e6cf;
  padding: 12px 14px; border-radius: 12px; font-size: 14.5px; font-weight: 600; font-family: var(--sans);
  transition: background .15s ease, border-color .15s ease; text-align: left; }
.ayah-toggle:hover { background: rgba(216,183,96,0.18); }
.ayah-toggle.open { border-color: rgba(216,183,96,0.6); background: rgba(216,183,96,0.16); }
.ayah-toggle svg { width: 18px; height: 18px; color: var(--gold-bright); flex: none; }
.ayah-toggle > span:nth-of-type(1) { flex: 1; }
.ayah-toggle .ayah-ref { flex: none; font-size: 12px; font-weight: 700; color: var(--gold-bright); }
.ayah-body { display: none; margin-top: 10px; padding: 18px 16px 14px; border-radius: 14px;
  background: rgba(0,0,0,0.2); border: 1px solid rgba(216,183,96,0.22); }
.ayah-body.show { display: block; animation: gIn .3s ease both; }
.ayah-ar { font-family: "Amiri Quran", "Amiri", "Scheherazade New", "Traditional Arabic", serif;
  font-size: 32px; line-height: 2.1; color: #f7f0dd; text-align: center; margin-bottom: 12px; }
.ayah-en { font-size: 15px; line-height: 1.6; color: #e0e7dd; text-align: center; font-style: italic; }
.ayah-meta { font-size: 11px; letter-spacing: 0.5px; color: #9fb0a4; text-align: center; margin: 12px 0; text-transform: uppercase; }
.ayah-reciter-row { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }
.ayah-reciter-row svg { width: 16px; height: 16px; color: var(--gold-bright); flex: none; }
.ayah-reciter { flex: 1; appearance: none; -webkit-appearance: none; cursor: pointer;
  background: rgba(255,255,255,0.06) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23d8b760' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><path d='M6 9l6 6 6-6'/></svg>") no-repeat right 12px center;
  border: 1px solid rgba(216,183,96,0.3); color: #f0e6cf; font-size: 13.5px; font-family: var(--sans);
  padding: 9px 32px 9px 12px; border-radius: 10px; }
.ayah-reciter:focus { outline: none; border-color: var(--gold-bright); }
.ayah-reciter option { background: #122a20; color: #f3efe6; }
.ayah-body audio { width: 100%; height: 40px; display: block; margin: 0 auto 12px; filter: saturate(.9); }
.ayah-link { display: inline-block; font-size: 13px; color: var(--gold-bright); text-decoration: none; text-align: center; width: 100%; }
.ayah-link:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  .view, .q-fb, .levelup, .g-result .g-medal, .xp-gain, .ayah-body.show { animation: none; }
  .q-timer i.low { animation: none; }
  #confetti { display: none; }
}
