/* =============================================================================
   games/art.css — الطبقة المرسومة المشتركة بين ألعاب الألغاز (ألغام، ثم البقية).
   تُحمَّل بعد ملف اللعبة وتعتمد على متغيّراته (--accent, --accent-2, --gold, --panel, --panel-2, --line, --dim).
   الفكرة: الصور قطع خام شفافة في icons/art/، وهنا قواعد تركيبها — زرّ بأيقونة مرسومة، بلاطات القائمة،
   زرّ «تابع اللعب» بسطرين، مجموعات المراحل، صورة النتيجة، بلاطات رمز الغرفة، صورة اللاعب.
   قائد الشحنات له نسخته في style.css (محرّكه وتخطيطه مختلفان).
   ========================================================================== */

/* أيقونة مرسومة داخل زرّ أو سطر */
.btn-art { width: 30px; height: 30px; flex: none; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .4)); }
.btn.big .btn-art { width: 38px; height: 38px; }
.btn.small .btn-art { width: 22px; height: 22px; }
.ic-art { width: 1.4em; height: 1.4em; flex: none; object-fit: contain; vertical-align: -0.32em; }
.st-art { width: 24px; height: 24px; flex: none; object-fit: contain; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)); }

/* ---------- القائمة ---------- */
.emblem-wrap { width: clamp(128px, 29vw, 184px); }
.logo-emblem { animation: art-float 3.8s ease-in-out infinite; }
@keyframes art-float { 50% { transform: translateY(-6px); } }
.play-btn { gap: 12px; padding: 12px 20px; min-height: 72px; }
.play-btn .btn-art { width: 44px; height: 44px; }
.play-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; text-align: start; }
.play-txt b { font-size: 22px; font-weight: 800; }
.play-txt small { font-size: 13.5px; font-weight: 700; opacity: .8; }
.btn-daily .btn-art { width: 40px; height: 40px; }
.streak .ic-art { width: 20px; height: 20px; vertical-align: 0; }
.menu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.menu-grid .btn.tile { flex-direction: column; gap: 5px; min-height: 96px; padding: 12px 8px 10px; font-size: 17px; border-radius: 18px; }
.btn.tile .btn-art { width: 48px; height: 48px; transition: transform .2s cubic-bezier(.2, 1.3, .4, 1); }
@media (hover: hover) and (pointer: fine) { .btn.tile:hover .btn-art { transform: translateY(-3px) scale(1.08) rotate(-4deg); } }
.btn.tile:active .btn-art { transform: scale(.92); }
.menu-stats { gap: 18px; padding: 9px 18px; border: 1px solid var(--line); border-radius: 14px; background: rgba(0, 0, 0, .22); width: fit-content; margin-inline: auto; }
@media (max-height: 720px) { .menu-grid .btn.tile { min-height: 78px; } .btn.tile .btn-art { width: 38px; height: 38px; } .emblem-wrap { width: 108px; } }

/* ---------- المراحل: مجموعة لكل مستوى صعوبة ---------- */
.levels-grid.grouped { display: flex; flex-direction: column; gap: 14px; }
.chap { border: 1px solid color-mix(in srgb, var(--tier, var(--accent)) 30%, var(--line)); border-radius: 20px; padding: 12px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--tier, var(--accent)) 10%, var(--panel-2)), var(--panel)); box-shadow: 0 6px 0 rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .06); }
.chap.locked { opacity: .62; }
.chap-head { display: flex; align-items: center; gap: 10px; }
.chap-num { flex: none; width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; font-size: 21px; font-weight: 800; color: #10151f;
  background: linear-gradient(180deg, color-mix(in srgb, var(--tier, var(--accent)) 60%, #fff), var(--tier, var(--accent))); box-shadow: 0 4px 0 color-mix(in srgb, var(--tier, var(--accent)) 50%, #000), inset 0 2px 0 rgba(255, 255, 255, .45); margin-bottom: 4px; }
.chap.locked .chap-num { background: linear-gradient(180deg, #3a4763, #232e47); box-shadow: 0 4px 0 #0e1526; }
.chap-num img { width: 24px; height: 24px; object-fit: contain; }
.chap-title { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; text-align: start; }
.chap-title small { color: var(--dim); font-size: 12.5px; font-weight: 700; }
.chap-title b { font-size: 19px; font-weight: 800; }
.chap-stars { flex: none; display: inline-flex; align-items: center; gap: 4px; direction: ltr; font-weight: 800; font-size: 14px; color: var(--gold); font-variant-numeric: tabular-nums; }
.chap-stars img { width: 20px; height: 20px; object-fit: contain; }
.chap-bar { height: 6px; border-radius: 999px; background: rgba(0, 0, 0, .35); overflow: hidden; margin: 8px 0 12px; }
.chap-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--tier, var(--accent)), var(--gold)); }
.chap-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
@media (min-width: 620px) { .chap-grid { grid-template-columns: repeat(8, 1fr); } }
.chap-grid .lvl { border-radius: 15px; }
.chap-grid .lvl .num { font-size: 23px; }
.lvl .lvl-stars { height: 15px; gap: 1px; }
.lvl .lvl-stars img { width: 15px; height: 15px; object-fit: contain; filter: grayscale(1) brightness(.5); opacity: .5; }
.lvl .lvl-stars img.on { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .4)); opacity: 1; }
.lvl.current { outline: 3px solid var(--gold); outline-offset: 2px; animation: art-next 1.8s ease-in-out infinite; }
@keyframes art-next { 50% { box-shadow: 0 4px 0 rgba(0, 0, 0, .3), 0 0 0 6px rgba(255, 209, 102, .16); } }

/* ---------- النوافذ ---------- */
.result-art { display: block; width: 100px; height: 100px; object-fit: contain; margin: -4px auto 4px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)); animation: art-float 3.8s ease-in-out infinite; }
.result-art.sad { width: 84px; height: 84px; animation: none; }
.result-stars { height: 62px; align-items: center; }
.result-stars i img { width: 50px; height: 50px; object-fit: contain; display: block; }
.result-stars i:nth-child(2) img { width: 62px; height: 62px; }
.result-stars i.on img { filter: drop-shadow(0 0 12px rgba(255, 209, 102, .65)); }
.big-streak img { width: 46px; height: 46px; object-fit: contain; }
.result-rows { gap: 10px; }
.result-rows div { flex: 1; padding: 8px 6px; border-radius: 14px; background: rgba(0, 0, 0, .24); border: 1px solid var(--line); }
.overlay-buttons .btn { gap: 10px; }

/* ---------- الغرفة ---------- */
.room-code.tiles { display: flex; justify-content: center; gap: 8px; font-size: 40px; letter-spacing: 0; direction: ltr; }
.room-code.tiles span { width: 56px; height: 66px; display: grid; place-items: center; border-radius: 14px; color: #2a1c00;
  background: linear-gradient(180deg, #ffe08a, #f0a91a); box-shadow: 0 5px 0 #a86a08, inset 0 2px 0 rgba(255, 255, 255, .5); }
.players .crown-art { width: 22px; height: 22px; object-fit: contain; flex: none; }

@media (prefers-reduced-motion: reduce) { .logo-emblem, .result-art, .lvl.current { animation: none; } }

/* ---------- شريط اللعب والأدوات ---------- */
.pill-art { width: 18px; height: 18px; flex: none; object-fit: contain; }
.tool .btn-art { width: 24px; height: 24px; }
.tool { background: linear-gradient(180deg, var(--panel-2), var(--panel)); box-shadow: 0 4px 0 rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .08); }
.tool[aria-pressed="true"] { background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--accent-2) 55%, #000), inset 0 1px 0 rgba(255, 255, 255, .3); }
.tool .cost { display: inline-flex; align-items: center; gap: 2px; }
.tier-pick .btn { box-shadow: 0 5px 0 rgba(0, 0, 0, .32), inset 0 4px 0 var(--tier); }
/* صف الأدوات على الجوال: النص في سطر واحد والأيقونة أصغر كي لا يتكسّر الزرّ */
.tool span { white-space: nowrap; }
@media (max-width: 480px) { .tools { gap: 7px; } .tool { min-width: 0; font-size: 14px; padding-inline: 5px; gap: 5px; } .tool .btn-art { width: 21px; height: 21px; } }
