:root {
  color-scheme: light;
  --blue: #205ed7; --ink: #17314f; --muted: #52657a; --ground: #f1f7fc;
  --rail: #e8f1fa; --line: #d7e3ee; --mint: #c5eee5; --yellow: #f4cd62;
  --cream: #ffefc9; --lavender: #dce8ff; --header: 80px; --rail-width: 216px;
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft Yahei", sans-serif;
  background: var(--ground); color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--blue); }
h1, h2, h3, p { margin: 0; overflow-wrap: anywhere; }
h1, h2, h3 { line-height: 1.35; }
h1 { font-size: 32px; letter-spacing: -.025em; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.skip { position: fixed; left: 12px; top: 8px; z-index: 10; background: white; padding: 10px 14px; transform: translateY(-140%); }
.skip:focus { transform: none; }
.site-header { position: sticky; top: 0; z-index: 4; display: grid; align-items: center; grid-template-columns: 1fr minmax(250px, 420px) 1fr; gap: 24px; height: var(--header); padding: 0 30px; border-bottom: 1px solid var(--line); background: white; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; justify-self: start; white-space: nowrap; font-weight: 650; }
.brand strong { font-size: 28px; color: var(--blue); letter-spacing: -.06em; }
.brand-icon { display: grid; place-items: center; width: 29px; height: 29px; font-size: 17px; color: #174b9d; background: var(--yellow); border-radius: 9px; }
.search { display: flex; align-items: center; min-width: 0; background: #edf3f8; color: var(--muted); border-radius: 12px; padding-left: 13px; }
.search > span { font-size: 25px; line-height: 1; }
.search input { width: 100%; background: transparent; border: 0; padding: 10px; min-width: 0; height: 46px; color: var(--ink); }
.search button { border: 0; background: transparent; min-height: 44px; padding: 0 12px; white-space: nowrap; color: var(--blue); }
.account { justify-self: end; min-width: 0; }
#account { display: flex; align-items: center; gap: 8px; min-height: 44px; max-width: min(23vw, 230px); padding: 4px 8px; background: white; border: 0; }
#account-name { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.avatar, #account-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--cream); flex: none; }
.primary, .secondary, .text-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 17px; border: 1px solid transparent; border-radius: 10px; font-weight: 650; text-decoration: none; }
.primary { background: var(--blue); color: white; }
.primary:hover { background: #164daf; }
.secondary { background: white; border-color: var(--line); }
.secondary:hover, .text-button:hover { background: var(--rail); }
.text-button { color: var(--blue); background: transparent; }
.sidebar { position: fixed; top: var(--header); bottom: 0; left: 0; width: var(--rail-width); background: var(--rail); padding: 24px 18px; overflow: auto; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar p { padding: 20px 13px 8px; font-size: 13px; color: var(--muted); }
.nav-link { min-height: 44px; display: flex; align-items: center; gap: 11px; padding: 10px 13px; color: var(--ink); background: transparent; border: 0; border-radius: 12px; text-decoration: none; text-align: left; }
.nav-link[aria-current="page"], .nav-link[aria-pressed="true"] { background: var(--blue); color: white; font-weight: 700; }
.nav-link svg { width: 21px; height: 21px; flex: none; }
.mobile-nav { display: none; }
main { margin-left: var(--rail-width); padding: 30px 38px 24px; max-width: 1600px; }
.intro { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 24px; }
.intro p { margin-top: 8px; color: var(--muted); }
.sun { color: #8e660e; font-size: 44px; line-height: 1; padding-right: 14px; }
#featured { display: grid; grid-template-columns: 1.7fr 1fr; gap: 18px; margin-bottom: 32px; }
#featured.single { grid-template-columns: 1fr; }
.feature { background: var(--mint); display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 28px; border-radius: 16px; min-width: 0; }
.feature h2 { font-size: 29px; }
.feature p { margin: 8px 0 18px; color: #2a554e; }
.feature .primary { background: #135f52; }
.feature .cover { width: min(45%, 220px); aspect-ratio: 1; border-radius: 14px; }
.feature-copy { min-width: 0; }
.feature-small { text-align: left; padding: 14px; display: flex; gap: 13px; align-items: center; min-height: 100px; width: 100%; height: 100%; border: 0; border-radius: 16px; background: var(--lavender); }
.feature-small + .feature-small { background: var(--cream); }
.feature-small p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.feature-small .cover { width: 72px; height: 72px; border-radius: 10px; }
.feature-small:hover { filter: brightness(.97); }
.secondary-features { display: grid; gap: 14px; min-width: 0; }
.catalog-controls, .list-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.catalog-controls label { display: flex; gap: 6px; align-items: center; font-size: 13px; white-space: nowrap; }
#sort { min-height: 44px; border: 0; background: transparent; color: var(--ink); }
.filters { display: flex; gap: 8px; margin: 14px 0 10px; overflow: auto; scrollbar-width: thin; padding: 4px; }
.filters button { background: white; border: 0; border-radius: 10px; min-height: 44px; padding: 8px 15px; white-space: nowrap; }
.filters button[aria-pressed="true"] { background: var(--blue); color: white; }
.list-meta { margin: 3px 0 10px; color: var(--muted); font-size: 13px; min-height: 25px; }
.game-grid { display: grid; gap: 20px; grid-template-columns: repeat(4,minmax(0,1fr)); }
.card { position: relative; background: white; border-radius: 16px; border: 1px solid transparent; min-width: 0; }
.card:hover { border-color: #a8c0ed; }
.card-open { text-align: left; color: inherit; background: transparent; display: block; border: 0; width: 100%; height: 100%; padding: 0; border-radius: inherit; }
.cover { display: grid; place-items: center; flex: none; overflow: hidden; position: relative; isolation: isolate; background: var(--lavender); }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--lavender); }
.cover img.icon { object-fit: contain; padding: 12%; }
.card .cover { aspect-ratio: 1.58; border-radius: 15px 15px 0 0; }
.cover i { display: grid; place-content: center; color: #174b9d; background: #ffffffb9; border: 2px solid #fff; border-radius: 14px; transform: rotate(-7deg); width: 48%; aspect-ratio: 1.25; font-weight: 700; line-height: 1; font-size: clamp(19px,3vw,42px); font-style: normal; }
.card:nth-child(4n+2) .cover { background: var(--mint); }
.card:nth-child(4n+3) .cover { background: var(--cream); }
.card:nth-child(4n+4) .cover { background: #f3dfe9; }
.card-copy { padding: 13px 14px; }
.card-copy p, .card-copy small { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 12px; color: var(--muted); margin: 5px 0; }
.card-copy h3 { font-size: 17px; }
.favorite { display: inline-grid; place-content: center; width: 44px; height: 44px; border: 1px solid var(--line); background: white; border-radius: 50%; font-size: 20px; color: #28629f; }
.card > .favorite { position: absolute; right: 6px; top: 6px; }
.favorite[aria-pressed="true"] { background: #e7efff; color: var(--blue); }
.unavailable { opacity: .8; }
.unavailable .card-copy { min-height: 110px; }
.detail, .feedback, #profile { background: white; border: 1px solid var(--line); border-radius: 16px; padding: 22px; margin: 0 0 18px; }
.detail { position: relative; display: flex; align-items: start; gap: 22px; scroll-margin-top: calc(var(--header) + 12px); }
.detail .cover { align-self: stretch; width: 29%; aspect-ratio: 1.75; border-radius: 12px; }
.detail .detail-text { flex: 1 1 250px; min-width: 0; padding-right: 24px; }
.detail p, #profile p { margin: 8px 0; color: var(--muted); }
.detail .actions, .dialog-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-top: 14px; }
.detail .dismiss { position: absolute; right: 8px; top: 8px; padding: 8px 12px; }
.feedback { text-align: center; padding: 36px 18px; }
.feedback p { margin: 8px 0 16px; }
.more { display: flex; margin: 18px auto 0; }
.profile-links { display: grid; gap: 8px; margin: 18px 0; }
.profile-links button { justify-content: space-between; }
.footer { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 18px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--muted); }
.play-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.play-bar h1 { font-size: 23px; flex: 1; }
#play-status { margin: 10px 0; color: var(--muted); }
#viewport { width: 100%; height: min(70dvh, 720px); min-height: 340px; overflow: hidden; background: #e2f1eb; border-radius: 14px; }
#viewport iframe { width: 100%; height: 100%; display: block; border: 0; }
#viewport:fullscreen { height: 100%; border-radius: 0; }
#play-actions, #play-tips { margin-top: 14px; }
dialog { border: 1px solid var(--line); padding: 26px; border-radius: 17px; width: min(440px, calc(100% - 30px)); color: var(--ink); }
dialog p { margin-top: 10px; color: var(--muted); }
dialog::backdrop { background: #17314f78; }
.dialog-actions { justify-content: end; }
.toast { position: fixed; z-index: 5; bottom: 22px; left: 50%; transform: translateX(-50%); padding: 10px 16px; background: var(--ink); color: white; border-radius: 10px; max-width: calc(100% - 24px); }
@media (max-width: 1000px) {
  :root { --rail-width: 170px; }
  main { padding-inline: 24px; }
  .game-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
  #featured { grid-template-columns: 1fr; }
  .secondary-features { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 700px) {
  :root { --header: 116px; --rail-width: 0px; }
  .site-header { grid-template-columns: 1fr auto; padding: 8px 14px; gap: 4px 6px; }
  .brand { gap: 6px; font-size: 12px; }
  .brand strong { font-size: 24px; }
  .brand-icon { width: 25px; height: 25px; }
  .search { grid-column: 1/-1; grid-row: 2; }
  .account { grid-column: 2; grid-row: 1; }
  #account { max-width: 40vw; }
  #login { font-size: 12px; padding: 7px 10px; }
  .sidebar { display: none; }
  .mobile-nav { position: fixed; z-index: 4; inset: auto 0 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); background: white; border-top: 1px solid var(--line); padding: 6px 8px max(6px, env(safe-area-inset-bottom)); }
  .mobile-nav .nav-link { justify-content: center; flex-direction: column; padding: 5px; gap: 3px; font-size: 12px; min-height: 53px; }
  .mobile-nav .nav-link[aria-current="page"] { background: #e8efff; color: var(--blue); }
  main { padding: 22px 17px 88px; }
  h1 { font-size: 26px; } h2 { font-size: 19px; }
  .intro p { font-size: 13px; }
  .sun { font-size: 34px; padding-right: 2px; }
  #featured { gap: 10px; margin-bottom: 22px; }
  .feature { padding: 17px; min-height: 175px; gap: 12px; }
  .feature h2 { font-size: 23px; }
  .feature p { font-size: 13px; margin: 5px 0 12px; }
  .secondary-features { gap: 10px; }
  .feature-small { gap: 8px; min-height: 86px; padding: 10px; }
  .feature-small h3 { font-size: 14px; }
  .feature-small p { font-size: 12px; }
  .feature-small .cover { width: 43px; height: 43px; }
  .feature-small .cover i { font-size: 14px; }
  .game-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; }
  .card-copy { padding: 11px; } .card-copy h3 { font-size: 15px; }
  .detail { padding: 17px; }
  .detail .cover { display: none; }
  .play-bar h1 { font-size: 17px; } .play-bar button { padding: 6px 9px; font-size: 12px; }
  .toast { bottom: 76px; }
}
@media (max-width: 355px) {
  main { padding-inline: 12px; }
  .brand strong { font-size: 22px; }
  .feature-small .cover { width: 34px; height: 34px; }
  .feature-small p { display: none; }
}
