/* Falak apps — shared look for falaklabs.com/apps/. Loaded after games/shared/arcade.css (brand tokens, buttons, panels). */

body.app {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(100% 50% at 50% -10%, rgba(36, 64, 184, 0.45), rgba(10, 20, 64, 0) 70%),
    var(--lapis);
  color: var(--parchment);
  overflow-x: hidden;
}
@supports (overflow-x: clip) { body.app { overflow-x: clip; } }
.app-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  height: calc(56px + var(--safe-t));
  padding: var(--safe-t) max(8px, var(--safe-r)) 0 max(8px, var(--safe-l));
  background: rgba(10, 20, 64, 0.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--hairline);
}
.app-bar h1 { flex: 1; margin: 0; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.app-lang { min-height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(242, 234, 216, 0.08); color: var(--parchment); font-weight: 600; cursor: pointer; }
.app-main { max-width: 640px; margin: 0 auto; padding: 18px max(16px, var(--safe-l)) calc(40px + var(--safe-b)) max(16px, var(--safe-r)); }
.app-intro { margin: 0 0 18px; color: var(--mist); }
.app-card {
  margin: 0 0 14px;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(20, 34, 95, 0.9), rgba(12, 23, 72, 0.9));
  box-shadow: inset 0 0 0 1px var(--hairline);
}
.app-card h2 { margin: 0 0 10px; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; }
.app-card h3 { margin: 0 0 6px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); }
html[lang="ar"] .app-card h3 { letter-spacing: 0; text-transform: none; font-size: 0.95rem; }
.app-note { font-size: 0.86rem; color: var(--mist-dim); margin: 10px 0 0; }
.app-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.app-row > * { flex: 1 1 140px; }
.app-field { display: grid; gap: 6px; margin: 0 0 12px; font-size: 0.9rem; color: var(--mist); }
.app-field input, .app-field select, .app-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  border: 0;
  border-radius: 14px;
  background: rgba(7, 13, 44, 0.75);
  box-shadow: inset 0 0 0 1px rgba(242, 234, 216, 0.16);
  color: var(--parchment);
  font: inherit;
  font-size: 1rem;
}
.app-field textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
.app-field input:focus, .app-field select:focus, .app-field textarea:focus { outline: none; box-shadow: inset 0 0 0 2px var(--gold); }
.app-field select option { background: #0A1440; }
.app-big {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 12vw, 4.4rem);
  line-height: 1;
  color: var(--gold-soft);
  font-variant-numeric: tabular-nums;
}
.app-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.app-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(242, 234, 216, 0.05); }
.app-list li b { font-variant-numeric: tabular-nums; font-size: 1.1rem; }
.app-list li.is-next { background: rgba(232, 182, 90, 0.16); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.5); }
.app-list li.is-next b { color: var(--gold-soft); }
.app-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.app-pill { min-height: 40px; padding: 0 16px; border: 0; border-radius: 999px; background: rgba(242, 234, 216, 0.07); color: var(--parchment); font: inherit; font-weight: 600; cursor: pointer; }
.app-pill[aria-pressed="true"] { background: var(--gold); color: var(--lapis); }
.app-footer { max-width: 640px; margin: 0 auto; padding: 20px max(16px, var(--safe-l)) calc(26px + var(--safe-b)); color: var(--mist-dim); font-size: 0.86rem; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.app-footer a { color: var(--mist); text-decoration: none; }
.app-footer a:hover { color: var(--gold-soft); }
.app-privacy { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 16px; background: rgba(71, 194, 133, 0.1); color: var(--mist); font-size: 0.88rem; }
.app-privacy svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--emerald); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 1px; }

/* apps hub */
.apps-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 640px) { .apps-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 980px) { .apps-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.apps-card a {
  display: flex; flex-direction: column; gap: 4px; height: 100%;
  padding: 8px 8px 14px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(20, 34, 95, 0.9), rgba(12, 23, 72, 0.9));
  box-shadow: inset 0 0 0 1px var(--hairline);
  color: var(--parchment); text-decoration: none;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.apps-card a:hover { transform: translateY(-3px); box-shadow: inset 0 0 0 1px rgba(232, 182, 90, 0.45), 0 16px 34px rgba(0, 0, 0, 0.3); }
.apps-card img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 12px; margin-bottom: 6px; }
.apps-card .k { padding: 0 4px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent, var(--gold)); }
html[lang="ar"] .apps-card .k { letter-spacing: 0; font-size: 0.8rem; }
.apps-card .n { padding: 0 4px; font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; line-height: 1.1; }
.apps-card .t { padding: 0 4px; font-size: 0.86rem; color: var(--mist); }
.apps-hero { max-width: 1200px; margin: 0 auto; padding: clamp(24px, 6vw, 70px) max(16px, 4vw) 22px; }
.apps-hero h1 { margin: 6px 0 10px; font-family: var(--font-display); font-size: clamp(2.1rem, 1.4rem + 4vw, 3.6rem); line-height: 1.06; font-weight: 600; text-wrap: balance; }
html[lang="ar"] .apps-hero h1 { line-height: 1.3; }
.apps-hero p { max-width: 38em; color: var(--mist); font-size: 1.08rem; }
.apps-wrap { max-width: 1200px; margin: 0 auto; padding: 0 max(16px, 4vw) 40px; }
