/* قالب البوستر: خلفية ورقية، خطوط سوداء، أحمر واحد. يتحمل بعد كل ملفات التنسيق */
:root {
  --night: #f3ecdf; --deep: #ece3d2; --panel: #fff; --panel-2: #f3ecdf;
  --felt: rgba(20, 20, 20, .05); --felt-2: rgba(20, 20, 20, .09); --line: #141414;
  --gold: #d7263d; --gold-2: #d7263d; --gold-soft: rgba(215, 38, 61, .12);
  --ink: #141414; --muted: #5a5249; --green: #d7263d; --amber: #d7263d; --red: #d7263d;
  color-scheme: light;
}
html, body { background: #f3ecdf !important; }
.scene3d { display: none !important; }
:focus-visible, .online-now:focus-visible, .copy-link:focus-visible, .player-chip:focus-visible,
.avatar-pick-btn:focus-visible, .avatar-grid button:focus-visible { outline: 2px solid #141414; }

/* ===== الشريط العلوي ===== */
.site-bar { background: #fff; box-shadow: none; border-bottom: 3px solid #141414; color: #141414; }
.site-bar .logo, .site-bar .site-nav { color: #141414; }
.logo-mark, .site-bar .logo-mark { background: #d7263d; color: #fff; border-radius: 0; }
.site-nav { color: #141414; }
.online-now:hover { color: inherit; }
/* المتصل أخضر دايماً */
.site-bar .online-now b { color: #15803d; }
.site-bar .online-now i { background: #15803d; box-shadow: none; animation: none; }
.site-bar .online-now.owner-view > .wide-only { color: #15803d; }
.site-bar .site-nav > a, .site-bar .copy-link, .site-bar .site-nav .score-menu-btn, .site-bar .online-now { border-radius: 0; }
.site-bar .btn { background: #fff; color: #141414; border-width: 2px; }
.site-bar .site-nav > a:active, .site-bar .copy-link:active, .site-bar .site-nav .score-menu-btn:active, .site-bar .online-now:active, .site-bar .btn:active,
.site-bar .site-nav .score-menu-btn[aria-expanded="true"], .site-bar .online-now[aria-expanded="true"] { background: #141414; color: #fff; }
.site-bar .online-now:active b, .site-bar .online-now[aria-expanded="true"] b { color: #fff; }
@media (hover: hover) {
  .site-bar .site-nav > a:hover, .site-bar .copy-link:hover, .site-bar .site-nav .score-menu-btn:hover, .site-bar .online-now:hover, .site-bar .btn:hover { background: #141414; color: #fff; }
  .site-bar .online-now:hover b { color: #fff; }
  .site-bar .online-now:hover i { background: #fff; }
}
.site-bar a:focus-visible, .site-bar button:focus-visible { outline-color: #141414; }
.admin-open { border: 2px solid #141414; border-radius: 0; color: #141414; }
.admin-open:hover { background: #141414; color: #fff; }

/* ===== الأزرار والكتابة ===== */
.btn { border: 3px solid #141414; border-radius: 0; background: #fff; color: #141414; backdrop-filter: none; }
.btn:hover { background: #141414; color: #fff; transform: none; }
.btn.primary { background: #d7263d; color: #fff; box-shadow: 4px 4px 0 #141414; }
.btn.primary:hover { background: #d7263d; color: #fff; box-shadow: 6px 6px 0 #141414; transform: translate(-2px, -2px); }
.btn.small { border-radius: 0; border-width: 2px; }
.site-bar .btn.small { padding: 4px 8px; font-size: 12.5px; }
@media (max-width: 480px) { .site-bar-inner .logo { gap: 5px; font-size: 14px; } .site-bar .logo-mark { width: 28px; height: 28px; font-size: 15px; } }
.btn.admin-danger, .btn.danger { background: #141414; color: #fff; }

/* ===== الواجهة ===== */
.hero-art { -webkit-mask-image: none; mask-image: none; inset-block: 8% auto; inset-inline-end: 0; width: 44%; height: 84%; border: 3px solid #141414; box-shadow: 7px 7px 0 #141414; }
.hero h1, .hero p, .room-entry h2 { text-shadow: none; }
.hero h1 em { background: none; color: #d7263d; -webkit-text-fill-color: currentColor; }
.hero p { color: #141414; }
.player-chip small { color: #5a5249; }
.room-entry h2 { color: #141414; }
.room-entry input { border: 3px solid #141414; border-radius: 0; background: #fff; color: #141414; backdrop-filter: none; }
.room-entry input::placeholder { color: #5a5249; }
@media (max-width: 820px) {
  .hero-art { inset: 0 0 auto; width: 100%; height: 290px; }
}

/* ===== شبكة الألعاب ===== */
.games { perspective: none; gap: clamp(14px, 1.8vw, 24px); }
.game { display: flex; flex-direction: column; aspect-ratio: auto; border: 3px solid #141414; border-radius: 0; background: #fff; box-shadow: 6px 6px 0 #141414; transform-style: flat; transition: transform .12s, box-shadow .12s; }
@media (hover: hover) { .game:hover { box-shadow: 9px 9px 0 #141414; transform: translate(-2px, -2px); } }
.game::after { display: none; }
.game-cover { position: static; aspect-ratio: 1 / 1; height: auto; border-bottom: 3px solid #141414; transition: none; }
.game:hover .game-cover { transform: none; }
.game-link { border-radius: 0; }
.game-link:focus-visible { outline-color: #141414; }
.game-info { position: static; flex: 1; align-items: flex-start; padding: 8px 10px 10px; transform: none; color: #141414; }
.game-info small { color: #d7263d !important; }
.game-info h3 { font-size: clamp(17px, 1.6vw, 21px); }

/* ===== القوائم المنسدلة ===== */
.online-panel, .score-menu-list, .avatar-panel { border: 3px solid #141414; border-radius: 0; background: #fff; color: #141414; box-shadow: 5px 5px 0 #141414; }
.online-title, .online-panel small { color: #141414; }
.online-panel small.online-admin { color: #a01414; }
.online-notes { color: #5a5249; }
.score-menu-btn.big { border: 3px solid #141414; border-radius: 0; background: #fff; color: #141414; }
.site-nav .score-menu-btn:hover { color: inherit; }
.score-menu-list a, .score-menu-list button, .score-menu-list [data-menu-game] { --c: #d7263d; border-radius: 0; background: none; color: #141414; }
.score-menu-list a:hover, .score-menu-list button:hover, .score-menu-list a:focus-visible, .score-menu-list button:focus-visible { background: #d7263d; color: #fff; }
.site-bar .score-menu-list button:focus-visible { outline-color: #141414; }

/* ===== السكورات ===== */
.rank-list { --muted: #5a5249; --ink: #141414; border: 3px solid #141414; border-radius: 0; background: #fff; color: #141414; box-shadow: 5px 5px 0 #141414; }
.rank-list.compact { border-radius: 0; box-shadow: none; }
.rank-row { border-top: 2px solid #141414; border-radius: 0; }
.rank-no { color: rgba(20, 20, 20, .4); }
.rank-pts, .rank-row.top .rank-no { color: #d7263d; }
.rank-row.me { background: #141414; color: #fff; }
.rank-row.me .rank-no, .rank-row.me .rank-pts { color: #fff; }
.rank-row:not(.me):active { background: #f3ecdf; color: #141414; }
.rank-row:not(.me):active .rank-no { color: #141414; }
.rank-row:not(.me):active .rank-pts { color: #d7263d; }
@media (hover: hover) {
  .rank-row:not(.me):hover { background: #f3ecdf; color: #141414; }
  .rank-row:not(.me):hover .rank-no { color: #141414; }
  .rank-row:not(.me):hover .rank-pts { color: #d7263d; }
}
.visitors, .scores-empty { color: #141414; }
.visitors b { background: none; color: #d7263d; -webkit-text-fill-color: currentColor; }
.lead { color: #141414 !important; }
.chip { border-radius: 0; background: #fff; color: #141414; border: 2px solid #141414; backdrop-filter: none; }
.chip:hover:not(:disabled) { background: #f3ecdf; }
.chip[aria-pressed="true"], .chip.easy[aria-pressed="true"], .chip.medium[aria-pressed="true"], .chip.hard[aria-pressed="true"] { background: #d7263d; color: #fff; }

/* ===== النوافذ ===== */
.admin-dialog, .welcome, .room-dialog, dialog.score-popup { border: 3px solid #141414; border-radius: 0; background: #fff; color: #141414; box-shadow: 7px 7px 0 #141414; }
.admin-dialog::backdrop, .welcome::backdrop, .room-dialog::backdrop, dialog.score-popup::backdrop { background: rgba(20, 20, 20, .55); backdrop-filter: none; }
.admin-step label[for], .welcome p, .admin-codes p:not(.admin-msg), .avatar-panel p { color: #141414; }
.admin-step input[type="password"], .admin-code-edit input, .admin-add input, .welcome input, .room-dialog input { border: 2px solid #141414; border-radius: 0; background: #fff; color: #141414; }
.admin-code-edit input::placeholder, .admin-add input::placeholder, .welcome input::placeholder, .room-dialog input::placeholder { color: #5a5249; }
.admin-games label { border: 2px solid #141414; border-radius: 0; background: #fff; color: #141414; }
.admin-games label:has(input:checked) { border-color: #141414; background: #d7263d; color: #fff; }
.admin-games label:has(input:focus-visible) { outline-color: #141414; }
.admin-games small { color: #5a5249; }
.admin-games label:has(input:checked) small { color: #fff; }
.admin-msg { color: #a01414; }
.admin-codes { border-top: 2px solid #141414; }
.admin-code-list li { border-radius: 0; background: #f3ecdf; }
#adminCodeList li { border: 2px solid #141414; border-radius: 0; background: #fff; }
#adminCodeList .admin-code-who { color: #141414; }
#adminCodeList .admin-code-who b { color: #5a5249; }
.admin-edit { border-radius: 0; background: #d7263d; color: #fff; }
.admin-remove { border-radius: 0; background: #141414; color: #fff; }
.avatar-pick-btn { border-radius: 0; background: #f3ecdf; color: #141414; }
.avatar-grid button { border-radius: 0; }
.avatar-grid button[aria-pressed="true"] { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #d7263d; }
.avatar-panel p.avatar-group, .welcome p.avatar-group { color: #d7263d; }
.welcome .welcome-note { color: #a01414; }
.rank-avatar, .player-chip i { border-radius: 0; }

/* ===== مساحات اللعب: اللعبة تبقى على خلفيتها الداكنة ===== */
.arena-stage, .stage { border: 3px solid #141414; border-radius: 0; box-shadow: 6px 6px 0 #141414; }
.arena-overlay, .overlay { --ink: #fff; --muted: #c7d8df; --night: #04121c; --felt: rgba(255, 255, 255, .08); --felt-2: rgba(255, 255, 255, .14); --line: rgba(255, 255, 255, .22); --gold: #ff8a9a; color: #fff; }
.arena-overlay .btn:not(.primary), .overlay .btn:not(.primary) { background: #fff; color: #141414; }
.arena-overlay .btn:not(.primary):hover, .overlay .btn:not(.primary):hover { background: #141414; color: #fff; }
.room-list li.me, .room-list.rank-list li.me { border-color: #fff; background: #fff; color: #141414; }
.breath { background: #fff; border: 2px solid #141414; border-radius: 0; }
.breath-fill { background: #141414; }
.breath-fill.low { background: #d7263d; }
.share .whatsapp, .whatsapp, .share { background: #141414 !important; color: #fff !important; }

/* ===== مسابقة الاختلافات ===== */
.panel p { color: #141414; }
.big { color: #141414; }
.form input, .link-box input { border: 3px solid #141414; border-radius: 0; background: #fff; color: #141414; }
.form input::placeholder { color: #5a5249; }
.room-tile { border: 3px solid #141414; border-radius: 0; background: #fff; color: #141414; box-shadow: 5px 5px 0 #141414; }
.room-tile small { color: #5a5249; }
.room-tile .room-status { color: #d7263d; }
.room-tile.playing .room-status { color: #141414; font-weight: 700; }
.room-dialog-note { color: #a01414; }
#foundCount { color: #141414; }
.timer.low b { color: #d7263d; }
.pic { border-radius: 0; box-shadow: 4px 4px 0 #141414; }
.board li { border-bottom-color: #141414; }
.board li.me { border-radius: 0; background: #141414; color: #fff; }
.score-title, .score-rank, .score-num, .score-wrong { color: #5a5249; }
.score-row { border-radius: 0; color: #141414; }
.score-row:hover { background: #f3ecdf; color: #141414; }
.score-row:hover .score-rank, .score-row:hover .score-num, .score-row:hover .score-wrong { color: #5a5249; }
.score-row.me { outline-color: #d7263d; }
.score-row.first .score-rank { color: #d7263d; }
.score-face { border-radius: 0; background: #f3ecdf; color: #141414; }
.score-dot { border-color: #fff; border-radius: 0; }
.score-dot.on { background: #15803d; }
.score-kick { border: 2px solid #141414; border-radius: 0; background: #fff; }
.score-kick:hover, .score-kick:focus-visible { background: #141414; color: #fff; }
.score-wrong.stopped { color: #a01414; }
.score-num.plus { color: #d7263d; }
.score-popup h2 { color: #d7263d; }
.score-popup > p { color: #5a5249; }
.score-popup .close { border: 3px solid #141414; border-radius: 0; background: #d7263d; color: #fff; }

/* ===== أعلى لوحة الادمن واختيار اللعبة ===== */
.admin-top { display: flex; gap: 8px; margin-bottom: 14px; }
.admin-top .admin-room { flex: 1; width: auto; margin: 0; padding-inline: 8px; }
.admin-top .btn:not(.admin-room) { flex: none; padding-inline: 12px; }
.admin-room-games { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.admin-room-game { min-height: 62px; padding: 5px 4px; border: 2px solid #141414; background: #fff; color: #141414; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.admin-room-game:hover { background: #d7263d; color: #fff; }

/* ===== إرسال الدعوة من نافذة كود الغرفة ===== */
.invite-box { margin-top: 14px; padding-top: 12px; border-top: 2px solid #141414; }
.invite-box h3 { margin: 0 0 8px; font-size: 15px; }
.invite-list { display: grid; gap: 4px; max-height: 190px; margin-bottom: 8px; overflow-y: auto; }
.invite-list label { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 8px; border: 2px solid #141414; background: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.invite-list label:has(input:checked) { background: #d7263d; color: #fff; }
.invite-list input { width: 18px; height: 18px; margin: 0; accent-color: #141414; }
.invite-list p { margin: 0; color: #5a5249; font-size: 13px; }
.invite-box #inviteSend { width: 100%; }
.invite-box #inviteSend:not(:disabled) { background: #d7263d; color: #fff; }
.invite-box #inviteSend:disabled { opacity: .5; cursor: not-allowed; }
.invite-note { min-height: 1.4em; margin: 6px 0 0; color: #a01414; font-size: 13px; text-align: center; }

/* ===== لوحة إدارة الغرفة ===== */
body:has(> header.bar) { background: #f3ecdf !important; }
.bar { background: #fff; color: #141414; border-bottom: 3px solid #141414; }
.bar-btn { border: 2px solid #141414; border-radius: 0; color: #141414; }
.bar-btn:hover { background: #141414; color: #fff; }
.card { border: 3px solid #141414; border-radius: 0; background: #fff; box-shadow: 5px 5px 0 #141414; }
.topic-button, .action, .copy, .end, .room-link, .login input { border: 2px solid #141414; border-radius: 0; background: #fff; color: #141414; }
.topic-menu { border: 2px solid #141414; border-radius: 0; background: #fff; }
.topic-row { border-radius: 0; }
.topic-row:hover { background: #f3ecdf; }
.topic-row.first { border-bottom-color: #141414; border-radius: 0; }
.switch-track { border-radius: 0; background: rgba(20, 20, 20, .25); }
.switch-track::after { border-radius: 0; }
input:checked + .switch-track { background: #d7263d; }
.action:hover:not(:disabled) { filter: none; background: #f3ecdf; }
.action.start, .action.start:hover:not(:disabled) { background: #d7263d; color: #fff; box-shadow: 4px 4px 0 #141414; }
.action.stop, .action.stop:hover:not(:disabled), .end.yes { background: #141414; color: #fff; }
.copy:hover, .end:hover:not(:disabled) { background: #f3ecdf; }
.state { border-radius: 0; background: #f3ecdf; color: #141414; }
.state.playing { background: #d7263d; color: #fff; }
.state.ended { background: #141414; color: #fff; }
.login-note { color: #a01414; }
.hint { color: #a01414; }
