/* Shared visual refinement for the local FbGame review build. */
:root {
  --ui-line: rgba(126, 162, 207, .2);
  --ui-line-strong: rgba(92, 222, 240, .42);
  --ui-shadow: 0 18px 48px rgba(0, 0, 0, .24);
  --ui-shadow-hover: 0 22px 56px rgba(0, 0, 0, .34);
  --ui-focus: #75ecff;
}

html { scroll-behavior: smooth; }
body { text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { line-height: 1.3; text-wrap: balance; }
p { text-wrap: pretty; }
a { text-underline-offset: .2em; }

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--ui-focus, #75ecff) !important;
  outline-offset: 3px !important;
}
:where(button, a, input, select, textarea) { -webkit-tap-highlight-color: transparent; }
:where(button, .btn, .button, .game-button, .btn-submit) {
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease, border-color .18s ease;
}
:where(button:not(:disabled), .btn, .button, .game-button, .btn-submit):active {
  transform: translateY(1px) scale(.99);
}

:is(.hub-nav, .gh-gamebar, .topbar, .realm-nav, .cup-nav, .navbar, body.home-v2 > nav) {
  border-bottom-color: var(--ui-line-strong, rgba(92, 222, 240, .42));
  box-shadow: 0 10px 32px rgba(0, 0, 0, .2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
:where(.hub-nav, .site-links, .admin-links, .home-quick, .tabs, .filter-group) {
  scrollbar-width: thin;
  scrollbar-color: rgba(105, 137, 180, .56) transparent;
}
:is(.hub-nav a, .gh-gamebar a, .site-links a, .admin-links a, .home-quick a) {
  text-decoration: none;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
:is(.hub-nav a, .gh-gamebar a, .site-links a, .admin-links a):hover {
  text-decoration: none;
}

:is(.hero, .panel, .card, .stat, .stat-card, .stat-box, .metric, .chart, .table-card,
  .admin-hub-card, .identity-card, .games-panel, .quick-grid article, .store-item,
  .game-card, .settings-card, .status-card, .game-stat, .form-card, .login-container,
  .box, .spectator-panel, .settings-panel, .game-panel) {
  box-shadow: var(--ui-shadow, 0 18px 48px rgba(0,0,0,.24));
}
:is(.card, .stat-card, .stat-box, .metric, .admin-hub-card, .store-item, .game-card,
  .status-card, .game-stat, .quick-grid article) {
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
:is(.card, .admin-hub-card, .store-item, .game-card, .status-card, .game-stat):hover {
  border-color: var(--ui-line-strong, rgba(92, 222, 240, .42));
  box-shadow: var(--ui-shadow-hover, 0 22px 56px rgba(0,0,0,.34));
}
:is(.admin-hub-card, .store-item, .game-card):hover { transform: translateY(-3px); }

:where(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea) {
  color-scheme: dark;
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}
:is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea):focus {
  border-color: var(--ui-focus, #75ecff) !important;
  box-shadow: 0 0 0 3px rgba(87, 220, 242, .13);
}
:where(label, .field-label, .setting, .group) { line-height: 1.65; }
:where(.notice, .msg, .empty, .empty-store, .home-empty) { line-height: 1.75; }
:where(.panel, .card, .hero, .settings-card, .form-card) > :where(h1, h2, h3):first-child { margin-top: 0; }

@media (max-width: 760px) {
  html { scroll-padding-top: 68px; }
  :where(.hero, .panel, .card, .settings-card, .form-card, .login-container, .box) {
    border-radius: 16px;
  }
  :where(.hub-nav, .site-links, .admin-links, .home-quick, .tabs, .filter-group) {
    overscroll-behavior-inline: contain;
  }
  :where(.table, table) { font-size: .94em; }
  :where(.wrap, .profile-shell, .store-wrap, .analytics, .streamer-admin, .content-admin, .admin-container) {
    padding-bottom: max(28px, env(safe-area-inset-bottom));
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; }
  :where(button, .btn, .button, .game-button, .btn-submit, .card, .store-item, .game-card) {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
  }
}

/* FbGame interface system: consistent spacing, clear actions, and readable panels. */
:root{--fb-line:#30415f;--fb-line-soft:#263751;--fb-text:#f3f7ff;--fb-muted:#b1bfd3;--fb-cyan:#67e8f9;--fb-violet:#9b83ff}
body{color:var(--fb-text);line-height:1.65;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased}
:where(main,.wrap,.page,.shell,.container,.profile-shell,.store-wrap,.admin-container){min-width:0}
:where(h1,h2,h3,h4){text-wrap:balance;line-height:1.35}
:where(.muted,.hint,.note,.subtitle,.section-subtitle){color:var(--fb-muted)}
:where(.panel,.card,.hero,.settings-card,.form-card,.host-panel,.spectator-panel,.arena-panel,.board-panel,.game-panel){border-color:var(--fb-line);box-shadow:0 16px 42px #0004,inset 0 1px #ffffff08}
:where(button,.btn,.button,.primary,.secondary,.game-button){touch-action:manipulation;transition:transform .18s ease,filter .18s ease,border-color .18s ease,box-shadow .18s ease}
:where(button:not(:disabled),.btn,.button,.primary,.secondary,.game-button):hover{filter:brightness(1.08)}
:where(button:not(:disabled),.btn,.button,.primary,.secondary,.game-button):active{transform:translateY(1px) scale(.99)}
:where(button:disabled,[aria-disabled="true"]){cursor:not-allowed;filter:saturate(.65)}
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){font-size:16px;line-height:1.5}
:where(input,select,textarea,button,a,summary,[tabindex]):focus-visible{outline:3px solid var(--fb-cyan);outline-offset:3px}
:where(.notice,.status,.feedback,.turn-banner,.connection-state){line-height:1.7;overflow-wrap:anywhere}
:where(.empty,.empty-roster,.home-empty){border-style:dashed}
:where(.table,table){font-variant-numeric:tabular-nums}
.game-card{min-width:0}
.game-card :where(h3,p){overflow-wrap:anywhere}
/* Home: streamer games read as a dedicated live-games shelf. */
#streamer-games{position:relative;isolation:isolate;width:min(1440px,100%);padding:clamp(25px,5vw,58px) clamp(14px,4vw,48px)}
#streamer-games:before{content:"";position:absolute;inset:0 10px auto;height:1px;background:linear-gradient(90deg,transparent,#57deed77,#9b79ff77,transparent);pointer-events:none}
#streamer-games>h2{display:flex;align-items:center;gap:12px}
#streamer-games .games-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:18px}
#streamer-games .game-card{position:relative;border:1px solid #34425e;border-radius:20px;background:linear-gradient(155deg,#141e31,#0b1220);box-shadow:0 14px 36px #0005;transition:transform .22s,border-color .22s,box-shadow .22s}
#streamer-games .game-card:hover{transform:translateY(-4px);border-color:#65e5ed;box-shadow:0 20px 48px #0007,0 0 22px #54ddea20}
#streamer-games .game-img{height:clamp(145px,17vw,205px);font-size:clamp(48px,5vw,66px)}
#streamer-games .game-img:after{content:"لعبة تفاعلية من الشات";position:absolute;inset:auto 12px 12px auto;z-index:2;padding:5px 9px;border:1px solid #ffffff30;border-radius:99px;background:#07101dcc;color:#eafaff;font:700 11px/1.3 Tahoma,Arial,sans-serif;backdrop-filter:blur(8px)}
#streamer-games .game-info{padding:18px;gap:15px}
#streamer-games .game-info>div:first-child{display:grid;align-content:start;gap:8px}
#streamer-games .game-badges{margin-bottom:2px}
#streamer-games .game-badge{box-shadow:none;border:1px solid #ff7e9a55;background:#3b1724;color:#ffdbe5}
#streamer-games .game-badge.credit{background:#342918;color:#ffe7a3;border-color:#f2c35c55}
#streamer-games .game-badge.paused{background:#263246;color:#dce5f2;border-color:#71839e55}
#streamer-games .game-info h3{margin:2px 0;color:#f6f8ff;font-size:clamp(18px,2vw,22px)}
#streamer-games .game-info p{margin:0;color:#b6c4d8;font-size:14px;line-height:1.85}
#streamer-games .game-button{min-height:48px;border-radius:13px;box-shadow:0 8px 22px #050a1480}
#streamer-games .game-status-message{margin:0}
@media(max-width:760px){#streamer-games{padding:30px 12px}#streamer-games .games-grid{grid-template-columns:repeat(auto-fit,minmax(min(100%,235px),1fr));gap:12px}#streamer-games .game-img{height:150px}#streamer-games .game-info{padding:15px}}
@media(prefers-reduced-motion:reduce){:where(button,.btn,.button,.primary,.secondary,.game-button,.game-card){transition:none!important}}
