@font-face {
  font-family: "Outfit";
  src: url("assets/outfit.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #252436;
  --muted: #686174;
  --purple: #6848ed;
  --purple-hover: #5635d4;
  --purple-light: #f0edff;
  --lime: #d6fc72;
  --bg: #f8f7f3;
  --surface: #fffefa;
  --border: #e4e0e7;
  --radius: 16px;
  --focus: #6848ed;
  --ease: cubic-bezier(.16, 1, .3, 1);
  font-family: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  color: var(--ink);
  background: var(--bg);
  font-synthesis: none;
  accent-color: var(--purple);
  caret-color: var(--purple);
  text-underline-offset: .2em;
}

* { box-sizing: border-box; }
body { margin: 0; font-size: 14px; line-height: 1.5; overflow-x: clip; }
button, input, select { font: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { border: 0; color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
button:active:not(:disabled) { transform: translateY(1px); }
svg { display: block; width: 20px; height: 20px; flex-shrink: 0; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--lime); }
::placeholder { color: var(--muted); opacity: 1; }
h1, h2, h3 { text-wrap: balance; }

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 10px;
  color: white;
  background: var(--ink);
}
.skip-link:focus { top: 12px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Navigation and the app shell */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  width: 296px;
  max-width: calc(100vw - 38px);
  padding: 24px 20px 20px;
  border-right: 1px solid var(--border);
  background: var(--surface);
  overflow-y: auto;
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform 230ms var(--ease), visibility 230ms;
}
.sidebar.open { transform: translateX(0); visibility: visible; }
.sidebar-header, .sidebar-nav, .sidebar-install, .sidebar-foot { flex-shrink: 0; }
.sidebar-header { display: flex; align-items: center; gap: 12px; }
.sidebar .brand { display: flex; flex: 1; align-items: center; gap: 12px; min-width: 0; margin: 0; padding: 0; }
.sidebar .brand > div { min-width: 0; }
.sidebar .brand img { width: 40px; height: 40px; border-radius: 12px; }
.sidebar .brand strong { display: block; overflow: hidden; color: var(--ink); font-size: 20px; font-weight: 650; line-height: 1.2; letter-spacing: -.02em; white-space: nowrap; text-overflow: ellipsis; }
.sidebar .brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 400; line-height: 1.5; letter-spacing: 0; }
.sidebar .sidebar-close { position: static; display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 10px; color: var(--muted); background: transparent; }
.sidebar-close:hover { color: var(--ink); background: var(--purple-light); }
.sidebar-close svg { width: 20px; height: 20px; }
.sidebar-nav { margin-top: 24px; }
.nav-label { margin: 24px 12px 8px; color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.5; letter-spacing: 0; }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  background: transparent;
  transition: background-color 160ms, color 160ms;
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:hover { color: var(--purple-hover); background: var(--purple-light); }
.nav-item.active { color: white; background: var(--purple); }
.nav-badge { min-width: 24px; margin-left: auto; padding: 2px 6px; border-radius: 6px; font-size: 11px; line-height: 1.5; font-variant-numeric: tabular-nums; text-align: center; background: #ffffff14; }
.sidebar-install { position: relative; display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin-top: 24px; padding: 12px 16px 16px; border: 0; border-radius: 16px; background: var(--purple-light); }
.sidebar-character { position: relative; display: grid; place-items: center; height: 144px; margin: -4px -8px 4px; }
.sidebar-character > img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; transform-origin: 50% 75%; animation: arcade-crew-float 5.6s ease-in-out infinite; animation-play-state: paused; }
.sidebar.open[data-motion-paused="false"] .sidebar-character > img { animation-play-state: running; }
.sidebar-install-copy { min-width: 0; }
.sidebar-install h3 { margin: 0; color: var(--ink); font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -.02em; }
.sidebar-install p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.sidebar-install > button { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; margin-top: 4px; padding: 10px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--button-ink); background: var(--button-bg); }
.sidebar-install > button:hover { background: var(--button-hover); }
.sidebar-install > button svg { width: 17px; height: 17px; }
@keyframes arcade-crew-float { 0%,100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-6px) rotate(1deg); } }
@media(max-height:700px) { .sidebar-character { height: 96px; margin-top: 0; } .sidebar-install { padding-top: 8px; } }
@media(prefers-reduced-motion:reduce) { .sidebar-character > img { animation: none; transform: none; } }
.sidebar-foot { display: flex; align-items: center; gap: 16px; margin: 16px 12px 0; color: var(--muted); }
.sidebar-foot button { min-height: 44px; padding: 8px 0; border-radius: 4px; color: inherit; background: transparent; font-size: 12px; font-weight: 400; }
.sidebar-foot button:hover { color: var(--purple-hover); text-decoration: underline; text-underline-offset: 4px; }
.page-shell { margin-left: 0; min-width: 0; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 94px;
  padding: 20px 36px;
  border-bottom: 1px solid var(--border);
}
.top-title { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 14px; font-weight: 600; }
.top-title-copy { min-width: 0; }
.top-title-copy span { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; white-space: nowrap; }
.top-dot { width: 6px; height: 6px; flex-shrink: 0; border-radius: 50%; background: var(--purple); }
.top-actions { display: flex; align-items: center; gap: 12px; min-width: 0; }
.search-box { position: relative; display: block; width: 286px; min-width: 0; }
.search-box > svg { position: absolute; top: 14px; left: 14px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-box input { display: block; width: 100%; min-height: 46px; border: 1px solid var(--border); border-radius: 12px; padding: 11px 38px 11px 42px; color: var(--ink); background: var(--surface); font-size: 14px; line-height: 1.5; }
.search-box input:hover { border-color: #b8aec9; }
.search-box input:focus { border-color: var(--purple); }
.search-key { position: absolute; right: 13px; top: 13px; padding: 1px 5px; border: 1px solid var(--border); border-radius: 5px; font-size: 11px; color: var(--muted); pointer-events: none; }
.lang-button { display: flex; align-items: center; justify-content: center; gap: 7px; min-width: 78px; min-height: 44px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px; font-size: 13px; font-weight: 600; background: var(--surface); }
.lang-button:hover { border-color: #b8aec9; background: var(--purple-light); }
.lang-button svg { width: 17px; height: 17px; }
.icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 10px; border-radius: 10px; background: transparent; }
.icon-button:hover { color: var(--purple-hover); background: var(--purple-light); }
.mobile-menu { display: inline-flex; flex-shrink: 0; width: 46px; height: 46px; padding: 11px; border: 1px solid #17171b; border-radius: 9px; color: white; background: #17171b; }
.mobile-menu:hover { color: white; background: #34343c; }
.mobile-menu svg { width: 23px; height: 23px; stroke-width: 2.2; }
.mobile-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-size: 20px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
.mobile-brand img { width: 30px; height: 30px; border-radius: 9px; }
.top-title-copy { display: none; }
main { max-width: 1640px; min-height: calc(100vh - 184px); margin: auto; padding: 30px 36px 0; }
main:focus { outline: none; }

/* The welcome stays recognizable; the games remain the primary destination. */
.hero-row { display: grid; grid-template-columns: minmax(0, 1fr) 248px; gap: 20px; margin-bottom: 34px; }
.hero { position: relative; min-height: 272px; padding: 30px 32px; overflow: hidden; border-radius: var(--radius); background: var(--lime); }
.hero::after { content: ""; position: absolute; width: 310px; height: 310px; right: 15px; top: -19px; border: 1px solid #8fab426b; border-radius: 50%; pointer-events: none; }
.hero h1 { position: relative; z-index: 2; max-width: 60%; margin: 0 0 13px; font-size: 42px; font-weight: 700; line-height: 1.16; letter-spacing: -.035em; }
.hero h1 em { color: var(--purple-hover); font-style: normal; }
.hero p { position: relative; z-index: 2; max-width: 58%; margin: 0 0 22px; font-size: 14px; line-height: 1.7; color: #37481d; }
.primary-button { position: relative; z-index: 2; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 12px 18px; border-radius: 10px; background: var(--ink); color: white; font-size: 14px; font-weight: 600; line-height: 1.4; transition: background-color 160ms; }
.primary-button:hover { background: #41394f; }
.primary-button svg { width: 18px; height: 18px; }
.hero-art { position: absolute; z-index: 1; right: 20px; top: 24px; width: 42%; height: 215px; pointer-events: none; }
.floating-card { position: absolute; top: 12px; left: 0; width: 138px; height: 163px; overflow: hidden; border: 6px solid white; border-bottom-width: 24px; border-radius: 14px; background: var(--purple); box-shadow: 0 14px 26px #52632626; transform: rotate(-12deg); }
.floating-card svg { width: 100%; height: 100%; }
.floating-card.second { top: 54px; left: 94px; background: #ffc3c4; transform: rotate(13deg); }
.floating-star { position: absolute; top: 0; right: 2px; color: var(--purple); }
.floating-star svg { width: 35px; height: 35px; fill: currentColor; stroke: none; }
.hero-note { position: absolute; z-index: 3; right: 22px; bottom: 18px; display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 8px; color: #3c4c24; background: #eaffba; font-size: 11px; font-weight: 500; }
.hero-note svg { width: 13px; height: 13px; }
.random-panel { position: relative; min-height: 272px; padding: 26px; overflow: hidden; border-radius: var(--radius); color: white; background: var(--purple); }
.random-icon { display: flex; align-items: center; justify-content: center; width: 66px; height: 66px; margin: 0 0 27px; color: var(--lime); }
.random-icon svg { width: 52px; height: 52px; transform: rotate(-10deg); }
.random-panel h2 { margin: 0 0 10px; font-size: 23px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
.random-panel p { max-width: 165px; margin: 0; font-size: 13px; line-height: 1.6; color: #f4efff; }
.random-panel button { position: absolute; right: 22px; bottom: 22px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--ink); background: var(--lime); transition: background-color 160ms; }
.random-panel button:hover { background: #e6ffab; }
.random-panel button:focus-visible { outline-color: white; }
.random-panel button svg { width: 20px; height: 20px; }

/* Game discovery */
.section-top { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 17px; }
.section-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.section-top h2 { margin: 0; font-size: 25px; font-weight: 650; line-height: 1.25; letter-spacing: -.025em; }
.section-title > span { flex-shrink: 0; padding: 3px 8px; border-radius: 6px; background: #eae7ee; color: #5f566c; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sort-select { min-height: 44px; max-width: 154px; padding: 10px 5px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; }
.filter-row { display: flex; align-items: center; gap: 9px; margin: 0 0 24px; padding: 4px 0; overflow-x: auto; }
.sidebar, .filter-row { scrollbar-width: thin; scrollbar-color: #b8a9d3 transparent; }
.sidebar::-webkit-scrollbar { width: 5px; }
.filter-row::-webkit-scrollbar { height: 4px; }
.sidebar::-webkit-scrollbar-track, .filter-row::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb, .filter-row::-webkit-scrollbar-thumb { border-radius: 8px; background: #b8a9d3; }
.filter-pill { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 16px; border: 1px solid var(--border); border-radius: 24px; color: var(--muted); background: var(--surface); font-size: 13px; font-weight: 500; white-space: nowrap; transition: color 160ms, background-color 160ms, border-color 160ms; }
.filter-pill svg { width: 16px; height: 16px; }
.filter-pill:hover { color: var(--purple-hover); border-color: #b8aec9; }
.filter-pill.active { color: white; border-color: var(--ink); background: var(--ink); }
.game-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px 20px; }
.game-card { position: relative; min-width: 0; }
.card-open { display: block; width: 100%; padding: 0; border-radius: 16px; background: transparent; text-align: left; }
.art-wrap { position: relative; aspect-ratio: 4 / 3; overflow: hidden; isolation: isolate; border-radius: 16px; background: var(--purple-light); transition: transform 240ms var(--ease), box-shadow 240ms var(--ease); }
.art-wrap > svg { width: 100%; height: 100%; transition: transform 320ms var(--ease); }
.card-open:hover .art-wrap, .card-open:focus-visible .art-wrap { transform: translateY(-3px); box-shadow: 0 12px 24px #2c244d18; }
.card-open:hover .art-wrap > svg { transform: scale(1.035); }
.game-label { position: absolute; top: 12px; left: 12px; max-width: calc(100% - 76px); padding: 5px 8px; border-radius: 6px; color: #3e354d; background: #fffefa; font-size: 10px; font-weight: 650; line-height: 1.3; letter-spacing: .02em; }
.game-label.lime { background: var(--lime); }
.card-play { position: absolute; right: 12px; bottom: 12px; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; color: var(--ink); background: var(--surface); }
.card-play svg { width: 15px; height: 15px; margin-left: 2px; }
.favorite-btn { position: absolute; z-index: 3; top: 10px; right: 10px; display: grid; place-items: center; width: 44px; height: 44px; padding: 12px; border-radius: 12px; color: #6d627a; background: #fffefaf2; transition: color 160ms, background-color 160ms; }
.favorite-btn svg { width: 20px; height: 20px; }
.favorite-btn:hover { color: #b23a5e; background: #fff0f4; }
.favorite-btn.saved { color: #b23a5e; background: #fff0f4; }
.favorite-btn.saved svg { fill: currentColor; }
.card-meta { padding: 14px 2px 0; }
.card-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-meta h3 { min-width: 0; margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.015em; line-height: 1.4; overflow-wrap: anywhere; }
.device-icons { display: flex; flex-shrink: 0; gap: 5px; color: var(--muted); }
.device-icons svg { width: 13px; height: 13px; }
.card-meta p { margin: 5px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.card-meta .card-description { min-height: 2.8em; margin-top: 9px; color: #51495e; font-size: 13px; line-height: 1.5; }
.game-empty { padding: 58px 24px; border: 1px dashed #c9c0d7; border-radius: 16px; text-align: center; }
.game-empty > svg { width: 38px; height: 38px; margin: 0 auto 20px; color: var(--purple); }
.game-empty h3 { margin: 0 0 12px; font-size: 21px; }
.game-empty p { max-width: 52ch; margin: 0 auto; color: var(--muted); font-size: 14px; line-height: 1.7; }
.game-empty button { margin-top: 23px; }

/* Installation remains available without competing with game discovery. */
.bottom-banner { display: flex; align-items: center; gap: 16px; margin-top: 32px; padding: 24px 0; border-top: 1px solid var(--border); }
.banner-symbol { display: grid; flex-shrink: 0; place-items: center; width: 48px; height: 48px; border-radius: 12px; color: var(--purple); background: var(--purple-light); }
.banner-symbol svg { width: 24px; height: 24px; }
.bottom-banner h3 { margin: 0 0 5px; font-size: 15px; font-weight: 600; }
.bottom-banner p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.bottom-banner button { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; gap: 8px; min-height: 44px; margin-left: auto; padding: 10px 14px; border-radius: 10px; color: var(--purple-hover); background: var(--purple-light); font-size: 13px; font-weight: 600; }
.bottom-banner button:hover { background: #e4ddff; }
.bottom-banner button svg { width: 16px; height: 16px; }
footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; max-width: 1640px; margin: auto; padding: 17px 36px 23px; color: var(--muted); font-size: 12px; }
.footer-links { display: flex; align-items: center; gap: 18px; }
footer button { min-height: 44px; padding: 8px 0; border-radius: 4px; color: var(--muted); background: transparent; font-size: 12px; }
footer button:hover { color: var(--purple-hover); text-decoration: underline; }
.domain-label { color: var(--muted); font-size: 12px; }

/* Playing a game */
.game-page-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.back-button { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 9px 0; border-radius: 6px; color: var(--muted); background: transparent; font-size: 14px; }
.back-button:hover { color: var(--purple-hover); }
.back-button svg { width: 18px; height: 18px; }
.game-actions { display: flex; gap: 8px; }
.game-actions button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-width: 44px; min-height: 44px; padding: 10px 13px; border: 1px solid var(--border); border-radius: 10px; color: #51495e; background: var(--surface); font-size: 13px; }
.game-actions button:hover { color: var(--purple-hover); border-color: #b8aec9; }
.game-actions button[aria-pressed="true"] { color: #b23a5e; background: #fff0f4; }
.game-actions button[aria-pressed="true"] > svg { fill: currentColor; }
.game-actions svg { width: 18px; height: 18px; }
.game-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.game-heading h1 { margin: 0 0 9px; font-size: 34px; font-weight: 650; line-height: 1.2; letter-spacing: -.03em; }
.game-heading p { max-width: 65ch; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.score-box { flex-shrink: 0; min-width: 103px; padding: 13px 22px; border-radius: 12px; text-align: center; background: var(--purple-light); }
.score-box small { display: block; margin-bottom: 3px; color: #61517e; font-size: 11px; }
.score-box strong { display: block; font-size: 30px; font-weight: 600; line-height: 1.15; font-variant-numeric: tabular-nums; }
.game-stage { position: relative; display: flex; align-items: center; justify-content: center; min-height: 430px; padding: 26px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.game-stage:fullscreen { padding: 24px; overflow: auto; background: var(--bg); }
.game-stage-inner { width: 100%; max-width: 750px; min-width: 0; }
.game-result { margin-top: 16px; padding: 14px 18px; border-radius: 12px; color: #405b24; background: #e9f6d7; font-size: 14px; line-height: 1.7; text-align: center; }
.game-description { max-width: 75ch; padding-top: 20px; color: var(--muted); font-size: 13px; line-height: 1.8; }
.recommend-title { margin: 36px 0 22px; font-size: 24px; font-weight: 600; letter-spacing: -.02em; }
.offline-badge { display: inline-flex; align-items: center; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 12px; }
.offline-badge svg { width: 14px; height: 14px; }

/* Supporting dialogs and feedback */
dialog { width: calc(100% - 32px); max-width: 560px; max-height: 85vh; padding: 30px; overflow: auto; border: 0; border-radius: 16px; color: var(--ink); background: var(--surface); box-shadow: 0 24px 80px #25243640; }
dialog::backdrop { background: #25243680; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.dialog-head h2 { margin: 0; font-size: 25px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
.dialog-head .icon-button { flex-shrink: 0; }
.dialog-copy { color: var(--muted); font-size: 14px; line-height: 1.8; }
.dialog-copy h3 { margin: 24px 0 10px; color: var(--ink); font-size: 16px; }
.dialog-copy p { margin: 12px 0; }
.dialog-copy ol { padding-left: 22px; }
.install-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; padding: 0 0 20px; border-bottom: 1px solid var(--border); }
.install-brand img { width: 52px; height: 52px; border-radius: 14px; }
.install-brand strong { display: block; font-size: 19px; font-weight: 600; }
.install-brand small { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.install-now { width: 100%; margin: 0 0 20px; background: var(--purple); }
.install-now:hover { background: var(--purple-hover); }
.install-platforms { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.install-steps { padding: 0; }
.install-steps h3 { margin: 0 0 10px; font-size: 15px; }
.install-steps p { margin: 0; font-size: 13px; line-height: 1.9; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: calc(100% - 32px); width: max-content; padding: 13px 22px; border-radius: 12px; color: white; background: var(--ink); box-shadow: 0 8px 24px #25243630; font-size: 14px; text-align: center; opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity 200ms, transform 220ms var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.mobile-shade { position: fixed; inset: 0; z-index: 24; background: #25243666; }

/* Intermediate widths: keep the game grid useful and the navigation familiar. */
@media (min-width: 1500px) {
  .hero-row { grid-template-columns: minmax(0, 1fr) 280px; }
  .hero { padding: 32px 38px; }
  .hero h1 { font-size: 46px; }
  .hero-art { right: 48px; width: 36%; }
  .floating-card { width: 148px; height: 174px; }
  .floating-card.second { left: 113px; top: 39px; }
}

@media (max-width: 1180px) {
  .topbar { gap: 16px; padding: 20px 28px; }
  .top-title-copy > span { display: none; }
  .top-actions { gap: 10px; }
  .search-box { width: 238px; }
  main { padding: 28px 28px 0; }
  footer { padding: 17px 28px 23px; }
  .hero-row { grid-template-columns: minmax(0, 1fr) 214px; gap: 16px; }
  .hero { padding: 28px; }
  .hero h1 { font-size: 36px; }
  .hero p { font-size: 13px; }
  .hero-art { right: 12px; top: 44px; transform: scale(.85); transform-origin: center right; }
  .random-panel { padding: 24px 22px; }
  .random-panel h2 { font-size: 21px; }
  .random-panel p { font-size: 12px; }
  .game-grid { gap: 28px 16px; }
  .card-meta h3 { font-size: 16px; }
  .device-icons { display: none; }
  footer { align-items: flex-start; flex-wrap: wrap; gap: 4px 18px; }
}

@media (min-width: 721px) and (max-width: 980px) {
  .topbar { min-height: 88px; padding: 18px 24px; gap: 12px; }
  .top-title-copy { max-width: 140px; font-size: 13px; line-height: 1.5; }
  .search-box { width: 198px; }
  .lang-button { min-width: 70px; padding: 10px; }
  main { padding: 24px 24px 0; }
  .hero-row { grid-template-columns: 1fr; gap: 14px; }
  .hero { min-height: 268px; }
  .hero h1 { font-size: 38px; }
  .hero-art { width: 37%; right: 22px; top: 22px; transform: none; }
  .random-panel { display: none; }
  .game-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px 14px; }
  .game-label { left: 10px; top: 10px; max-width: calc(100% - 68px); padding: 4px 6px; font-size: 9px; }
  .favorite-btn { top: 8px; right: 8px; }
  .card-meta h3 { font-size: 15px; }
  .card-meta .card-description { font-size: 12px; }
  .bottom-banner { flex-wrap: wrap; }
  .bottom-banner > div:nth-child(2) { flex: 1; min-width: 210px; }
  .bottom-banner button { margin-left: 64px; }
  footer { padding-left: 24px; padding-right: 24px; }
  .game-stage { padding: 20px; }
}

/* Phone header: one navigation row, one full-width search row. */
@media (max-width: 720px) {
  .topbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 44px 48px; align-items: center; gap: 10px 12px; min-height: 0; padding: 14px 18px 16px; }
  .top-title { grid-column: 1; grid-row: 1; gap: 8px; }
  .top-title-copy, .top-dot { display: none; }
  .mobile-menu { display: inline-flex; margin-left: -8px; }
  .mobile-brand { display: inline-flex; align-items: center; gap: 9px; min-width: 0; font-size: 20px; font-weight: 650; line-height: 1.2; letter-spacing: -.025em; }
  .mobile-brand img { width: 30px; height: 30px; border-radius: 9px; }
  .top-actions { display: contents; }
  .lang-button { grid-column: 2; grid-row: 1; min-width: 70px; min-height: 44px; padding: 10px; font-size: 13px; }
  .search-box { grid-column: 1 / -1; grid-row: 2; width: 100%; }
  .search-box input { min-height: 48px; font-size: 16px; padding-right: 14px; }
  .search-box > svg { top: 15px; }
  .search-key { display: none; }
  main { padding: 22px 18px 0; }
  .hero-row { grid-template-columns: 1fr; gap: 12px; margin-bottom: 28px; }
  .hero { min-height: 256px; padding: 26px; }
  .hero h1 { max-width: 78%; margin-bottom: 13px; font-size: 34px; line-height: 1.15; letter-spacing: -.035em; }
  .hero p { max-width: 62%; margin-bottom: 20px; font-size: 13px; line-height: 1.7; }
  .hero-art { right: -8px; top: 82px; width: 135px; height: 160px; transform: none; }
  .floating-card { top: 10px; left: 0; width: 108px; height: 135px; border-width: 5px; border-bottom-width: 21px; border-radius: 12px; }
  .floating-card.second { left: 64px; top: 62px; }
  .floating-star { right: 24px; top: -50px; }
  .floating-star svg { width: 28px; height: 28px; }
  .hero::after { width: 240px; height: 240px; top: 32px; right: -55px; }
  .hero-note { display: none; }
  .primary-button { min-height: 46px; padding: 12px 16px; font-size: 13px; }
  .random-panel { display: none; }
  .section-top { align-items: flex-start; gap: 12px; margin-bottom: 13px; }
  .section-title { gap: 8px; padding-top: 8px; }
  .section-top h2 { font-size: 23px; line-height: 1.25; }
  .sort-select { max-width: 118px; font-size: 12px; }
  .filter-row { gap: 8px; margin-bottom: 20px; padding: 4px 0 8px; }
  .filter-pill { min-height: 44px; padding: 10px 14px; font-size: 12px; }
  .filter-pill svg { width: 16px; height: 16px; }
  .game-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 14px; }
  .art-wrap, .card-open { border-radius: 14px; }
  .game-label { top: 10px; left: 10px; max-width: calc(100% - 68px); padding: 4px 6px; font-size: 9px; }
  .favorite-btn { top: 6px; right: 6px; width: 44px; height: 44px; padding: 13px; border-radius: 11px; }
  .favorite-btn svg { width: 18px; height: 18px; }
  .card-play { right: 10px; bottom: 10px; width: 32px; height: 32px; border-radius: 10px; }
  .card-play svg { width: 14px; height: 14px; }
  .card-meta { padding-top: 12px; }
  .card-meta h3 { font-size: 16px; }
  .card-meta p { margin-top: 5px; font-size: 12px; }
  .card-meta .card-description { min-height: 3em; margin-top: 8px; font-size: 12px; line-height: 1.5; }
  .device-icons { display: none; }
  .bottom-banner { align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-top: 28px; padding: 22px 0 18px; }
  .banner-symbol { width: 42px; height: 42px; }
  .banner-symbol svg { width: 22px; height: 22px; }
  .bottom-banner > div:nth-child(2) { flex: 1; min-width: 190px; }
  .bottom-banner h3 { font-size: 14px; }
  .bottom-banner p { font-size: 12px; }
  .bottom-banner button { margin-left: 56px; font-size: 12px; }
  footer { align-items: flex-start; flex-direction: column; gap: 8px; padding: 16px 18px 24px; font-size: 12px; }
  .footer-links { flex-wrap: wrap; gap: 4px 17px; }
  footer button, .domain-label { font-size: 12px; }
  .game-page-header { gap: 10px; margin-bottom: 20px; }
  .back-button { gap: 6px; font-size: 13px; }
  .game-actions { gap: 6px; }
  .game-actions button { padding: 10px; }
  .game-actions button span { display: none; }
  .game-heading { gap: 15px; margin-bottom: 20px; }
  .game-heading h1 { font-size: 28px; }
  .game-heading p { font-size: 13px; }
  .score-box { min-width: 86px; padding: 12px 16px; }
  .score-box strong { font-size: 27px; }
  .game-stage { min-height: 390px; padding: 16px 10px; border-radius: 14px; }
  .game-description { padding-top: 18px; font-size: 13px; }
  .recommend-title { margin-top: 30px; font-size: 22px; }
  .game-empty { padding: 44px 20px; }
  .game-empty h3 { font-size: 20px; }
  .game-empty p { font-size: 14px; }
  dialog { padding: 24px 22px; }
  .dialog-head h2 { font-size: 23px; }
  .install-platforms { grid-template-columns: 1fr; gap: 23px; }
  .toast { bottom: 20px; padding: 12px 18px; font-size: 13px; }
}

@media (max-width: 360px) {
  .topbar { padding-left: 16px; padding-right: 16px; }
  .mobile-brand { gap: 7px; font-size: 18px; }
  .mobile-brand img { width: 28px; height: 28px; }
  .lang-button { min-width: 64px; }
  main { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 24px 22px; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 12px; }
  .hero-art { right: -22px; top: 84px; }
  .section-top h2 { font-size: 21px; }
  .sort-select { max-width: 106px; font-size: 11px; }
  .game-grid { column-gap: 12px; }
  .card-meta h3 { font-size: 15px; }
  .game-label { max-width: calc(100% - 64px); font-size: 8px; padding: 4px 5px; }
  .bottom-banner > div:nth-child(2) { min-width: 170px; }
  .game-page-header { gap: 6px; }
  .back-button { font-size: 12px; }
  .game-actions { gap: 4px; }
  .game-heading h1 { font-size: 25px; }
  .score-box { min-width: 76px; padding: 11px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}
