/* «دوّرها» — هوية «ليل البر»
   الأساس كحلي روّق والأزرار تركوازي، ولون اللعبة الخاص: ذهبي رملي + جمر برتقالي، والألغاز على ورق قديم.
   الخطوط: Rakkas للعناوين، Amiri للأبيات، IBM Plex Sans Arabic للنص. الأيقونات: Tabler Icons. */
:root {
  --night: #061620; --night2: #0B2636; --panel: rgba(17, 52, 71, .72); --panel2: rgba(24, 66, 88, .8); --line: rgba(233, 194, 122, .22);
  --ac: #3FD0C9; --ink: #04282E; --sand: #E9C27A; --sand2: #F6DFA8; --ember: #FF8A3D; --gold: #F2C14E;
  --tx: #EEF6F4; --mu: #A9C6CC; --good: #3FB68B; --bad: #FF8A7A;
  --paper: #F3E2BE; --paper2: #E7CF9E; --pink: #3A2810;
  --fT: Rakkas, 'IBM Plex Sans Arabic', sans-serif; --fV: Amiri, serif; --fB: 'IBM Plex Sans Arabic', Tajawal, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--tx); font-family: var(--fB); background: var(--night); }
body { min-height: 100vh; min-height: 100dvh; position: relative;
  background:
    radial-gradient(1px 1px at 12% 18%, #fff8 50%, transparent 51%), radial-gradient(1px 1px at 72% 12%, #fff9 50%, transparent 51%),
    radial-gradient(1.4px 1.4px at 38% 8%, #fff 50%, transparent 51%), radial-gradient(1px 1px at 88% 30%, #fff7 50%, transparent 51%),
    radial-gradient(1px 1px at 22% 36%, #fff6 50%, transparent 51%), radial-gradient(1.2px 1.2px at 56% 26%, #fffa 50%, transparent 51%),
    radial-gradient(1000px 460px at 50% 112%, rgba(255, 138, 61, .16), transparent 70%),
    linear-gradient(180deg, #04101A 0%, var(--night2) 60%, #10303F 100%);
  background-attachment: fixed; }
/* كثبان تحت الصفحة */
body::after { content: ''; position: fixed; inset: auto 0 0 0; height: 22vh; pointer-events: none; z-index: 0; opacity: .9;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 60' preserveAspectRatio='none'%3E%3Cpath d='M0 30 Q 90 6 190 26 T 400 18 V60 H0Z' fill='%2314303F'/%3E%3Cpath d='M0 46 Q 140 22 260 40 T 400 36 V60 H0Z' fill='%231B3B49'/%3E%3C/svg%3E") bottom/100% 100% no-repeat; }
#app { position: relative; z-index: 1; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.ti { line-height: 1; }
.dw-print { display: none; }

/* ---------- عام ---------- */
.dw { max-width: 1200px; margin: 0 auto; padding: 26px 26px 120px; }
.dw-logo { font-family: var(--fT); font-weight: 400; margin: 0; line-height: 1; color: var(--sand2);
  text-shadow: 0 2px 0 #7A4B12, 0 4px 0 #4A2C09, 0 10px 24px rgba(255, 138, 61, .35); letter-spacing: 0; }
.dw-logo .dot { color: var(--ember); }
.dw-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.dw-top .dw-logo { font-size: 58px; }
.dw-top a { color: var(--mu); text-decoration: none; font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.dw-h { font-family: var(--fT); font-weight: 400; font-size: 34px; margin: 0 0 6px; color: var(--tx); }
.dw-h .ti { color: var(--sand); font-size: .9em; vertical-align: -2px; margin-left: 6px; }
.dw-sub { color: var(--mu); margin: 0 0 18px; font-size: 17px; line-height: 1.7; }
.dw-card { background: var(--panel); border: 1px solid var(--line); border-radius: 22px; padding: 22px;
  backdrop-filter: blur(6px); box-shadow: 0 18px 40px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .05); }
.dw-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.dw-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 16px; padding: 14px 28px;
  font-weight: 700; font-size: 18px; background: linear-gradient(180deg, #62E3DC, var(--ac)); color: var(--ink);
  box-shadow: 0 5px 0 #1F8F8A, 0 12px 24px rgba(63, 208, 201, .25); transition: transform .12s, box-shadow .12s; }
.dw-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #1F8F8A; }
.dw-btn:disabled { opacity: .45; cursor: default; transform: none; }
.dw-btn.ghost { background: rgba(255, 255, 255, .04); color: var(--tx); box-shadow: inset 0 0 0 1.5px var(--line); }
.dw-btn.small { padding: 9px 16px; font-size: 15px; border-radius: 12px; }
.dw-btn.gold { background: linear-gradient(180deg, #FFD978, var(--gold)); color: #3A2600; box-shadow: 0 5px 0 #A8781A, 0 12px 24px rgba(242, 193, 78, .25); }
.dw-steps { display: flex; gap: 0; margin-bottom: 26px; align-items: center; }
.dw-steps span { display: inline-flex; align-items: center; gap: 8px; color: var(--mu); font-weight: 700; font-size: 15px; }
.dw-steps span b { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--line); font-size: 14px; }
.dw-steps span.on { color: var(--sand2); } .dw-steps span.on b { background: var(--sand); border-color: var(--sand); color: #3A2600; }
.dw-steps span.done b { background: rgba(233, 194, 122, .18); color: var(--sand); }
.dw-steps i.sep { width: 46px; height: 0; border-top: 2px dotted var(--line); margin: 0 10px; }
.dw-err { color: var(--bad); font-weight: 700; min-height: 1.4em; margin: 10px 0 0; }
.dw-input { background: rgba(0, 0, 0, .25); border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; width: 100%; }
.dw-input:focus { outline: none; border-color: var(--sand); }
label.dw-lab { display: flex; gap: 6px; align-items: center; color: var(--sand); font-weight: 700; font-size: 14px; margin: 0 0 8px; }

/* ---------- القوالب (بطاقات المشاهد) ---------- */
.dw-tpls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 26px; }
.dw-tpl { position: relative; padding: 0; border: 0; border-radius: 22px; overflow: hidden; text-align: right; background: #071a26;
  box-shadow: 0 0 0 1px var(--line), 0 16px 34px rgba(0, 0, 0, .35); transition: transform .2s, box-shadow .2s; }
.dw-tpl:hover { transform: translateY(-3px); }
.dw-tpl svg { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; }
.dw-tpl .cap { position: absolute; inset: auto 0 0 0; padding: 40px 18px 14px; display: flex; align-items: end; justify-content: space-between;
  background: linear-gradient(transparent, rgba(4, 14, 20, .92)); }
.dw-tpl b { font-family: var(--fT); font-weight: 400; font-size: 34px; color: #fff; line-height: 1; display: flex; gap: 10px; align-items: center; }
.dw-tpl b .ti { font-size: 26px; color: var(--sand); }
.dw-tpl small { color: var(--mu); font-weight: 700; font-size: 14px; }
.dw-tpl.on { box-shadow: 0 0 0 3px var(--sand), 0 0 40px rgba(233, 194, 122, .3); }
.dw-tpl .tick { position: absolute; top: 12px; left: 12px; width: 36px; height: 36px; border-radius: 50%; display: none;
  background: var(--sand); color: #3A2600; align-items: center; justify-content: center; font-size: 20px; }
.dw-tpl.on .tick { display: flex; }

.dw-grid2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.dw-chips { display: flex; flex-wrap: wrap; gap: 10px; }
.dw-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px 9px 16px; border-radius: 14px; font-weight: 700; font-size: 16px;
  border: 1.5px dashed rgba(169, 198, 204, .35); background: transparent; color: var(--mu); }
.dw-chip .ti { font-size: 20px; }
.dw-chip.on { border-style: solid; border-color: rgba(63, 208, 201, .55); background: rgba(63, 208, 201, .12); color: var(--tx); }
.dw-chip.on .ti { color: var(--ac); }
.dw-chip.tr { border-color: var(--gold); background: rgba(242, 193, 78, .14); color: var(--tx); }
.dw-chip.tr .ti { color: var(--gold); }
.dw-chip small { font-size: 12px; background: var(--gold); color: #3A2600; border-radius: 999px; padding: 1px 8px; }
.dw-seg { display: inline-flex; background: rgba(0, 0, 0, .25); border-radius: 14px; padding: 4px; gap: 4px; }
.dw-seg button { border: 0; background: transparent; padding: 8px 18px; font-weight: 700; font-size: 18px; border-radius: 10px; color: var(--mu); }
.dw-seg button.on { background: var(--sand); color: #3A2600; }
.dw-teams { display: grid; gap: 8px; margin-top: 12px; }
.dw-team-in { display: flex; gap: 10px; align-items: center; }
.dw-dot { width: 14px; height: 38px; border-radius: 6px; flex: none; background: var(--c); }
.dw-field { margin-bottom: 18px; }
.dw-add { margin-top: 18px; padding-top: 16px; border-top: 1.5px dashed var(--line); display: grid; gap: 8px; }

.dw-tip { color: var(--mu); font-size: 14px; line-height: 1.7; margin: 8px 0 0; }
.dw-tip b { color: #FFD49A; font-weight: 700; }

/* طريق كل فريق */
.dw-routes { display: grid; gap: 10px; }
.dw-route { display: grid; grid-template-columns: 150px 1fr; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 16px;
  background: rgba(0, 0, 0, .18); box-shadow: inset -6px 0 0 var(--c); }
.dw-route > b { font-family: var(--fT); font-weight: 400; font-size: 22px; color: var(--c); }
.dw-route .stops { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dw-route .stop { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 12px; background: rgba(255, 255, 255, .05); font-weight: 700; font-size: 15px; }
.dw-route .stop em { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; }
.dw-route .stop .ti { color: var(--sand); }
.dw-route .stop.shared { box-shadow: inset 0 0 0 1.5px rgba(233, 194, 122, .55); }
.dw-route .stop small { display: inline-flex; gap: 3px; align-items: center; font-size: 12px; color: var(--c); background: rgba(0, 0, 0, .3); padding: 1px 7px; border-radius: 99px; }
.dw-route .stop small .ti { color: inherit; }
.dw-route .stop.tr { color: var(--gold); } .dw-route .stop.tr .ti { color: var(--gold); }
.dw-route .arrow { color: rgba(169, 198, 204, .4); font-size: 14px; }

/* ترتيب الطرق باليد */
.dw-route.edit .stops { gap: 8px; }
.dw-route.edit .stop { padding: 4px 4px 4px 8px; gap: 4px; }
.dw-route.edit select { background: rgba(0, 0, 0, .3); border: 1.5px solid var(--line); border-radius: 10px; padding: 5px 8px; font-weight: 700; font-size: 15px; }
.dw-route.edit .mv { width: 28px; height: 28px; border: 0; border-radius: 8px; background: rgba(255, 255, 255, .06); color: var(--mu); display: grid; place-items: center; font-size: 16px; padding: 0; }
.dw-route.edit .mv:disabled { opacity: .25; cursor: default; }
.dw-route .stop.bad { box-shadow: inset 0 0 0 2px var(--bad); }
.dw-warn { display: flex; gap: 8px; align-items: flex-start; color: #FFD49A; background: rgba(255, 138, 61, .12); border-radius: 12px; padding: 10px 14px; margin: 0 0 12px; line-height: 1.7; font-weight: 700; }
.lvl0, .lvl1 { font-style: normal; font-size: 12px; padding: 1px 8px; border-radius: 99px; color: #fff; }
.lvl0 { background: #3FB68B; } .lvl1 { background: #E8605A; }
.dw-sub .lvl0, .dw-sub .lvl1 { font-size: 13px; }
.paper.off { opacity: .45; display: flex; align-items: center; justify-content: center; }
.dw-rv-item h4 label.spot2 { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--mu); font-weight: 700; margin-top: 4px; }
.dw-rv-item h4 label.spot2 input { background: rgba(0, 0, 0, .25); border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; font-size: 13px; color: var(--tx); font-weight: 500; }
.paper label.spot { display: flex; align-items: center; gap: 6px; margin-top: 8px; padding-top: 6px; border-top: 1px dashed rgba(58, 40, 16, .25); color: #8A6A3A; font-size: 13px; font-weight: 700; }
.paper label.spot input { flex: 1; font-family: var(--fB); font-size: 15px; text-align: right; color: #5A4428; }

/* مراجعة الألغاز: ورق قديم */
.dw-rv { display: grid; gap: 14px; }
.dw-rv-item { display: grid; grid-template-columns: 190px 1fr 1fr; gap: 14px; align-items: stretch; }
.dw-rv-item h4 { margin: 0; font-size: 20px; display: flex; flex-direction: column; gap: 6px; justify-content: center; }
.dw-rv-item h4 .ti { font-size: 34px; color: var(--sand); }
.dw-rv-item h4 small { color: #3A2600; background: var(--gold); border-radius: 999px; padding: 2px 10px; font-size: 13px; width: max-content; }
.paper { position: relative; background: radial-gradient(120% 90% at 30% 20%, #FBEFD2, var(--paper) 55%, var(--paper2)); color: var(--pink);
  border-radius: 6px; padding: 14px 16px; box-shadow: 0 10px 22px rgba(0, 0, 0, .3), inset 0 0 30px rgba(140, 90, 30, .18);
  clip-path: polygon(0 3%, 4% 0, 30% 2%, 55% 0, 80% 2%, 100% 0, 99% 30%, 100% 60%, 98% 100%, 70% 98%, 40% 100%, 12% 98%, 0 100%, 1% 60%); }
.paper p { margin: 0 0 6px; color: #8A6A3A; font-size: 13px; font-weight: 700; }
.paper input { width: 100%; border: 0; border-bottom: 1px dashed rgba(58, 40, 16, .3); background: transparent; color: var(--pink);
  font-family: var(--fV); font-weight: 700; font-size: 21px; text-align: center; padding: 4px; }
.paper input:focus { outline: none; border-bottom-color: var(--ember); }

/* ---------- قبل اللعب ---------- */
.dw-lobby { display: grid; grid-template-columns: 1fr 360px; gap: 24px; align-items: start; }
.dw-qrs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.dw-qr { position: relative; background: var(--panel2); border-radius: 22px; padding: 0 0 16px; text-align: center; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line), 0 16px 30px rgba(0, 0, 0, .3); }
.dw-qr .band { background: var(--c); color: #fff; padding: 12px 10px; font-family: var(--fT); font-size: 26px; line-height: 1.1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .25); margin-bottom: 14px; }
.dw-qr .q { background: #fff; padding: 10px; border-radius: 14px; display: inline-block; box-shadow: 0 0 0 4px var(--c); }
.dw-qr .q img, .dw-qr .q canvas { display: block; width: 168px; height: 168px; }
.dw-qr small { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; color: var(--mu); font-weight: 700; font-size: 15px; }
.dw-qr small.in { color: var(--good); }
.dw-rules { display: grid; gap: 14px; margin: 0 0 6px; padding: 0; list-style: none; }
.dw-rules li { display: flex; gap: 12px; font-size: 17px; line-height: 1.6; align-items: flex-start; }
.dw-rules li .ti { flex: none; width: 38px; height: 38px; border-radius: 12px; background: rgba(233, 194, 122, .14); color: var(--sand);
  display: flex; align-items: center; justify-content: center; font-size: 21px; }
.dw-boss { display: flex; gap: 14px; align-items: center; margin-top: 18px; padding: 12px; border-radius: 16px; background: rgba(0, 0, 0, .2); }
.dw-boss .q { background: #fff; padding: 6px; border-radius: 10px; }
.dw-boss .q img, .dw-boss .q canvas { display: block; width: 88px; height: 88px; }
.dw-boss b { display: flex; gap: 6px; align-items: center; }
.dw-note { color: #FFD49A; font-size: 14px; margin: 12px 0 0; line-height: 1.6; }
.dw-meter { height: 8px; border-radius: 4px; background: rgba(0, 0, 0, .3); overflow: hidden; margin: 6px 0 16px; }
.dw-meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--sand), var(--ember)); }

/* ---------- السباق ---------- */
.dw-race-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 26px; }
.dw-clock { font-family: var(--fT); font-size: 56px; color: var(--sand2); direction: ltr; display: flex; align-items: center; gap: 12px; }
.dw-clock .ti { font-size: 34px; color: var(--ember); }
.dw-lanes { display: grid; gap: 16px; }
.dw-lane { display: grid; grid-template-columns: 220px 1fr 110px; gap: 20px; align-items: center; background: var(--panel); border-radius: 24px;
  padding: 18px 22px; box-shadow: 0 0 0 1px var(--line); position: relative; overflow: hidden; }
.dw-lane::before { content: ''; position: absolute; inset: 0 0 0 auto; width: 8px; background: var(--c); }
.dw-lane b { font-family: var(--fT); font-weight: 400; font-size: 32px; color: var(--c); line-height: 1.1; display: block; }
.dw-lane .tag { display: inline-flex; gap: 6px; align-items: center; color: var(--mu); font-size: 15px; font-weight: 700; }
.dw-track { display: flex; align-items: center; }
.dw-track i.path { flex: 1; height: 0; border-top: 3px dotted rgba(169, 198, 204, .35); }
.dw-track i.path.done { border-top: 4px solid var(--c); }
.dw-track span { flex: none; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 19px; border: 2.5px solid rgba(169, 198, 204, .35); background: var(--night2); color: var(--mu); }
.dw-track span.done { background: var(--c); border-color: var(--c); color: #fff; font-size: 22px; }
.dw-track span.now { border-color: var(--c); color: var(--tx); box-shadow: 0 0 0 0 var(--c); animation: dwPulse 1.6s infinite; }
.dw-track span.tr { width: 62px; height: 62px; font-size: 30px; border-color: var(--gold); color: var(--gold); background: radial-gradient(circle, rgba(242, 193, 78, .25), var(--night2)); }
.dw-track span.tr.now { box-shadow: 0 0 30px rgba(242, 193, 78, .6); }
@keyframes dwPulse { 50% { box-shadow: 0 0 0 9px rgba(255, 255, 255, .07); } }
.dw-lane .tools { display: flex; gap: 8px; justify-content: flex-end; }
.dw-lane .tools button { width: 46px; height: 46px; border-radius: 14px; border: 0; background: rgba(255, 255, 255, .06); font-size: 22px; color: var(--mu); }
.dw-lane .tools button:hover { color: var(--sand); background: rgba(233, 194, 122, .14); }

/* لقطة الورقة على الشاشة: بولارويد */
.dw-flash { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(3, 12, 18, .86);
  backdrop-filter: blur(4px); animation: dwIn .35s ease-out; }
.dw-flash .box { text-align: center; }
.dw-flash .pola { display: inline-block; background: #FBF6EA; padding: 16px 16px 60px; border-radius: 6px; transform: rotate(-3deg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .55); position: relative; animation: dwDrop .6s cubic-bezier(.2, .9, .25, 1.2); }
.dw-flash .pola img { display: block; max-width: min(62vw, 700px); max-height: 56vh; }
.dw-flash .pola em { position: absolute; inset: auto 0 14px 0; font-style: normal; font-family: var(--fT); font-size: 32px; color: var(--c); }
.dw-flash .pola::before { content: ''; position: absolute; top: -14px; left: 50%; width: 110px; height: 30px; margin-left: -55px; background: rgba(233, 194, 122, .7); transform: rotate(2deg); }
.dw-flash h2 { font-family: var(--fT); font-weight: 400; font-size: 64px; margin: 26px 0 0; color: #fff; }
.dw-flash h2 span { color: var(--c); }
@keyframes dwIn { from { opacity: 0; } }
@keyframes dwDrop { from { transform: translateY(-60px) rotate(8deg) scale(.9); opacity: 0; } }

/* لحظة الكنز: شاشة سوداء وعنصر واحد كبير */
.dw-treasure { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: hidden; }
.dw-treasure::before { content: ''; position: absolute; width: 140vmax; height: 140vmax;
  background: repeating-conic-gradient(rgba(242, 193, 78, .1) 0 6deg, transparent 6deg 18deg); animation: dwSpin 40s linear infinite, dwFade 1.4s .6s both; }
.dw-treasure h1 { position: relative; font-family: var(--fT); font-weight: 400; font-size: min(34vw, 400px); line-height: 1; margin: 0; color: var(--gold);
  text-shadow: 0 6px 0 #8A5E00, 0 0 60px rgba(242, 193, 78, .6), 0 0 140px rgba(255, 138, 61, .4); animation: dwBoom 1.2s cubic-bezier(.2, .9, .2, 1.1); }
.dw-treasure p { position: relative; font-family: var(--fT); font-size: min(7vw, 76px); margin: 14px 0 0; color: var(--c); opacity: 0; animation: dwUp .8s 1.1s forwards; }
@keyframes dwBoom { from { transform: scale(.3); opacity: 0; filter: blur(12px); } }
@keyframes dwUp { from { transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes dwSpin { to { transform: rotate(360deg); } }
@keyframes dwFade { from { opacity: 0; } }

/* النتيجة */
.dw-win { text-align: center; margin-bottom: 26px; }
.dw-win .ti { font-size: 70px; color: var(--gold); filter: drop-shadow(0 0 20px rgba(242, 193, 78, .5)); }
.dw-win h2 { font-family: var(--fT); font-weight: 400; font-size: 54px; margin: 6px 0; }
.dw-win h2 span { color: var(--c); }
.dw-results { display: grid; gap: 12px; max-width: 760px; margin: 0 auto 24px; }
.dw-res { display: flex; align-items: center; gap: 16px; background: var(--panel); border-radius: 18px; padding: 14px 20px; box-shadow: 0 0 0 1px var(--line); font-size: 20px; font-weight: 700; }
.dw-res .n { font-family: var(--fT); font-size: 38px; width: 50px; text-align: center; color: var(--mu); }
.dw-res.first { box-shadow: 0 0 0 2px var(--gold), 0 0 30px rgba(242, 193, 78, .2); } .dw-res.first .n { color: var(--gold); }
.dw-res b { font-family: var(--fT); font-weight: 400; font-size: 28px; color: var(--c); flex: 1; }
.dw-res span { display: inline-flex; gap: 6px; align-items: center; }
.dw-album { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin-top: 22px; }
.dw-album div { background: #FBF6EA; padding: 7px 7px 22px; border-radius: 4px; box-shadow: 0 10px 20px rgba(0, 0, 0, .35); border-bottom: 5px solid var(--c); }
.dw-album div:nth-child(odd) { transform: rotate(-3deg); } .dw-album div:nth-child(even) { transform: rotate(2.5deg); }
.dw-album img { width: 120px; height: 120px; object-fit: cover; display: block; }

/* ---------- الجوال ---------- */
.ph { max-width: 520px; margin: 0 auto; padding: 16px 16px 120px; }
.ph-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-radius: 18px; background: var(--c); color: #fff; margin-bottom: 14px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.ph-head b { font-family: var(--fT); font-weight: 400; font-size: 28px; line-height: 1.1; text-shadow: 0 2px 0 rgba(0, 0, 0, .2); }
.ph-head span { font-family: var(--fT); font-size: 22px; opacity: .85; }
.ph-card { background: var(--panel); border-radius: 22px; padding: 18px; margin-bottom: 14px; box-shadow: 0 0 0 1px var(--line); }
.ph-kick { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--sand); font-weight: 700; font-size: 15px; text-align: center; margin: 0 0 12px; }
.ph-kick.gold { color: var(--gold); }
/* اللغز: ورقة قديمة بختم */
.ph-scroll { position: relative; margin: 6px 4px 18px; padding: 30px 20px 26px; }
.ph-scroll .paper { position: absolute; inset: 0; padding: 0; }
.ph-scroll .seal { position: absolute; top: -16px; left: 50%; margin-left: -26px; width: 52px; height: 52px; border-radius: 50%; z-index: 2;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .35), transparent 40%), var(--c); color: #fff;
  display: flex; align-items: center; justify-content: center; font-family: var(--fT); font-size: 24px; box-shadow: 0 4px 10px rgba(0, 0, 0, .35), inset 0 0 0 3px rgba(0, 0, 0, .12); }
.ph-scroll.gold .seal { background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .5), transparent 40%), var(--gold); color: #5A3A00; font-size: 26px; }
.ph-verse { position: relative; z-index: 1; font-family: var(--fV); font-weight: 700; font-size: 26px; line-height: 1.75; text-align: center; margin: 0; color: var(--pink); }
.ph-verse span { display: block; }
.ph-verse span + span::before { content: '❦'; display: block; font-size: 14px; color: #A97A3A; line-height: 1.4; }
.ph-hint { position: relative; z-index: 1; margin: 14px 0 0; padding: 10px 12px; border-radius: 12px; background: rgba(255, 138, 61, .14); color: #7A3E0A;
  font-weight: 700; text-align: center; display: flex; gap: 6px; align-items: center; justify-content: center; }
.ph-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; min-height: 110px; border-radius: 18px;
  border: 2px dashed rgba(233, 194, 122, .5); background: rgba(233, 194, 122, .06); font-weight: 700; font-size: 18px; margin-bottom: 12px; color: var(--sand2); }
.ph-photo .ti { font-size: 38px; color: var(--sand); }
.ph-photo img { max-height: 170px; max-width: 100%; border-radius: 12px; display: block; margin: 4px auto; }
.ph-word { width: 100%; padding: 12px; border-radius: 16px; border: 2px solid var(--line); background: rgba(0, 0, 0, .3); font-size: 38px; text-align: center;
  font-weight: 700; margin-bottom: 12px; font-family: var(--fB); letter-spacing: 14px; color: var(--sand2); }
.ph-word::placeholder { color: rgba(169, 198, 204, .45); letter-spacing: 10px; }
.ph-lab { display: block; text-align: center; color: var(--mu); font-weight: 700; font-size: 14px; margin: 0 0 6px; }
.ph-word:focus { outline: none; border-color: var(--sand); }
.ph .dw-btn { width: 100%; font-size: 20px; padding: 15px; }
.ph-msg { text-align: center; font-weight: 700; font-size: 17px; min-height: 1.5em; margin: 12px 0 0; line-height: 1.6; }
.ph-msg.bad { color: var(--bad); } .ph-msg.ok { color: var(--good); }
.ph-wait { margin-top: 10px; text-align: center; color: var(--mu); font-weight: 700; display: flex; gap: 6px; align-items: center; justify-content: center; }
.ph-big { text-align: center; padding: 34px 10px; }
.ph-big .ti { font-size: 80px; color: var(--sand); }
.ph-big h1 { font-family: var(--fT); font-weight: 400; font-size: 58px; margin: 6px 0; }
.ph-big p { font-size: 19px; color: var(--mu); line-height: 1.8; }
.ph-big.win .ti { color: var(--gold); filter: drop-shadow(0 0 24px rgba(242, 193, 78, .6)); }
.ph-prog { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; }
.ph-prog i { width: 30px; height: 8px; border-radius: 4px; background: rgba(169, 198, 204, .25); }
.ph-prog i.done { background: var(--c); }
.ph-prog i.tr { background: rgba(242, 193, 78, .35); width: 38px; }
.ph-tabs { display: flex; gap: 4px; margin-bottom: 14px; background: rgba(0, 0, 0, .25); padding: 4px; border-radius: 14px; }
.ph-tabs button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 10px; font-weight: 700; color: var(--mu); display: flex; gap: 6px; align-items: center; justify-content: center; }
.ph-tabs button.on { background: var(--sand); color: #3A2600; }
.ph-list { display: grid; gap: 8px; }
.ph-check { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--panel); box-shadow: inset -6px 0 0 var(--c); }
.ph-check input { width: 26px; height: 26px; flex: none; accent-color: var(--ac); }
.ph-check div { flex: 1; } .ph-check small { display: block; color: var(--mu); }
.ph-check.done { opacity: .5; }
.ph-place { display: flex; gap: 8px; align-items: center; font-family: var(--fT); font-size: 22px; margin: 16px 0 4px; color: var(--sand2); }
.ph-place .ti { color: var(--sand); }
.ph-shot { background: var(--panel); border-radius: 16px; padding: 10px; box-shadow: inset -6px 0 0 var(--c); }
.ph-shot img { width: 100%; border-radius: 10px; display: block; }
.ph-shot .row { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-weight: 700; gap: 8px; }
.ph-shot.rej { opacity: .45; }

/* ---------- الطباعة ---------- */
@media print {
  @page { size: A4; margin: 10mm; }
  html, body { background: #fff !important; color: #000; }
  body::after, #app, .dw-flash, .dw-treasure { display: none !important; }
  .dw-print { display: block !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.pr-sheet { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; page-break-after: always; }
.pr-card { height: 88mm; border-radius: 5mm; padding: 5mm 6mm; display: flex; flex-direction: column; justify-content: space-between; align-items: center;
  text-align: center; font-family: var(--fB); color: #3A2810; break-inside: avoid; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, #FFF7E4, #F3E2BE 60%, #E9D3A4); border: 1.2mm solid var(--c); }
.pr-card::after { content: ''; position: absolute; inset: 2.5mm; border: .4mm dashed rgba(58, 40, 16, .35); border-radius: 3mm; pointer-events: none; }
.pr-card .t { width: 100%; display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 13pt; }
.pr-card .t span { background: var(--c); color: #fff; padding: 1mm 4mm; border-radius: 99px; }
.pr-card .t em { font-style: normal; font-family: var(--fT); font-size: 18pt; color: #7A4B12; }
.pr-card .seal { width: 13mm; height: 13mm; border-radius: 50%; background: var(--c); color: #fff; display: flex; align-items: center; justify-content: center;
  font-family: var(--fT); font-size: 20pt; box-shadow: inset 0 0 0 1mm rgba(0, 0, 0, .12); }
.pr-card .w { font-family: var(--fB); font-weight: 700; font-size: 44pt; line-height: 1; color: #2A1C0A; direction: ltr; letter-spacing: 4mm;
  padding: 2mm 3mm 2mm 7mm; border-radius: 3mm; background: rgba(255, 255, 255, .45); box-shadow: inset 0 0 0 .5mm rgba(58, 40, 16, .25); }
.pr-card .k { font-size: 10pt; color: #6A5030; font-weight: 700; }
/* شعار روّق تحت الورقة */
.pr-card .brand { width: 100%; display: flex; align-items: center; gap: 2.5mm; padding-top: 2mm; border-top: .3mm dashed rgba(58, 40, 16, .3); font-size: 9.5pt; color: #5A4428; }
.pr-card .brand img { width: 11mm; height: 11mm; mix-blend-mode: multiply; border-radius: 2mm; }
.pr-card .brand span { flex: 1; text-align: right; } .pr-card .brand b { font-family: Lalezar, var(--fT); font-weight: 400; font-size: 16pt; color: #2F4A60; }
.pr-card .brand i { font-style: normal; font-weight: 700; color: #2F4A60; letter-spacing: .2mm; }
.pr-head { display: flex; align-items: center; gap: 4mm; margin-bottom: 4mm; }
.pr-head img { width: 14mm; height: 14mm; mix-blend-mode: multiply; }
.pr-head h2 { margin: 0 !important; }
.pr-card.tr { --c: #C99419; background: radial-gradient(circle, #FFF3C8, #F2D27A); }
.pr-card.tr .seal { font-size: 24pt; }
.pr-list { font-family: var(--fB); color: #102030; }
.pr-list h2 { font-family: var(--fT); font-weight: 400; font-size: 26pt; margin: 0 0 4mm; color: #7A4B12; }
.pr-list table { width: 100%; border-collapse: collapse; font-size: 12pt; }
.pr-list td, .pr-list th { border: 1px solid #c9b48a; padding: 2.4mm 3mm; text-align: right; }
.pr-list th { background: #F3E2BE; }
.pr-list .sw { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-left: 6px; }

@media (max-width: 900px) {
  .dw-grid2, .dw-lobby { grid-template-columns: 1fr; }
  .dw-rv-item { grid-template-columns: 1fr; }
  .dw-lane { grid-template-columns: 1fr; }
  .dw-tpls { grid-template-columns: 1fr; }
}

/* ٧ أو ٨ فرق: نفس السباق أصغر شوي عشان يطلع كله في شاشة وحدة */
.dw-lanes.many { gap: 10px; }
.dw-lanes.many .dw-lane { padding: 10px 18px; grid-template-columns: 190px 1fr 100px; border-radius: 18px; }
.dw-lanes.many .dw-lane b { font-size: 26px; }
.dw-lanes.many .dw-track span { width: 40px; height: 40px; font-size: 17px; }
.dw-lanes.many .dw-track span.tr { width: 52px; height: 52px; font-size: 26px; }
.dw-lanes.many .dw-lane .tools button { width: 40px; height: 40px; font-size: 19px; }

/* نسخة خاصة باسم المناسبة: الاسم كبير، و«لعبة دوّرها من روّق» تحته */
.dw-ev { display: flex; flex-direction: column; gap: 2px; }
.dw-ev small { display: inline-flex; align-items: center; gap: 6px; color: var(--mu); font-size: 15px; font-weight: 700; }
.dw-ev small b { color: var(--sand); }
.dw-ev small img { height: 18px; width: auto; }

/* «رجوع»: one step back inside the game, on every screen but the first (owner, 2026-12-05) */
.dw-home { position: fixed; top: 18px; left: 18px; z-index: 50; display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; background: rgba(11, 42, 60, .82); border: 1.5px solid rgba(63, 208, 201, .6);
  color: #E6F4F5; font: inherit; font-weight: 700; font-size: 17px; text-decoration: none; backdrop-filter: blur(6px); cursor: pointer; }
.dw-home[hidden] { display: none; }
.dw-home .ti { font-size: 20px; color: #3FD0C9; }
.dw-home:hover, .dw-home:focus-visible { background: #3FD0C9; color: #0B2A3C; outline: none; }
.dw-home:hover .ti, .dw-home:focus-visible .ti { color: #0B2A3C; }
@media print { .dw-home { display: none; } }
@media (max-width: 1560px) { .dw-race-top { padding-left: 150px; } }
