:root {
  color-scheme: dark;
  --bg: #15191b;
  --panel: #202528;
  --border: #343c40;
  --ink: #f4f6f5;
  --muted: #a5b0b0;
  --accent: #d6e8ac;
}
* { box-sizing: border-box; letter-spacing: 0; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
h1, h2, h3, p { margin: 0; }
.shell { width: min(1100px, calc(100% - 64px)); margin-inline: auto; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; }
.site-header { border-bottom: 1px solid var(--border); }
.header-inner { min-height: 80px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 30px; line-height: 1; font-weight: 750; white-space: nowrap; }
.brand-mark { display: grid; place-items: center; color: var(--accent); margin-right: 3px; }
.brand-mark .icon { width: 30px; height: 30px; }
.brand-dot { color: #ff875b; margin-left: -10px; }
.profile-button { display: inline-flex; align-items: center; gap: 9px; min-height: 44px; max-width: 205px; padding: 9px 13px; border: 1px solid var(--border); border-radius: 6px; background: transparent; color: var(--ink); font-size: 13px; }
.profile-button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-button .icon { width: 17px; height: 17px; }
.profile-button:hover, .dialog-close:hover { background: #ffffff09; }
.catalog { padding-block: 32px 40px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-heading h2 { font-size: 22px; line-height: 1.3; font-weight: 650; }
.game-count { font-size: 12px; color: var(--muted); white-space: nowrap; }
#game-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 22px; }
.game-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); }
.game-image { position: relative; aspect-ratio: 15 / 11; overflow: hidden; background: #243c37; }
.game-image img { display: block; width: 100%; height: 100%; object-fit: cover; }
.game-category { position: absolute; top: 12px; left: 12px; border-radius: 4px; padding: 4px 8px; background: #10241ee6; color: #e1f3c8; font-size: 10px; font-weight: 650; }
.game-content { padding: 18px; }
.game-content h3 { font-size: 22px; line-height: 1.3; font-weight: 650; overflow-wrap: anywhere; }
.game-content > p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; margin-top: 10px; color: var(--muted); font-size: 13px; line-height: 1.6; }
.game-tags { display: flex; flex-wrap: wrap; column-gap: 12px; row-gap: 4px; margin-top: 14px; font-size: 11px; color: #c3cdce; }
.game-actions { display: flex; align-items: center; gap: 12px; margin-top: 20px; }
.button { min-height: 44px; border: 0; border-radius: 6px; padding: 10px 15px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-size: 13px; font-weight: 650; }
.button-play { background: var(--accent); color: #18241c; }
.button-play:hover { background: #e2efc6; }
.button-play .icon { width: 17px; height: 17px; }
.join-link { display: inline-flex; justify-content: center; align-items: center; gap: 7px; min-height: 44px; padding: 5px 0; margin-left: auto; font-size: 12px; color: #d1dada; white-space: nowrap; }
.join-link:hover { color: var(--accent); }
.join-link .icon { width: 15px; height: 15px; }
.game-content .last-played { display: flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 11px; color: var(--accent); }
.last-played[hidden] { display: none; }
.last-played .icon { width: 14px; height: 14px; }
dialog { width: min(380px, calc(100% - 32px)); max-height: calc(100dvh - 32px); padding: 24px; overflow-y: auto; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); color: var(--ink); box-shadow: 0 20px 80px #0006; }
dialog::backdrop { background: #080d10c9; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 20px; font-weight: 650; }
.dialog-close { display: grid; place-items: center; width: 36px; height: 36px; margin: -6px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: var(--muted); }
#player-form { display: grid; gap: 14px; }
#player-name { min-width: 0; width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid #4c595b; border-radius: 6px; color: var(--ink); background: var(--bg); }
#player-name::placeholder { color: #8f9c9d; }
.guest-button { min-height: 40px; padding: 6px; border: 0; background: transparent; color: var(--muted); font-size: 12px; }
.guest-button:hover { color: var(--ink); }
.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; }
.skip-link { position: absolute; top: -80px; left: 16px; z-index: 10; padding: 12px; background: var(--accent); color: #18241c; }
.skip-link:focus { top: 12px; }
@media (max-width: 900px) {
  #game-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 68px; gap: 12px; }
  .brand { font-size: 26px; gap: 8px; }
  .brand-mark .icon { width: 26px; height: 26px; }
  .brand-dot { margin-left: -8px; }
  .profile-button { max-width: 172px; font-size: 12px; padding-inline: 10px; }
  .catalog { padding-block: 22px 28px; }
  .section-heading { margin-bottom: 16px; }
  .section-heading h2 { font-size: 20px; }
  #game-list { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .game-image { aspect-ratio: 16 / 10; }
  .game-content { padding: 16px; }
  .game-content > p { margin-top: 8px; }
  .game-tags { margin-top: 12px; }
  .game-actions { margin-top: 16px; }
}
@supports (padding: max(0px)) {
  body { padding-inline: env(safe-area-inset-left) env(safe-area-inset-right); }
  .site-header { padding-top: env(safe-area-inset-top); }
  .catalog { padding-bottom: max(28px, env(safe-area-inset-bottom)); }
}
