:root {
  --bg: #170c2a; --bg2: #22123d; --panel: #2c1950; --panel2: #3a2266; --ink: #0c0617;
  --gold: #f6c544; --gold2: #ffdf7e; --red: #e8445f; --green: #2fc08f; --blue: #4aa8ff; --purple: #a46bff;
  --text: #fbf3ff; --muted: #bba7d8; --line: 3px solid var(--ink);
  --shadow: 0 4px 0 var(--ink); --r: 16px;
  --font: 'Readex Pro', 'Segoe UI', Tahoma, sans-serif; --display: 'Lalezar', 'Readex Pro', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
body { background: radial-gradient(120% 80% at 50% 0%, #3b1d66 0%, var(--bg) 60%) fixed; }
button { font-family: inherit; cursor: pointer; }
img { user-select: none; -webkit-user-drag: none; }
.hidden { display: none !important; }
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; overflow: hidden; }

/* أزرار بطابع لعبة */
.btn { border: var(--line); border-radius: 14px; background: var(--gold); color: var(--ink); font-family: var(--display); font-size: 20px;
  padding: 10px 18px; box-shadow: var(--shadow); transition: transform .08s, box-shadow .08s, filter .15s; line-height: 1.2; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }
.btn:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; }
.btn.red { background: var(--red); color: #fff; } .btn.green { background: var(--green); color: var(--ink); }
.btn.blue { background: var(--blue); color: var(--ink); } .btn.purple { background: var(--purple); color: #fff; }
.btn.ghost { background: var(--panel2); color: var(--text); }
.btn.big { font-size: 26px; padding: 14px 22px; width: 100%; }
.btn.sm { font-size: 16px; padding: 6px 12px; border-radius: 11px; }
.chip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel2); border: 2px solid var(--ink); border-radius: 999px; padding: 2px 9px; font-size: 13px; white-space: nowrap; }
input.field { width: 100%; font-family: inherit; font-size: 18px; padding: 12px 14px; border-radius: 14px; border: var(--line); background: #fff8e6; color: var(--ink); box-shadow: var(--shadow); text-align: center; }
input.field:focus { outline: 3px solid var(--gold); }

/* ---------- الرئيسية ---------- */
#home { align-items: center; overflow-y: auto; background: linear-gradient(180deg, rgba(23,12,42,.15), rgba(23,12,42,.55) 55%, var(--bg) 90%), url(/art/web/menu_bg.webp) center top / cover no-repeat fixed, var(--bg); }
.home-inner { width: min(440px, 100%); padding: 24px 16px 40px; display: flex; flex-direction: column; gap: 14px; align-items: stretch; margin: auto 0; }
.logo { text-align: center; margin-top: 10px; }
.logo img { width: 170px; height: 170px; object-fit: contain; filter: drop-shadow(0 8px 24px rgba(246,197,68,.35)); }
.logo h1 { font-family: var(--display); font-size: 84px; margin: -18px 0 0; color: var(--gold); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 0 6px 0 var(--ink); letter-spacing: 1px; }
.logo p { margin: 2px 0 0; color: var(--gold2); font-size: 16px; text-shadow: 0 2px 0 var(--ink); }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.card-panel { background: rgba(44,25,80,.92); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.label { font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; } .seg button { flex: 1; min-width: 44px; border: 2px solid var(--ink); background: var(--panel2); color: var(--text); border-radius: 10px; padding: 7px 4px; font-size: 15px; }
.seg button.on { background: var(--gold); color: var(--ink); font-weight: 700; }
.foot { text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- الغرفة ---------- */
#lobby { overflow-y: auto; align-items: center; }
.lobby-inner { width: min(520px, 100%); padding: 18px 16px 40px; display: flex; flex-direction: column; gap: 12px; }
.room-code { font-family: var(--display); font-size: 64px; letter-spacing: 10px; text-align: center; color: var(--gold); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; line-height: 1; direction: ltr; }
.qr { display: flex; justify-content: center; } .qr img, .qr svg { background: #fff; padding: 8px; border-radius: 12px; border: var(--line); width: 150px; height: 150px; }
.plist { display: flex; flex-direction: column; gap: 8px; }
.prow { display: flex; align-items: center; gap: 10px; background: var(--panel2); border: 2px solid var(--ink); border-radius: 12px; padding: 6px 10px; }
.prow img { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); }
.prow .n { flex: 1; font-weight: 700; } .prow .x { background: none; border: 0; color: var(--red); font-size: 20px; }

/* ---------- الطاولة ---------- */
#game { background: linear-gradient(rgba(23,12,42,.55), rgba(23,12,42,.8)), url(/art/web/table_bg.webp) center / cover; }
.topbar { display: flex; align-items: center; gap: 8px; padding: 8px 10px calc(6px) 10px; padding-top: max(8px, env(safe-area-inset-top)); background: rgba(12,6,23,.55); border-bottom: 2px solid var(--ink); z-index: 5; }
.topbar .ev { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; background: var(--panel); border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 13px; overflow: hidden; }
.topbar .ev img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); flex: none; }
.topbar .ev span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 38px; height: 38px; flex: none; border-radius: 12px; border: 2px solid var(--ink); background: var(--panel2); color: var(--text); font-size: 18px; box-shadow: 0 3px 0 var(--ink); display: grid; place-items: center; }

.opps { display: flex; gap: 8px; padding: 10px 10px 6px; overflow-x: auto; scrollbar-width: none; flex: none; }
.opps::-webkit-scrollbar { display: none; }
.opp { position: relative; flex: none; width: 92px; background: var(--panel); border: var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px 5px 6px; text-align: center; cursor: pointer; transition: transform .2s, box-shadow .2s; }
.opp.turn { border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold), 0 0 22px rgba(246,197,68,.6); }
.opp.targetable { animation: pulse 1s infinite; border-color: var(--red); }
.opp.dim { opacity: .45; }
.opp .av { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: top; border: 3px solid var(--ink); background: var(--panel2); display: block; margin: 0 auto; }
.opp .nm { font-size: 12px; font-weight: 700; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opp .cr { font-family: var(--display); font-size: 20px; color: var(--gold); line-height: 1; margin-top: 2px; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.bar { height: 6px; background: var(--ink); border-radius: 9px; overflow: hidden; margin: 3px 2px; } .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 9px; transition: width .5s; }
.opp .meta { display: flex; justify-content: center; gap: 4px; font-size: 11px; color: var(--muted); }
.badges { position: absolute; top: -6px; left: -6px; display: flex; gap: 2px; }
.badge { background: var(--ink); border-radius: 999px; padding: 1px 5px; font-size: 12px; }
.bubble { position: fixed; z-index: 60; background: #fff; color: var(--ink); border: var(--line); border-radius: 14px; padding: 6px 10px; font-size: 14px; font-weight: 700; max-width: 200px; box-shadow: var(--shadow); pointer-events: none; }
.bubble::after { content: ''; position: absolute; top: -10px; right: 20px; border: 8px solid transparent; border-bottom-color: var(--ink); }

.stage { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; justify-content: flex-end; padding: 4px 12px; gap: 6px; overflow: hidden; }
.feed { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.feed .ln { background: rgba(12,6,23,.72); border: 2px solid rgba(255,255,255,.08); border-radius: 12px; padding: 5px 12px; font-size: 14px; text-align: center; max-width: 100%; }
.feed .ln.secret { border-color: var(--purple); background: rgba(70,30,120,.85); }
.feed .ln.old { opacity: .45; font-size: 12px; }

.pending { background: rgba(44,25,80,.96); border: var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 10px; display: flex; gap: 10px; align-items: center; }
.pending .art { width: 64px; height: 84px; border-radius: 10px; object-fit: cover; border: 2px solid var(--ink); flex: none; }
.pending .body { flex: 1; min-width: 0; }
.pending .what { font-weight: 700; font-size: 15px; } .pending .sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pending .acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .pending .acts .btn { font-size: 17px; padding: 6px 12px; flex: 1; }
.timer { height: 6px; background: var(--ink); border-radius: 9px; overflow: hidden; margin-top: 6px; } .timer i { display: block; height: 100%; background: var(--red); }

.me { background: rgba(12,6,23,.65); border-top: 2px solid var(--ink); padding: 8px 10px 4px; display: flex; flex-direction: column; gap: 6px; flex: none; }
.me.turn { box-shadow: 0 -3px 0 var(--gold), 0 -10px 30px rgba(246,197,68,.25); }
.me-row { display: flex; align-items: center; gap: 8px; }
.mychar { width: 52px; height: 70px; border-radius: 9px; border: 3px solid var(--ink); object-fit: cover; object-position: top; flex: none; cursor: pointer; box-shadow: 0 3px 0 var(--ink); }
.myinfo { flex: 1; min-width: 0; }
.myinfo .t { display: flex; align-items: baseline; gap: 6px; } .myinfo .cr { font-family: var(--display); font-size: 26px; color: var(--gold); -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; line-height: 1; }
.vault { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; min-height: 34px; align-items: center; padding: 2px 0; }
.tk { flex: none; display: inline-flex; align-items: center; gap: 2px; background: linear-gradient(#ffe48a, #f0b42a); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px; padding: 2px 6px; font-weight: 800; font-size: 13px; box-shadow: 0 2px 0 var(--ink); }
.tk img { width: 20px; height: 20px; border-radius: 5px; object-fit: cover; }
.tk.stone { background: linear-gradient(#ff8a9b, #c2244a); color: #fff; } .tk.pick { cursor: pointer; } .tk.sel { outline: 3px solid var(--red); }
.gd { flex: none; width: 26px; height: 32px; border-radius: 6px; border: 2px solid var(--ink); background: url(/art/web/guard_back.webp) center / cover, #2f5b3e; display: grid; place-items: center; font-size: 13px; box-shadow: 0 2px 0 var(--ink); }
.actions { display: flex; gap: 6px; } .actions .btn { font-size: 17px; padding: 7px 12px; }
.moves { display: flex; gap: 3px; } .moves i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--gold); } .moves i.used { background: var(--panel2); }

.hand { display: flex; gap: 0; padding: 4px 8px calc(10px + env(safe-area-inset-bottom)); overflow-x: auto; scrollbar-width: none; flex: none; min-height: 140px; align-items: flex-end; }
.hand::-webkit-scrollbar { display: none; }
.hand .card { margin-inline-start: var(--ov, -14px); transition: transform .15s; } .hand .card:first-child { margin-inline-start: 0; }
.hand .card:hover, .hand .card.sel { transform: translateY(-12px); z-index: 2; }
.hand .card.playable { box-shadow: 0 0 0 2px var(--gold), var(--shadow); }

/* الكرت */
.card { position: relative; flex: none; width: 92px; height: 130px; border-radius: 11px; border: var(--line); background: #fff4dc; box-shadow: var(--shadow); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; color: var(--ink); }
.card .ci { height: 64%; background: #3a2266 center / cover; position: relative; display: grid; place-items: center; font-size: 34px; }
.card .ci img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .cn { flex: 1; display: grid; place-items: center; text-align: center; font-family: var(--display); font-size: 15px; line-height: 1.05; padding: 2px 3px; border-top: 2px solid var(--ink); }
.card .val { position: absolute; top: 3px; right: 3px; z-index: 2; background: var(--gold); border: 2px solid var(--ink); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; font-family: var(--display); font-size: 16px; }
.card .ty { position: absolute; top: 3px; left: 3px; z-index: 2; background: rgba(12,6,23,.85); color: #fff; border-radius: 999px; font-size: 10px; padding: 1px 6px; }
.card.treasure { background: #ffe9a8; } .card.treasure .cn { background: linear-gradient(#ffe48a, #f0b42a); }
.card.action .cn { background: #ffd3d9; } .card.guard .cn { background: #c9f2dd; } .card.reaction .cn { background: #cfe6ff; }
.card.sig .cn { background: #e6d4ff; } .card.sig { border-color: #5b2aa6; }
.card.lg { width: 230px; height: 330px; border-radius: 18px; } .card.lg .cn { font-size: 26px; } .card.lg .val { width: 40px; height: 40px; font-size: 24px; } .card.lg .ty { font-size: 13px; padding: 2px 9px; }
.card.md { width: 120px; height: 170px; } .card.md .cn { font-size: 18px; }

/* نوافذ */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(8,4,16,.78); display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px); }
.sheet { width: min(560px, 100%); max-height: 88vh; overflow-y: auto; background: var(--panel); border: var(--line); border-radius: 20px; box-shadow: 0 6px 0 var(--ink); padding: 16px; position: relative; }
.sheet h2 { font-family: var(--display); font-weight: 400; margin: 0 0 8px; color: var(--gold); font-size: 30px; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.sheet .close { position: absolute; top: 10px; left: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.charopt { background: var(--panel2); border: var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; cursor: pointer; display: flex; gap: 8px; align-items: flex-start; text-align: start; color: var(--text); }
.charopt img { width: 54px; height: 72px; border-radius: 8px; object-fit: cover; object-position: top; border: 2px solid var(--ink); flex: none; }
.charopt b { font-family: var(--display); font-weight: 400; font-size: 19px; color: var(--gold); display: block; }
.charopt small { font-size: 12px; color: var(--muted); line-height: 1.4; }
.charopt.mine { border-color: var(--green); } .charopt.off { opacity: .4; pointer-events: none; }
.tag-true { background: var(--green); color: var(--ink); border-radius: 999px; font-size: 11px; padding: 1px 7px; font-weight: 700; }
.pickrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.center { text-align: center; } .muted { color: var(--muted); } .mt { margin-top: 12px; }

/* إعلانات كبيرة */
.fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.stamp { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-family: var(--display); font-size: clamp(34px, 12vw, 96px); max-width: 94vw; line-height: 1.15; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 0 7px 0 var(--ink); text-align: center; }
.stamp small { display: block; font-size: 22px; -webkit-text-stroke: 2px var(--ink); color: var(--gold2); margin-top: 4px; white-space: normal; }
.stamp.red { color: var(--red); } .stamp.gold { color: var(--gold); } .stamp.green { color: var(--green); } .stamp.blue { color: var(--blue); }
.stamp img { display: block; margin: 0 auto 6px; width: 120px; height: 160px; object-fit: cover; border-radius: 14px; border: 4px solid var(--ink); box-shadow: 0 6px 0 var(--ink); }
.banner { position: absolute; left: 0; right: 0; top: 26%; background: linear-gradient(90deg, transparent, rgba(44,25,80,.97) 12%, rgba(44,25,80,.97) 88%, transparent); border-block: 3px solid var(--gold); padding: 14px 20px; display: flex; gap: 14px; align-items: center; justify-content: center; }
.banner img { width: 150px; height: 100px; object-fit: cover; border-radius: 12px; border: 3px solid var(--ink); }
.banner b { font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--gold); display: block; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.banner span { font-size: 15px; }
.flyer { position: fixed; z-index: 75; pointer-events: none; }
.shake { animation: shake .45s; }
.flash-red { animation: flashred .6s; }
@keyframes shake { 0%,100% { transform: translate(0) } 20% { transform: translate(-8px, 3px) } 40% { transform: translate(7px, -3px) } 60% { transform: translate(-5px, 2px) } 80% { transform: translate(4px, -1px) } }
@keyframes pulse { 0%,100% { transform: scale(1) } 50% { transform: scale(1.06) } }
@keyframes flashred { 0% { box-shadow: inset 0 0 0 0 rgba(232,68,95,0) } 30% { box-shadow: inset 0 0 120px 40px rgba(232,68,95,.7) } 100% { box-shadow: inset 0 0 0 0 rgba(232,68,95,0) } }
.toast { position: fixed; bottom: 180px; left: 50%; transform: translateX(-50%); z-index: 80; background: var(--red); color: #fff; border: var(--line); border-radius: 12px; padding: 8px 14px; font-weight: 700; box-shadow: var(--shadow); max-width: 90vw; text-align: center; }
.target-hint { position: fixed; top: 46%; left: 50%; transform: translateX(-50%); z-index: 45; background: var(--red); color: #fff; border: var(--line); border-radius: 999px; padding: 6px 16px; font-weight: 700; box-shadow: var(--shadow); display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.target-hint button { background: var(--ink); color: #fff; border: 0; border-radius: 999px; padding: 2px 10px; }

/* النهاية */
.end h1 { font-family: var(--display); font-weight: 400; font-size: 48px; text-align: center; color: var(--gold); margin: 0; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin-top: 10px; }
.title-card { background: var(--panel2); border: var(--line); border-radius: 14px; padding: 8px; text-align: center; box-shadow: var(--shadow); }
.title-card b { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 19px; display: block; }
.title-card img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: top; border: 2px solid var(--ink); }
.reveal-list { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.reveal-list .prow { font-size: 14px; }

/* التعليمات */
#rules { overflow-y: auto; }
.rules-inner { width: min(860px, 100%); margin: 0 auto; padding: 0 16px 60px; }
.rules-top { position: sticky; top: 0; z-index: 3; background: rgba(23,12,42,.95); backdrop-filter: blur(6px); padding: 10px 0 8px; display: flex; flex-direction: column; gap: 8px; border-bottom: 2px solid var(--ink); }
.rules-top .row { align-items: center; }
.tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; border: 2px solid var(--ink); background: var(--panel2); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 14px; }
.tabs button.on { background: var(--gold); color: var(--ink); font-weight: 700; }
.rsec { margin-top: 18px; }
.rsec h2 { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 32px; margin: 0 0 6px; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.rsec h3 { font-family: var(--display); font-weight: 400; font-size: 22px; margin: 14px 0 4px; color: var(--gold2); }
.rsec p, .rsec li { line-height: 1.9; font-size: 16px; } .rsec ol, .rsec ul { padding-inline-start: 22px; }
.note { background: var(--panel); border: 2px solid var(--ink); border-inline-start: 6px solid var(--gold); border-radius: 12px; padding: 10px 12px; margin: 10px 0; }
.ex { background: rgba(47,192,143,.12); border-inline-start-color: var(--green); }
.char-row { display: flex; gap: 12px; background: var(--panel); border: var(--line); border-radius: 16px; padding: 10px; margin-bottom: 10px; box-shadow: var(--shadow); }
.char-row > img { width: 96px; height: 130px; object-fit: cover; object-position: top; border-radius: 12px; border: 3px solid var(--ink); flex: none; }
.char-row h4 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--gold); } .char-row .sigs { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.mini { display: flex; gap: 6px; align-items: center; background: var(--panel2); border-radius: 10px; padding: 4px 8px 4px 4px; font-size: 13px; border: 2px solid var(--ink); }
.mini img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; }
.gal { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.gal .it { display: flex; gap: 10px; background: var(--panel); border: 2px solid var(--ink); border-radius: 14px; padding: 8px; align-items: center; }
.gal .it img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; border: 2px solid var(--ink); flex: none; }
.gal .it b { display: block; } .gal .it small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.gal .it .cnt { font-size: 12px; color: var(--gold2); }

/* شاشات عريضة */
@media (min-width: 900px) {
  #game { display: grid; grid-template-columns: 1fr 320px; grid-template-rows: auto auto 1fr auto auto; }
  #game .topbar { grid-column: 1 / -1; }
  #game .opps { grid-column: 1; flex-wrap: wrap; justify-content: center; overflow: visible; padding: 14px; }
  #game .opp { width: 118px; } #game .opp .av { width: 72px; height: 72px; }
  #game .stage { grid-column: 1; grid-row: 3; }
  #game .me { grid-column: 1; grid-row: 4; } #game .hand { grid-column: 1; grid-row: 5; justify-content: center; min-height: 190px; }
  #game .hand .card { width: 120px; height: 170px; margin-inline-start: -10px; } #game .hand .card .cn { font-size: 18px; }
  #game .side { display: flex !important; grid-column: 2; grid-row: 2 / 6; }
}
.side { display: none; flex-direction: column; background: rgba(12,6,23,.7); border-inline-start: 2px solid var(--ink); min-height: 0; }
.side h3 { font-family: var(--display); font-weight: 400; margin: 10px 12px 4px; color: var(--gold); }
.loglist { flex: 1; overflow-y: auto; padding: 0 10px 10px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.loglist div { padding: 4px 8px; border-radius: 8px; background: rgba(255,255,255,.04); } .loglist .secret { background: rgba(164,107,255,.25); }
.loglist .turn { color: var(--gold); font-weight: 700; margin-top: 4px; } .loglist .event { color: var(--blue); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.rsec { scroll-margin-top: 120px; }
.row .btn { font-size: 18px; }

.warn { font-size: 10px; font-weight: 800; background: var(--red); color: #fff; border-radius: 999px; padding: 0 6px; margin: 2px auto 0; display: inline-block; animation: pulse 1.2s infinite; }
.warn.win { background: var(--gold); color: var(--ink); }
.claims { font-size: 13px; letter-spacing: 1px; line-height: 1.2; }
.stakes { font-size: 12px; margin-top: 6px; background: rgba(12,6,23,.6); border-radius: 8px; padding: 3px 8px; color: var(--gold2); }
.timer { position: relative; }
#reactSec { position: absolute; left: 0; top: -16px; font-size: 12px; font-weight: 800; color: var(--red); }
.net-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 95; background: var(--red); color: #fff; text-align: center; font-weight: 700; padding: 6px; border-bottom: 3px solid var(--ink); }

.ovault { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; min-height: 16px; margin: 2px 0; }
.ovault i { font-style: normal; font-size: 10px; font-weight: 800; min-width: 15px; height: 15px; line-height: 13px; border-radius: 50%; background: linear-gradient(#ffe48a, #f0b42a); color: var(--ink); border: 1.5px solid var(--ink); }
.ovault i.st { background: linear-gradient(#ff8a9b, #c2244a); color: #fff; } .ovault i.g { background: #2f5b3e; border-radius: 4px; font-size: 9px; }
#lobby { background: linear-gradient(rgba(23,12,42,.55), rgba(23,12,42,.9)), url(/art/web/lobby_bg.webp) center / cover fixed, var(--bg); }

/* المرشد */
.guide { position: fixed; z-index: 86; top: max(8px, env(safe-area-inset-top)); left: 8px; right: 8px; margin: auto; max-width: 560px;
  display: flex; gap: 10px; align-items: flex-start; background: linear-gradient(160deg, #3d2470, #251240); border: var(--line); border-radius: 18px;
  box-shadow: 0 5px 0 var(--ink), 0 0 30px rgba(164,107,255,.45); padding: 10px 12px; }
.guide img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); flex: none; background: #2c1950; }
.guide .gbody { flex: 1; min-width: 0; } .guide .gname { font-size: 12px; color: var(--gold2); font-weight: 700; }
.guide .gtext { font-size: 15px; line-height: 1.6; margin: 2px 0 6px; } .guide .gtext b { color: var(--gold); }
.guide .btn.sm { font-size: 16px; }
.gskip { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; padding: 4px 0 0; display: block; }
.tspot { position: fixed; z-index: 85; pointer-events: none; border: 3px solid var(--gold); border-radius: 16px; box-shadow: 0 0 0 9999px rgba(8,4,16,.5), 0 0 24px var(--gold); transition: all .25s; animation: pulse 1.2s infinite; }
.tfinger { position: fixed; z-index: 87; font-size: 34px; pointer-events: none; filter: drop-shadow(0 3px 0 var(--ink)); }

/* الدليل السريع */
.slides { margin-top: 14px; }
.slide-card { position: relative; background: radial-gradient(120% 80% at 50% 0%, #4a2a80, #2a1648 70%); border: var(--line); border-radius: 22px; box-shadow: 0 6px 0 var(--ink), 0 0 40px rgba(164,107,255,.25); padding: 16px 16px 12px; text-align: center; overflow: hidden; }
.slide-card .sl-icon { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 0 var(--ink)); }
.slide-card h3 { font-family: var(--display); font-weight: 400; font-size: 34px; color: var(--gold); margin: 4px 0 2px; -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.slide-card p { font-size: 17px; line-height: 1.75; margin: 0 auto 6px; max-width: 460px; } .slide-card p b { color: var(--gold2); }
.slide-card .sl-count { position: absolute; top: 10px; left: 14px; font-size: 12px; color: var(--muted); }
.demo { position: relative; height: 230px; margin: 8px auto 0; max-width: 420px; border-radius: 16px; background: rgba(12,6,23,.45); border: 2px dashed rgba(246,197,68,.25); overflow: hidden; perspective: 900px; }
.demo .card { --w: 92px; }
.slide-nav { display: flex; align-items: center; gap: 10px; margin-top: 12px; } .slide-nav .btn { flex: none; }
.dots { flex: 1; display: flex; justify-content: center; gap: 7px; } .dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--panel2); border: 2px solid var(--ink); cursor: pointer; transition: all .2s; }
.dots i.on { background: var(--gold); width: 26px; border-radius: 9px; }
.goal-bar { position: absolute; left: 10%; right: 10%; top: 18%; height: 18px; background: var(--ink); border-radius: 12px; overflow: hidden; border: 2px solid var(--gold); }
.goal-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--red)); }
.goal-num { position: absolute; top: 30%; width: 100%; font-family: var(--display); font-size: 38px; color: var(--gold); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill; }
.chest { position: absolute; left: 42%; top: 62%; font-size: 52px; }
.vaultbox { background: var(--gold); color: var(--ink); border: var(--line); border-radius: 12px; padding: 8px 12px; font-weight: 800; box-shadow: var(--shadow); }
.demo-lbl { background: var(--ink); color: var(--gold2); border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: 14px; white-space: nowrap; }
.say { background: #fff; color: var(--ink); border: var(--line); border-radius: 14px; padding: 6px 12px; font-weight: 800; font-size: 15px; box-shadow: var(--shadow); white-space: nowrap; }
.stampx { font-family: var(--display); font-size: 40px; color: var(--red); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 0 4px 0 var(--ink); opacity: 0; white-space: nowrap; }
.gflip { width: 92px; perspective: 600px; text-align: center; } .gin { position: relative; height: 129px; transform-style: preserve-3d; }
.gf, .gb { position: absolute; inset: 0; backface-visibility: hidden; } .gb { transform: rotateY(180deg); }
.glbl { margin-top: 8px; font-weight: 800; font-size: 14px; opacity: 0; color: var(--gold2); }
.evcard { width: 190px; background: var(--panel); border: 4px solid var(--gold); border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); text-align: center; }
.evcard img { width: 100%; height: 110px; object-fit: cover; display: block; } .evcard b { display: block; font-family: var(--display); font-weight: 400; font-size: 22px; color: var(--gold); padding: 4px; }
.scroll { background: #f3e2b8; color: var(--ink); border: var(--line); border-radius: 12px; padding: 8px 12px; font-size: 22px; box-shadow: var(--shadow); }
.wav { text-align: center; } .wav img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; object-position: top; border: 4px solid var(--gold); }
.wbar { width: 120px; height: 10px; background: var(--ink); border-radius: 9px; overflow: hidden; margin: 6px auto 0; } .wbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); }
.ref-h { font-family: var(--display); font-weight: 400; color: var(--gold); font-size: 30px; margin: 26px 0 8px; -webkit-text-stroke: 1px var(--ink); paint-order: stroke fill; }
.acc { margin-bottom: 8px; } .acc-h { width: 100%; text-align: start; display: flex; justify-content: space-between; align-items: center; background: var(--panel); color: var(--text); border: var(--line); border-radius: 14px; padding: 12px 14px; font-size: 17px; font-weight: 700; box-shadow: var(--shadow); }
.acc-h span { transition: transform .25s; } .acc-h.open span { transform: rotate(180deg); }
.acc-b { display: none; padding: 12px 2px 4px; } .acc-b.open { display: block; }
.flipgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px; justify-items: center; }
.flip { width: 128px; height: 180px; perspective: 800px; cursor: pointer; } .fin { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.2,1.3,.4,1); transform-style: preserve-3d; }
.flip.flipped .fin { transform: rotateY(180deg); } .ff, .fb { position: absolute; inset: 0; backface-visibility: hidden; }
.fb { transform: rotateY(180deg); background: linear-gradient(160deg, #3d2470, #241040); border: 3px solid var(--gold); border-radius: 12px; padding: 8px; font-size: 11px; line-height: 1.45; overflow: auto; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.fb b { font-family: var(--display); font-weight: 400; font-size: 18px; color: var(--gold); } .fb em { font-style: normal; color: var(--gold2); font-size: 10px; }
.cardgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; } .cg { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.cg small { font-size: 12px; color: var(--muted); line-height: 1.45; } .cg .cnt { font-size: 11px; color: var(--gold2); }
.mini-list { line-height: 1.9; font-size: 15px; margin: 0; padding-inline-start: 20px; } .mini-list b { color: var(--gold2); }

.ofan { position: relative; height: 22px; display: flex; justify-content: center; align-items: flex-end; margin: 2px 0 0; }
.ofan i { width: 13px; height: 18px; margin: 0 -4px; border-radius: 3px; border: 1.5px solid var(--ink); background: url(/art/web/card_back.webp) center / cover, #3a2266; transform: rotate(var(--r)); transform-origin: 50% 140%; box-shadow: 0 1px 0 var(--ink); }
.ofan b { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--gold2); font-size: 10px; border-radius: 999px; padding: 0 5px; }
.motes { position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.motes i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: radial-gradient(circle, #fff6c8, #f6c544 45%, transparent 70%); opacity: 0; filter: blur(.3px); }
#game > *:not(.motes) { position: relative; z-index: 1; }
