/* «وطن ولغة» — ثيم بيت الجدة القطري (قرار غسان 2026-11-27): جدار جص، وباب خشبي يفتح على كل سؤال،
   ومجلس بالسدو، وكل سؤال شيء من البيت (أيقونته في watan.js). والعنابي في التفاصيل وحدها.
   ⛔ لا علم مرسوم في الزينة: هو جواب السؤال الثاني. */
:root {
  --bg: #efe4cf; --paper: #fbf6ea; --ink: #3a2616; --ink-soft: #75604a; --line: #e0cfb0;
  --accent: #8a1538; --wood: #7b4a2a; --wood-2: #a5693d; --wood-3: #5a3218;
  --font-title: 'El Messiri', 'Tajawal', sans-serif;
}
body {
  background-color: var(--bg);
  /* جص: بقع خفيفة غير منتظمة */
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.55) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(160,120,70,.10) 0 2px, transparent 3px),
    radial-gradient(ellipse at 50% -10%, #f8f0de 0%, transparent 60%);
  background-size: 37px 41px, 53px 47px, 100% 100%;
}
/* شريط السدو أسفل الشاشة كحاشية المجلس */
.deco::after {
  content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 26px;
  background:
    conic-gradient(from -45deg at 50% 100%, #8a1538 90deg, transparent 0) 0 6px / 26px 13px repeat-x,
    conic-gradient(from 135deg at 50% 0, #f6ecd6 90deg, transparent 0) 13px 0 / 26px 13px repeat-x,
    linear-gradient(#1f140e, #1f140e);
  border-top: 4px solid #c9a46a;
  opacity: .95;
}
main { padding-bottom: 60px; }
.bar { background: linear-gradient(var(--wood-3), var(--wood)); color: #f8ecd8; border-bottom: 4px solid #c9a46a; }
.brand-dept { color: #e9cfa6; }
.timer, .icon-btn { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.25); color: #fff; }

/* البطاقة باب خشبي بقوس، وإطارها خشب */
.q-card, .start-card, .end-card, .note {
  border: 10px solid var(--wood);
  border-image: linear-gradient(160deg, var(--wood-2), var(--wood-3) 60%, var(--wood-2)) 1;
}
.start-card { border-radius: 0; position: relative; padding-top: 34px; }
.start-card::before {
  content: ''; position: absolute; top: -10px; inset-inline: -10px; height: 14px;
  background: repeating-linear-gradient(90deg, #8a1538 0 14px, #f6ecd6 14px 18px, #1f140e 18px 30px, #f6ecd6 30px 34px);
}
.start-card h1, .end-card h1 { color: var(--accent); }
.q-card { border-radius: 0; }
.note { border-radius: 0; border-color: var(--ok); border-image: none; border-width: 3px; }
.q-icon { color: var(--wood); background: #f3e6cb; border-radius: 50%; padding: 8px; box-shadow: inset 0 0 0 2px var(--line); }
.q-kicker { color: var(--wood); }
.q-text { color: var(--ink); }

/* باب بيت الجدة (engine.js: addDoor): مصراعان من خشب الساج بحشوات غائرة منقوشة، وصفا مسامير نحاسية، وحلقتا طرق،
   وشريط يغطي ملتقى المصراعين. يهتز المصراعان قليلاً كأن القفل انفك، ثم ينفتحان على مفصليهما بعمق ويظلمان كلما انفتحا. */
.question { perspective: 1600px; overflow: hidden; overflow: clip; padding: 10px; margin: -10px; }
.q-card { position: relative; }
.door { position: absolute; inset: 0; z-index: 4; display: flex; pointer-events: none; perspective: 1500px;
  background: radial-gradient(ellipse at 50% 50%, rgba(40, 20, 8, .0) 30%, rgba(30, 15, 5, .55) 100%);
  animation: door-room 1.25s ease-out both; }
.leaf { position: relative; width: 50%; height: 100%; transform-style: preserve-3d; backface-visibility: hidden;
  background:
    repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 7px, rgba(0,0,0,.06) 7px 8px, rgba(0,0,0,0) 8px 15px, rgba(255,230,190,.05) 15px 16px),
    repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 41px, rgba(0,0,0,.09) 41px 43px),
    linear-gradient(180deg, #8e5530, #6e3f20 55%, #5c3319);
  border: 4px solid #3f2311;
  box-shadow: inset 0 0 0 2px rgba(255, 210, 150, .12), inset 0 0 28px rgba(0, 0, 0, .45); }
.leaf-r { transform-origin: right center; animation: leaf-r 1.2s linear .05s both; }
.leaf-l { transform-origin: left center; animation: leaf-l 1.2s linear .05s both; }
/* الظل يزداد مع انفتاح المصراع */
.leaf::after { content: ''; position: absolute; inset: 0; background: #1a0d05; opacity: 0; animation: leaf-shade 1.2s ease-out .05s both; }
.panels { position: absolute; inset: 9% 13% 9% 13%; display: grid; grid-template-rows: 1fr 1.5fr 1fr; gap: 6%; }
.panel { display: block; border-radius: 3px;
  background:
    /* نقش معين محفور (شبكة مائلة) كنقوش الأبواب القديمة */
    repeating-linear-gradient(45deg, transparent 0 10px, rgba(0,0,0,.22) 10px 12px, rgba(255,215,160,.10) 12px 13px),
    repeating-linear-gradient(-45deg, transparent 0 10px, rgba(0,0,0,.22) 10px 12px, rgba(255,215,160,.10) 12px 13px),
    linear-gradient(180deg, #7a4626, #5e3319);
  box-shadow: inset 3px 3px 7px rgba(0,0,0,.55), inset -2px -2px 5px rgba(255, 215, 160, .18), 0 0 0 3px #4a2914, 0 0 0 5px rgba(255, 210, 150, .1); }
.panel-1 { border-radius: 50% 50% 3px 3px / 38% 38% 3px 3px; }
.studs { position: absolute; inset-inline: 10%; height: 12px;
  background: radial-gradient(circle at 50% 50%, #f3d690 0 2.5px, #a87b2e 3.5px, rgba(0,0,0,.35) 4.5px, transparent 5px) 0 0 / 20px 12px repeat-x; }
.studs-top { top: 3.5%; } .studs-bottom { bottom: 3.5%; }
.knocker { position: absolute; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%;
  border: 4px solid #c9a254; box-shadow: 0 2px 3px rgba(0,0,0,.5), inset 0 1px 2px rgba(255,255,255,.4); }
.knocker::before { content: ''; position: absolute; top: -12px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%;
  background: radial-gradient(circle, #f3d690, #8a6424); box-shadow: 0 1px 2px rgba(0,0,0,.5); }
.leaf-r .knocker { left: 6%; } .leaf-l .knocker { right: 6%; }
.astragal { position: absolute; top: 0; bottom: 0; left: 50%; width: 10px; margin-left: -5px;
  background: linear-gradient(90deg, #3f2311, #7b4a2a 45%, #3f2311); box-shadow: 0 0 6px rgba(0,0,0,.5);
  animation: astragal 1.2s linear .05s both; }
/* هزة القفل ثم دفعة تتباطأ كباب ثقيل */
@keyframes leaf-r { 0% { transform: rotateY(0); animation-timing-function: ease-in-out; } 9% { transform: rotateY(-3deg); animation-timing-function: ease-in-out; } 16% { transform: rotateY(-1deg); animation-timing-function: cubic-bezier(.3, .75, .35, 1); opacity: 1; } 88% { opacity: 1; } 100% { transform: rotateY(-106deg); opacity: 0; } }
@keyframes leaf-l { 0% { transform: rotateY(0); animation-timing-function: ease-in-out; } 9% { transform: rotateY(3deg); animation-timing-function: ease-in-out; } 16% { transform: rotateY(1deg); animation-timing-function: cubic-bezier(.3, .75, .35, 1); opacity: 1; } 88% { opacity: 1; } 100% { transform: rotateY(106deg); opacity: 0; } }
@keyframes leaf-shade { 0%, 16% { opacity: 0; } 70% { opacity: .55; } 100% { opacity: .7; } }
@keyframes astragal { 0%, 14% { opacity: 1; } 24%, 100% { opacity: 0; } }
@keyframes door-room { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.question.enter .q-card { animation: none; }

.opt, .chip, .tap-word { background: #fffdf7; }
.btn-primary { background: var(--accent); border-color: var(--accent); }
.dots i.now { background: var(--accent); }
.end-stats > div, .recap li { background: #f3e8d2; }
