/* 🃏 Al Jawahiri games — the wheel's identity (web/static/wheel.css): the navy screen with a blue
   pool of light, ice-blue outlines like the icon pack, lime for what is chosen or pressed.
   The brand colours come from the server (the wheel's colour settings) as CSS variables;
   these are the defaults. Always dark, like the wheel. */
:root {
  --bg: #0B1628; --primary: #E1FE64; --secondary: #8BC4DF; --extra: #2A8FE8;
  --small: #1A3A6B; --nothing: #101E36; --text: #FFFFFF; --text-dark: #0B1628;
  --display: "Baloo Bhaijaan 2", "Readex Pro", system-ui, sans-serif;
  --body: "Readex Pro", system-ui, -apple-system, "Segoe UI", Tahoma, sans-serif;
  --line: color-mix(in srgb, var(--secondary) 45%, transparent);
  --tint: color-mix(in srgb, var(--secondary) 9%, var(--bg));
  --surface: color-mix(in srgb, var(--bg) 86%, var(--secondary));
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font-family: var(--body); font-size: 15px; line-height: 1.5;
       background: radial-gradient(90% 40% at 50% 0%, color-mix(in srgb, var(--extra) 20%, transparent), transparent 70%) var(--bg) no-repeat; }

/* an icon of the emoji pack: the device's emoji until the animated one is drawn in it */
.ji { display: inline-grid; place-items: center; width: 1.3em; height: 1.3em; margin-inline-end: .35em;
      font-style: normal; line-height: 1; vertical-align: -0.25em; flex: none; }
.ji svg { width: 100% !important; height: 100% !important; }
.ji.big { width: 56px; height: 56px; font-size: 40px; margin: 0 auto 6px; display: grid; }

/* ------------------------------------------------------------ header */
.top { position: sticky; top: 0; z-index: 2; padding: max(10px, env(safe-area-inset-top)) 16px 10px;
       background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
       border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; }
/* the bot's mascot (transparent) and Ichancy's logo beside it */
.mascot { height: 64px; width: auto; flex: none; margin-block: -6px -2px;
          filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--extra) 45%, transparent)); }
.mascot.small { height: 30px; margin: 0; filter: none; }
.ichancy { height: 26px; width: auto; max-width: 34vw; flex: none; object-fit: contain; }
.spacer { flex: 1; }
.mode { display: flex; flex: none; padding: 3px; gap: 2px; border: 1.5px solid var(--secondary); border-radius: 999px;
        background: var(--tint); }
.mode button { display: flex; align-items: center; border: 0; background: transparent; color: var(--text);
               font: 600 .8rem var(--body); padding: 5px 10px; border-radius: 999px; cursor: pointer; }
.mode button .ji { margin-inline-end: .25em; }
.mode button.on { background: var(--primary); color: var(--text-dark); }
.note { color: var(--secondary); font-size: .85rem; margin: 8px 0 0; }
.note.center { text-align: center; }

.search { display: flex; gap: 8px; margin-top: 10px; }
.field { min-width: 0; font: 500 .92rem var(--body); color: var(--text); background: var(--tint);
         border: 1.5px solid var(--line); border-radius: 12px; }
label.field { flex: 1 1 auto; display: flex; align-items: center; padding: 0 10px; }
label.field:focus-within, .pick:focus-visible { border-color: var(--primary); outline: none; }
label.field input { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: inherit;
                    padding: 10px 0; outline: none; }
label.field input::placeholder { color: color-mix(in srgb, var(--secondary) 75%, transparent); }
.pick { flex: 0 1 38%; display: flex; align-items: center; padding: 10px 10px 10px 26px; cursor: pointer; text-align: right;
        background-image: linear-gradient(45deg, transparent 50%, var(--secondary) 50%),
                          linear-gradient(135deg, var(--secondary) 50%, transparent 50%);
        background-position: 14px 50%, 9px 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.pick span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pick.on { border-color: var(--primary); color: var(--primary); }

.cats { display: flex; gap: 6px; overflow-x: auto; margin: 10px -16px 0; padding: 0 16px 2px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cats button { flex: 0 0 auto; border: 1.5px solid var(--line); background: var(--tint); color: var(--text);
               font: 500 .82rem var(--body); padding: 5px 13px; border-radius: 999px; cursor: pointer; }
.cats button.on { background: var(--primary); border-color: var(--primary); color: var(--text-dark); font-weight: 700; }

/* ------------------------------------------------------------ the games */
main { padding: 14px 16px max(28px, env(safe-area-inset-bottom)); max-width: 900px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.game { position: relative; display: block; width: 100%; padding: 0; border: 1.5px solid var(--line);
        background: var(--surface); color: var(--text); border-radius: 16px; overflow: hidden; cursor: pointer;
        text-align: right; font: inherit; transition: transform .08s, border-color .15s; }
.game:active { transform: scale(.97); border-color: var(--primary); }
.game .pic { position: relative; display: block; aspect-ratio: 220 / 155; background: var(--nothing); overflow: hidden; }
.game .pic::before { content: ""; position: absolute; inset: 0;         /* a shimmer until the picture comes */
                     background: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--secondary) 14%, transparent) 50%, transparent 70%);
                     background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
.game .pic.done::before { display: none; }
.game img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover;
            opacity: 0; transition: opacity .25s; }
.game .pic.done img { opacity: 1; }
/* the bot: faint while the picture comes, clear when the game has none */
.game img.ph { inset: 12% 0; height: 76%; object-fit: contain; opacity: .35;
               filter: drop-shadow(0 4px 10px color-mix(in srgb, var(--extra) 45%, transparent)); }
.game .pic.done img.ph { opacity: 0; }
.game .pic.none img.ph { opacity: 1; }
.game .pic.none { background: radial-gradient(60% 70% at 50% 60%, color-mix(in srgb, var(--extra) 28%, transparent), transparent 75%) var(--nothing); }
.game .name { display: block; padding: 7px 10px 0; font-weight: 600; font-size: .86rem;
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game .prov { display: block; padding: 0 10px 9px; font-size: .72rem; color: var(--secondary);
              white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.status { display: flex; align-items: center; justify-content: center; color: var(--secondary); margin: 28px 0; }
.btn { display: block; width: 100%; padding: 13px; border: 0; border-radius: 14px; font: 700 1rem var(--display);
       background: var(--primary); color: var(--text-dark); cursor: pointer; margin-top: 14px;
       box-shadow: 0 0 18px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--secondary); box-shadow: none; }
.btn:disabled { opacity: .6; }
.link { display: flex; align-items: center; margin: 22px auto 0; border: 0; background: none; color: var(--secondary);
        font: 500 .9rem var(--body); cursor: pointer; }

/* ------------------------------------------------------------ a game open */
.player { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; background: #000; }
.player .bar { display: flex; align-items: center; gap: 10px; background: var(--bg);
               padding: max(6px, env(safe-area-inset-top)) 12px 6px; border-bottom: 1px solid var(--line); }
.player .back { display: grid; place-items: center; flex: none; width: 42px; height: 42px; padding: 0; border: 0;
                border-radius: 50%; background: var(--primary); cursor: pointer;
                box-shadow: 0 0 14px color-mix(in srgb, var(--primary) 45%, transparent); }
.player .back:active { transform: scale(.92); }
.player .back svg { width: 24px; height: 24px; fill: none; stroke: var(--text-dark); stroke-width: 3.2;
                    stroke-linecap: round; stroke-linejoin: round; }
.player .bar .mascot.small { height: 40px; }
.player .bar .spacer { flex: 1; }
.ichancy.small { height: 20px; max-width: 30vw; }
.player iframe { flex: 1; width: 100%; border: 0; background: #000; }

/* ------------------------------------------------------------ the password, a message */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center;
         padding: 16px; background: color-mix(in srgb, #000 60%, transparent); }
.sheet .card { width: 100%; max-width: 380px; background: var(--bg); border: 1.5px solid var(--secondary);
               border-radius: 18px; padding: 18px; text-align: center; }
.sheet input { width: 100%; font: inherit; color: var(--text); background: var(--tint); border: 1.5px solid var(--line);
               border-radius: 12px; padding: 11px; margin-top: 8px; text-align: center; }
.sheet input:focus { border-color: var(--primary); outline: none; }
.toast { position: fixed; bottom: max(16px, env(safe-area-inset-bottom)); left: 16px; right: 16px; z-index: 30;
         margin: 0 auto; max-width: 480px; background: var(--bg); color: var(--text); border: 1.5px solid var(--primary);
         border-radius: 14px; padding: 12px 14px; text-align: center; box-shadow: 0 6px 24px #0008; }

/* ------------------------------------------------------------ the providers' list */
.sheet.bottom { align-items: flex-end; padding: 0; }
.card.list { max-width: 560px; height: min(78vh, 640px); display: flex; flex-direction: column; text-align: right;
             border-radius: 20px 20px 0 0; border-bottom: 0; padding: 14px 14px max(10px, env(safe-area-inset-bottom)); }
.list-head { display: flex; gap: 8px; align-items: center; }
.list-head .field { flex: 1; }
.x { display: grid; place-items: center; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%;
     border: 1.5px solid var(--secondary); background: var(--tint); cursor: pointer; }
.x svg { width: 18px; height: 18px; stroke: var(--text); stroke-width: 2.6; stroke-linecap: round; fill: none; }
.options { flex: 1; overflow-y: auto; margin-top: 10px; overscroll-behavior: contain; }
.options button { display: block; width: 100%; padding: 12px 10px; border: 0; border-bottom: 1px solid var(--line);
                  background: none; color: var(--text); font: 500 .95rem var(--body); text-align: right; cursor: pointer; }
.options button.on { color: var(--primary); font-weight: 700; }
.options button.on::after { content: " ✓"; }
html.modal-open, html.modal-open body { overflow: hidden; }
