/* 🎮 The games page in Ichancy's own identity, as the games mini app's «ألعاب الموقع» (jawahiri-miniapp
   sections/site/site.css, Ichancy's brand guide): Russo One for Latin headlines, Kafa for Arabic headlines,
   Changa Medium for text; Oxford Blue / Dark Navy / Sky Blue / Mindaro / Blue Crayola. Self-hosted fonts. */
@font-face { font-family: "Changa"; font-weight: 500; font-display: swap; src: url("/fonts/changa-arabic-500-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Changa"; font-weight: 500; font-display: swap; src: url("/fonts/changa-latin-500-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Changa"; font-weight: 700; font-display: swap; src: url("/fonts/changa-arabic-700-normal.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFF; }
@font-face { font-family: "Changa"; font-weight: 700; font-display: swap; src: url("/fonts/changa-latin-700-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Russo One"; font-display: swap; src: url("/fonts/russo-one-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Kafa"; font-display: swap; src: url("/fonts/Kafa.woff2") format("woff2"); }

:root {
  --ich-oxford: #0B1629;
  --ich-navy: #122543;
  --ich-sky: #8CC4DF;
  --ich-lime: #E2FF65;
  --ich-blue: #1475E1;
  --ich-white: #EEEEEE;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--ich-oxford); }
html.modal-open, html.modal-open body { overflow: hidden; }
.ich { font-family: "Changa", "Cairo", system-ui, sans-serif; font-weight: 500; line-height: 1.35; color: var(--ich-white); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
[hidden] { display: none !important; }
.russo { font-family: "Russo One", "Changa", sans-serif; font-weight: 400; line-height: .9; letter-spacing: .01em; }
.kafa { font-family: "Kafa", "Changa", sans-serif; line-height: 1.1; }
.muted { color: var(--ich-sky); font-size: 14px; }
.center { text-align: center; }
.lines { white-space: pre-line; }

.wrap { padding: max(12px, env(safe-area-inset-top)) 16px 24px; max-width: 720px; margin: 0 auto; }

/* hero: Dark Navy with the guide's diagonal lightning facets */
.hero { position: relative; overflow: hidden; border-radius: 22px; background: var(--ich-navy); padding: 20px; }
.hero .bolts { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-in { position: relative; }
.hero .logo { height: 40px; width: auto; display: block; }
.hero .tagline { margin-top: 4px; font-size: 10px; letter-spacing: .12em; color: var(--ich-sky); }
.hero .title { margin-top: 12px; font-size: 22px; }
.hero .sub { margin-top: 2px; font-size: 13px; color: var(--ich-sky); }
.hero .sub b { color: var(--ich-lime); }

.search { display: flex; align-items: center; gap: 8px; height: 46px; margin-top: 12px; padding: 0 14px; border-radius: 16px;
  background: var(--ich-navy); border: 1.5px solid transparent; transition: border-color .15s; }
.search:focus-within { border-color: var(--ich-sky); }
.search input { flex: 1; min-width: 0; background: transparent; border: 0; outline: none; color: var(--ich-white); font: inherit; }
.search input::placeholder { color: color-mix(in srgb, var(--ich-sky) 70%, transparent); }
.search input::-webkit-search-cancel-button { display: none; }
.search .i { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--ich-sky); stroke-width: 2; stroke-linecap: round; }

.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px; margin: 12px -16px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 12px;
  background: var(--ich-navy); color: var(--ich-sky); font-size: 13px; white-space: nowrap; transition: background .15s, color .15s; }
.chip.on { background: var(--ich-sky); color: var(--ich-oxford); font-weight: 700; }   /* Sky + Dark: a pair the guide suggests */
.chip svg { width: 15px; height: 15px; }
.chip .caret { font-size: 10px; opacity: .7; }
.chip.on .bolt { fill: var(--ich-oxford); }
.chip .clock { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.link { color: var(--ich-sky); font-size: 12px; }
.bolt { width: 14px; height: 14px; fill: var(--ich-sky); }
.bolt.dark { fill: var(--ich-oxford); width: 18px; height: 18px; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
@media (min-width: 560px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { position: relative; border-radius: 16px; overflow: hidden; background: var(--ich-navy); }
.tile .open { display: block; width: 100%; text-align: start; transition: transform .1s; }
.tile .open:active { transform: scale(.97); }
.pic { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 220 / 155; overflow: hidden;
  background: linear-gradient(135deg, var(--ich-navy), #1a3560); }
.tile.big .pic { aspect-ratio: 220 / 130; }
.pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pic .bolt { width: 34px; height: 34px; }
.pic.loading { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.tile .txt { padding: 8px 10px 10px; }
.tile .nm { font-size: 13px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .pv { margin-top: 2px; font-size: 11px; color: var(--ich-sky); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .sk { height: 46px; }
.tile .fav { position: absolute; top: 6px; inset-inline-end: 6px; width: 32px; height: 32px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ich-oxford) 72%, transparent); backdrop-filter: blur(4px); }
.heart { width: 18px; height: 18px; fill: none; stroke: var(--ich-white); stroke-width: 2; stroke-linejoin: round; }
.heart.on { fill: var(--ich-lime); stroke: var(--ich-lime); }
.chip .heart { stroke: currentColor; }
.chip.on .heart { stroke: var(--ich-oxford); fill: var(--ich-oxford); }
.end { height: 1px; }
.status { padding: 48px 0; text-align: center; color: var(--ich-sky); margin: 0; }
.ghost-link { display: block; margin: 20px auto 0; color: var(--ich-sky); font-size: 13px; text-decoration: underline; }

/* the bottom sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center;
  background: rgb(0 0 0 / .55); animation: fade .15s ease-out; }
.sheet { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 10px 16px max(18px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0; background: var(--ich-oxford); border-top: 1px solid color-mix(in srgb, var(--ich-sky) 35%, transparent);
  animation: up .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
.grab { width: 44px; height: 5px; margin: 0 auto 12px; border-radius: 3px; background: color-mix(in srgb, var(--ich-sky) 45%, transparent); }
.sheet-title { text-align: center; font-size: 18px; margin-bottom: 4px; }
.g-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 12px; }
.g-text { min-width: 0; }
.g-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.g-prov { margin-top: 2px; font-size: 13px; color: var(--ich-sky); }
.fav-big { flex: none; width: 44px; height: 44px; border-radius: 14px; background: var(--ich-navy); display: flex; align-items: center; justify-content: center; }
.fav-big .heart { width: 22px; height: 22px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.btn { height: 52px; border-radius: 16px; font-weight: 700; font-size: 17px; display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; }
.btn.real { background: var(--ich-lime); color: var(--ich-oxford); }
.btn.fun { background: transparent; color: var(--ich-sky); border: 1.5px solid var(--ich-sky); }
.btn:disabled { opacity: .4; }
.fine { margin: 12px 0 0; text-align: center; font-size: 11px; color: var(--ich-sky); opacity: .8; }
.plist { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.plist .chip { height: 44px; justify-content: center; overflow: hidden; }
.field { width: 100%; height: 50px; margin-top: 8px; padding: 0 14px; border-radius: 16px; border: 1.5px solid transparent;
  background: var(--ich-navy); color: var(--ich-white); font: inherit; outline: none; }
.field:focus { border-color: var(--ich-sky); }

/* the game: full screen, a thin bar on top */
.player { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; background: #000; }
.player .bar { display: flex; align-items: center; gap: 12px; padding: max(8px, env(safe-area-inset-top)) 12px 8px; background: var(--ich-oxford); }
.player .x { width: 36px; height: 36px; border-radius: 12px; background: var(--ich-navy); display: flex; align-items: center; justify-content: center; }
.player .x svg, .search .clear svg { width: 20px; height: 20px; fill: none; stroke: var(--ich-sky); stroke-width: 2.2; stroke-linecap: round; }
.player .x svg { stroke: var(--ich-white); }
.p-title { flex: 1; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { border-radius: 10px; background: var(--ich-navy); padding: 2px 8px; font-size: 11px; font-weight: 700; color: var(--ich-sky); }
.p-wait { position: absolute; inset-inline: 0; top: 50%; text-align: center; color: var(--ich-sky); font-size: 14px; }
.p-wait .bolt { width: 36px; height: 36px; }
.player iframe { flex: 1; width: 100%; border: 0; background: transparent; position: relative; }

.toast { position: fixed; z-index: 70; inset-inline: 16px; bottom: max(16px, env(safe-area-inset-bottom)); padding: 12px 14px;
  border-radius: 14px; background: var(--ich-navy); color: var(--ich-white); font-size: 14px; text-align: center;
  border: 1px solid color-mix(in srgb, var(--ich-sky) 35%, transparent); }
