:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #080b14;
  color: #f1f4fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; min-height: 100vh; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.site-header { border-bottom: 1px solid #1b2233; background: #0b101c; }
.header-inner { max-width: 1240px; margin: auto; padding: 24px 40px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { flex: 0 0 auto; display: block; width: 240px; border-radius: 8px; }
.brand img { display: block; width: 100%; height: auto; }
.header-controls { display: flex; align-items: center; gap: 16px; min-width: 0; }
.search-field { width: clamp(200px, 28vw, 340px); min-width: 0; height: 46px; display: flex; gap: 12px; align-items: center; padding: 0 15px; border: 1px solid #293349; border-radius: 12px; background: #141b2a; }
.search-field svg { width: 19px; height: 19px; flex-shrink: 0; fill: none; stroke: #8c9ab3; stroke-width: 1.8; stroke-linecap: round; }
.search-field:focus-within { border-color: #20c5ff; box-shadow: 0 0 0 3px #20c5ff20; }
.search-field input { min-width: 0; width: 100%; color: #f1f4fc; background: transparent; border: 0; outline: 0; font-size: 14px; }
.search-field input::placeholder { color: #99a6bd; opacity: 1; }
.account-button { width: 44px; height: 44px; border: 1px solid #293349; border-radius: 50%; background: #141b2a; color: #99a6bd; flex-shrink: 0; }
.account-button svg { width: 22px; height: 22px; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.account-button { cursor: pointer; }
.account-button:hover, .account-button.is-authenticated { color: #25c8ff; border-color: #25c8ff; }
.account-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.account-panel { width: min(360px, calc(100vw - 24px)); max-height: calc(100dvh - 32px); padding: 24px; border: 1px solid #293349; border-radius: 16px; background: #111827; color: #f1f4fc; box-shadow: 0 16px 64px #0009; }
.account-panel::backdrop { background: #030816b8; }
.account-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.account-heading h2 { margin: 0; font-size: 20px; }
#account-close { width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: #a6b2c9; font-size: 25px; cursor: pointer; }
#account-content, #account-form { display: flex; flex-direction: column; gap: 14px; }
#account-form label { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #a6b2c9; }
#account-form input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #293349; border-radius: 10px; background: #141b2a; color: #f1f4fc; }
.account-primary, .account-secondary { min-height: 44px; padding: 10px 14px; border: 1px solid #293349; border-radius: 10px; background: #141b2a; color: #f1f4fc; cursor: pointer; }
.account-primary { border-color: #73e0ff; background: #19beef; color: #061424; font-weight: 700; }
.account-primary:hover { background: #65dcff; }
.account-secondary:hover, #account-close:hover { background: #23364c; }
.account-panel button:focus-visible, .account-panel input:focus-visible { outline: 2px solid #25c8ff; outline-offset: 3px; }
.account-panel :disabled { opacity: .6; cursor: wait; }
.account-message { margin: 0; font-size: 14px; line-height: 1.5; color: #a6b2c9; overflow-wrap: anywhere; }
#account-email { margin: 0 0 8px; overflow-wrap: anywhere; }
.catalog { max-width: 1240px; margin: auto; padding: 40px 40px 64px; }
.game-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px 24px; }
.game-card { position: relative; min-width: 0; background: #111827; border: 1px solid #253048; border-radius: 16px; overflow: hidden; box-shadow: 0 8px 24px #00000020; transition: border-color 160ms ease, box-shadow 160ms ease; }
.game-card:hover { border-color: #536782; }
.game-card.is-selected { border-color: #25c8ff; box-shadow: 0 0 0 1px #25c8ff, 0 8px 28px #00aaff14; }
.card-select { position: absolute; inset: 0; z-index: 1; background: transparent; border: 0; padding: 0; cursor: pointer; border-radius: inherit; }
.thumbnail { position: relative; aspect-ratio: 8 / 5; overflow: hidden; background: #152039; }
.thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; transition: filter 180ms ease, transform 180ms ease; }
.thumbnail::after { content: ''; position: absolute; inset: 0; background: #030816; opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
.is-selected .thumbnail img { filter: blur(5px); transform: scale(1.045); }
.is-selected .thumbnail::after { opacity: .58; }
.play-button { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2; min-height: 44px; min-width: 104px; padding: 12px 24px; border: 1px solid #73e0ff; border-radius: 10px; background: #19beef; color: #061424; font-size: 15px; font-weight: 850; letter-spacing: .09em; cursor: pointer; box-shadow: 0 6px 24px #00baff40; }
.play-button:hover { background: #65dcff; }
.play-button:active { background: #11aeda; }
.game-name { margin: 0; padding: 18px 20px 19px; font-size: 18px; font-weight: 650; line-height: 1.3; overflow-wrap: anywhere; }
.brand:focus-visible, .play-button:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.card-select:focus-visible { outline: 3px solid #fff; outline-offset: -4px; }
.empty-state { margin: 64px 0; text-align: center; color: #a6b2c9; font-size: 15px; }
.runtime-active { overflow: hidden; }
.runtime-active > .site-header, .runtime-active > .catalog { display: none; }
.runtime { position: fixed; inset: 0; width: 100%; height: 100%; height: 100dvh; z-index: 10; overflow: hidden; background: #080b14; }
.runtime:fullscreen { width: 100%; height: 100%; }
.runtime-stage, .game-frame { width: 100%; height: 100%; }
.runtime-stage { position: absolute; inset: 0; }
.game-frame { display: block; border: 0; background: #080b14; }
.runtime-screen { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; background: #080b14; }
.runtime-icon { width: 64px; height: 64px; object-fit: contain; }
.loading-indicator { width: 22px; height: 22px; border: 2px solid #21334a; border-top-color: #21c9f7; border-radius: 50%; animation: rushy-spin 800ms linear infinite; }
@keyframes rushy-spin { to { transform: rotate(360deg); } }
.runtime-back { position: absolute; top: max(8px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; border: 1px solid #62758a80; border-radius: 10px; background: #0b1423d9; color: #eaf4ff; font-size: 12px; cursor: pointer; }
.runtime-back img { width: 24px; height: 24px; }
.runtime-back:hover { background: #1b2d42; }
.recovery-controls { display: flex; gap: 16px; }
.recovery-controls button { min-width: 96px; min-height: 44px; padding: 12px 20px; border: 1px solid #38caf5; border-radius: 10px; background: #141f31; color: #eaf4ff; font-weight: 700; cursor: pointer; }
.recovery-controls button:hover { background: #23364c; }
.runtime button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.rotate-icon { width: 64px; height: 64px; color: #21c9f7; }
#rotate-message { margin: 0 24px; text-align: center; font-size: 18px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
@media (max-width: 760px) {
  .header-inner { padding: 18px 20px; gap: 20px; }
  .brand { width: 190px; }
  .header-controls { gap: 10px; }
  .search-field { width: 220px; }
  .catalog { padding: 28px 20px 48px; }
  .game-grid { gap: 18px 14px; }
  .game-card { border-radius: 12px; }
  .game-name { font-size: 15px; padding: 14px 12px; }
}
@media (max-width: 560px) {
  .header-inner { padding: 14px 12px 16px; display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 10px 12px; }
  .brand { width: 174px; grid-column: 1; grid-row: 1; }
  .header-controls { display: contents; }
  .account-button { width: 36px; height: 36px; grid-column: 2; grid-row: 1; }
  .search-field { width: 100%; height: 42px; grid-column: 1 / -1; grid-row: 2; border-radius: 10px; }
  .catalog { padding: 20px 12px 40px; }
  .game-grid { gap: 14px 8px; }
  .game-card { border-radius: 10px; }
  .game-name { font-size: clamp(11px, 3vw, 14px); padding: 11px 7px 12px; min-height: 52px; }
  .play-button { min-width: 64px; min-height: 44px; padding: 8px 10px; font-size: 12px; border-radius: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .loading-indicator { animation: none; }
}
