:root {
  color-scheme: dark;
  --bg: #070806;
  --bg-2: #0d0e0b;
  --panel: rgba(16, 17, 13, 0.88);
  --panel-2: rgba(23, 24, 18, 0.92);
  --panel-3: rgba(33, 34, 25, 0.92);
  --line: rgba(244, 239, 218, 0.13);
  --line-strong: rgba(244, 239, 218, 0.28);
  --text: #f6f1df;
  --muted: #b9b19b;
  --soft: #857d6c;
  --accent: #d7ff3f;
  --accent-strong: #efff8a;
  --accent-dark: #1b2307;
  --danger: #ff7468;
  --ok: #76f39b;
  --shadow: 0 28px 88px rgba(0, 0, 0, 0.5);
  --shadow-soft: 0 18px 52px rgba(0, 0, 0, 0.34);
  --radius: 8px;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(7, 8, 6, 0.12), #070806 44%, #070806),
    linear-gradient(90deg, rgba(215, 255, 63, 0.08), transparent 28%, rgba(255, 189, 89, 0.035)),
    repeating-linear-gradient(90deg, rgba(246, 241, 223, 0.035) 0 1px, transparent 1px 122px),
    repeating-linear-gradient(0deg, rgba(246, 241, 223, 0.018) 0 1px, transparent 1px 122px),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(215, 255, 63, 0.11), transparent 20%),
    linear-gradient(180deg, transparent 0 62%, rgba(7, 8, 6, 0.94));
  opacity: 0.72;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

[hidden] {
  display: none !important;
}

button {
  color: inherit;
}

button,
a,
input,
select {
  outline-color: var(--accent);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.app-shell {
  width: min(1720px, 100%);
  margin: 0 auto;
  padding: 18px 20px;
  overflow: clip;
}

.app-header {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(7, 8, 6, 0.94), rgba(7, 8, 6, 0.42) 46%, rgba(7, 8, 6, 0.64)),
    linear-gradient(180deg, rgba(7, 8, 6, 0.1), rgba(7, 8, 6, 0.86)),
    url("https://cloud.megick.com/covers/vibefall.png") center 34% / cover;
  box-shadow: var(--shadow-soft);
}

.app-header::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(7, 8, 6, 0.32), transparent 28%, rgba(7, 8, 6, 0.78)),
    repeating-linear-gradient(0deg, rgba(246, 241, 223, 0.035) 0 1px, transparent 1px 18px);
  mix-blend-mode: normal;
}

.brand,
.hero-panel,
.header-actions,
.top-nav {
  position: relative;
  z-index: 1;
}

.top-nav {
  display: grid;
  grid-template-columns: minmax(260px, auto) 1fr auto;
  align-items: center;
  gap: 36px;
  min-height: 72px;
  padding: 0 16px 0 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(7, 8, 6, 0.76), rgba(7, 8, 6, 0.22));
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 0;
  border-right: 0;
  background: transparent;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #101500;
  flex: 0 0 52px;
  background: rgba(215, 255, 63, 0.1);
  border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(215, 255, 63, 0.38), 0 18px 38px rgba(215, 255, 63, 0.2);
}

.brand-logo-svg {
  width: 42px;
  height: 42px;
  overflow: visible;
}

.logo-plate {
  fill: var(--accent);
}

.logo-cut {
  fill: #101500;
}

.brand-logo-svg--zh .logo-cut,
.logo-frame,
.logo-spark {
  fill: none;
  stroke: #101500;
  stroke-width: 5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.logo-frame {
  stroke-width: 3;
}

.logo-spark {
  stroke-width: 4;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  margin-top: 0;
  font-size: 19px;
  letter-spacing: 0;
}

.nav-links {
  display: flex;
  align-items: stretch;
  gap: clamp(26px, 4vw, 56px);
  height: 72px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  font-size: 16px;
  font-weight: 760;
}

.nav-link.is-active {
  color: var(--accent);
}

.nav-link.is-active::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 18px rgba(215, 255, 63, 0.42);
}

.panel-label {
  margin-bottom: 10px;
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  max-width: none;
  margin-bottom: 8px;
  font-size: clamp(58px, 5.8vw, 96px);
  line-height: 0.9;
  letter-spacing: 0;
}

.hero-panel {
  display: grid;
  align-items: end;
  min-height: 148px;
  padding: 22px 36px 24px;
}

.hero-copy p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(18px, 1.8vw, 26px);
  line-height: 1.1;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-width: 0;
  padding: 0;
  border-left: 0;
}

.language-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-width: 144px;
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(14px);
}

.language-switch button,
.language-switch a,
.icon-button,
.tool-button,
.button,
.view-tab,
.favorite-button,
.filter-chip {
  cursor: pointer;
  border: 0;
}

.language-switch button,
.language-switch a {
  display: inline-grid;
  place-items: center;
  min-height: 35px;
  color: var(--muted);
  background: transparent;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 800;
}

.language-switch button.is-active,
.language-switch a.is-active {
  color: #101500;
  background: var(--accent);
}

.icon-button,
.favorite-button {
  display: inline-grid;
  place-items: center;
  width: 43px;
  height: 43px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-button:hover,
.favorite-button:hover,
.tool-button:hover,
.view-tab:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.icon-button:hover,
.favorite-button:hover {
  transform: translateY(-1px);
}

.icon-button span {
  font-size: 21px;
  line-height: 1;
}

.workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
  padding-top: 18px;
}

.workspace > *,
.main-layout,
.library-panel,
.command-deck,
.app-grid,
.app-card {
  min-width: 0;
  max-width: 100%;
}

.command-deck {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  width: 100%;
  padding: 14px 18px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(215, 255, 63, 0.055), transparent 38%),
    rgba(12, 13, 10, 0.9);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 24px, 100% 100%, 18px 100%, 0 calc(100% - 24px));
}

.command-deck::before,
.command-deck::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.command-deck::before {
  border: 1px solid rgba(215, 255, 63, 0.08);
  border-radius: inherit;
}

.command-deck::after {
  background:
    linear-gradient(90deg, transparent, rgba(246, 241, 223, 0.045) 48%, transparent 49%),
    repeating-linear-gradient(90deg, transparent 0 72px, rgba(246, 241, 223, 0.035) 72px 73px);
  opacity: 0.42;
}

.deck-controls,
.filter-row {
  position: relative;
  z-index: 1;
}

.deck-controls {
  display: grid;
  grid-template-columns: minmax(300px, 0.8fr) minmax(360px, 0.9fr) minmax(210px, 280px) 104px;
  gap: 34px;
  align-items: center;
}

.search-box,
.sort-box {
  display: grid;
  gap: 0;
  min-width: 0;
  color: var(--soft);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.search-box > span,
.sort-box > span {
  display: none;
}

.search-box input,
.sort-box select {
  width: 100%;
  min-height: 52px;
  color: var(--text);
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.search-box input {
  padding: 0 16px;
}

.sort-box select {
  padding: 0 13px;
}

.search-box input:focus,
.sort-box select:focus {
  border-color: rgba(215, 255, 63, 0.62);
  background: rgba(0, 0, 0, 0.48);
  box-shadow: 0 0 0 4px rgba(215, 255, 63, 0.1);
}

.search-box input::placeholder {
  color: #77705f;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 0;
  min-width: 0;
  overflow: hidden;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.26);
}

.view-tab {
  min-width: 0;
  min-height: 50px;
  padding: 0 13px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}

.layout-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.layout-button {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--muted);
  cursor: pointer;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.layout-button.is-active {
  color: #101500;
  background: var(--accent);
  border-color: rgba(215, 255, 63, 0.7);
}

.view-tab.is-active {
  color: #101500;
  border-color: rgba(215, 255, 63, 0.7);
  background: var(--accent);
}

.filter-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  min-height: 50px;
  margin-top: 0;
  padding: 10px 10px 0;
  overflow-x: auto;
  border-top: 1px solid var(--line);
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(246, 241, 223, 0.045);
  white-space: nowrap;
}

.filter-chip {
  flex: 0 0 auto;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.filter-chip.is-active,
.tag-row span {
  color: var(--accent-strong);
  border-color: rgba(215, 255, 63, 0.34);
  background: rgba(215, 255, 63, 0.08);
}

.main-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  width: 100%;
}

.library-panel {
  width: 100%;
  min-height: 680px;
  padding: 0 0 28px;
  border: 0;
  background: transparent;
}

.section-head {
  display: none;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  margin: 2px 0 14px;
}

.section-head h2 {
  margin-bottom: 5px;
  font-size: clamp(26px, 2.8vw, 42px);
  line-height: 0.96;
}

.section-head p {
  margin-bottom: 0;
  color: var(--soft);
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(420px, 2.15fr) repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 12px;
  width: 100%;
}

.app-card {
  position: relative;
  display: grid;
  align-items: end;
  width: 100%;
  min-height: 314px;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0c09;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.3);
  transform: translateZ(0);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.app-card::before,
.app-card::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.app-card::before {
  z-index: 2;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.18) 38%, rgba(0, 0, 0, 0.82)),
    linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 42%, rgba(0, 0, 0, 0.12));
}

.app-card::after {
  z-index: 4;
  opacity: 0;
  border: 1px solid rgba(215, 255, 63, 0.8);
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(215, 255, 63, 0.16);
  transition: opacity 180ms ease;
}

.app-card:hover,
.app-card.is-selected {
  border-color: rgba(215, 255, 63, 0.58);
}

.app-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 28px 72px rgba(0, 0, 0, 0.44);
}

.app-card.is-selected::after {
  opacity: 1;
}

.card-media {
  position: absolute;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(215, 255, 63, 0.12), transparent),
    #0b0c09;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.06);
  transition: transform 520ms ease, filter 180ms ease;
}

.app-card:hover .card-media img {
  transform: scale(1.045);
  filter: saturate(1.15) contrast(1.08);
}

.media-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: rgba(246, 241, 223, 0.92);
  font-size: 44px;
  font-weight: 950;
  background:
    linear-gradient(135deg, rgba(215, 255, 63, 0.24), transparent 44%),
    repeating-linear-gradient(135deg, rgba(246, 241, 223, 0.12) 0 1px, transparent 1px 16px),
    #0d0e09;
}

.card-body {
  position: relative;
  z-index: 3;
  display: grid;
  align-content: end;
  gap: 10px;
  min-height: 100%;
  padding: 18px 20px;
}

.card-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
}

.card-title h3 {
  margin-bottom: 0;
  font-size: clamp(26px, 2.25vw, 36px);
  line-height: 0.96;
  letter-spacing: 0;
  text-transform: uppercase;
  text-wrap: balance;
}

.card-title strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: clamp(17px, 1.4vw, 23px);
  line-height: 1.02;
}

.card-title .favorite-button {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: rgba(246, 241, 223, 0.78);
  font-size: 19px;
  background: rgba(0, 0, 0, 0.46);
  border-color: rgba(246, 241, 223, 0.24);
}

.favorite-button.is-active {
  color: #101500;
  border-color: var(--accent);
  background: var(--accent);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  min-height: 28px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 900;
  border-radius: 999px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 15px;
  border-radius: var(--radius);
  font-weight: 950;
  line-height: 1;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.button.primary {
  color: #101500;
  background: var(--accent);
  border: 1px solid rgba(215, 255, 63, 0.78);
  box-shadow: 0 16px 32px rgba(215, 255, 63, 0.13);
}

.button.secondary {
  color: var(--text);
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
}

.button.danger {
  color: #ffe4e1;
  background: rgba(255, 116, 104, 0.12);
  border: 1px solid rgba(255, 116, 104, 0.4);
}

.button.primary:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.button.secondary:hover {
  border-color: var(--line-strong);
  background: rgba(246, 241, 223, 0.065);
  transform: translateY(-1px);
}

.button.danger:hover:not(:disabled) {
  color: #101500;
  background: var(--danger);
  border-color: var(--danger);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  transform: none;
}

.settings-panel {
  display: grid;
  gap: 16px;
  min-height: 520px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(215, 255, 63, 0.06), transparent 34%),
    rgba(12, 13, 10, 0.88);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.settings-panel[hidden] {
  display: none;
}

.settings-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.settings-head h2 {
  margin-bottom: 7px;
  font-size: clamp(32px, 3.2vw, 54px);
  line-height: 0.94;
}

.settings-head p:last-child {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.settings-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 180px));
  gap: 10px;
}

.settings-stats div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
}

.settings-stats span,
.favorite-manager-meta {
  display: block;
  color: var(--soft);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-stats strong {
  display: block;
  margin-top: 6px;
  color: var(--accent);
  font-size: 28px;
  line-height: 1;
}

.favorite-manager-list {
  display: grid;
  gap: 10px;
}

.favorite-manager-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.24);
}

.favorite-manager-main {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.favorite-manager-main:hover h3,
.favorite-manager-main:focus-visible h3 {
  color: var(--accent);
}

.favorite-manager-main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: calc(var(--radius) - 4px);
}

.favorite-manager-media {
  width: 124px;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0b0c09;
}

.favorite-manager-media img,
.favorite-manager-media .media-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorite-manager-media .media-fallback {
  font-size: 24px;
}

.favorite-manager-body {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.favorite-manager-body h3 {
  margin-bottom: 4px;
  font-size: clamp(20px, 1.8vw, 28px);
  line-height: 1;
}

.favorite-manager-body p {
  display: -webkit-box;
  margin-bottom: 0;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.favorite-manager-body .tag-row span {
  min-height: 26px;
}

.favorite-manager-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 148px;
}

@media (min-width: 1180px) {
  .app-grid > .app-card:first-child {
    grid-column: 1;
    grid-row: 1;
    min-height: 390px;
  }

  .app-grid > .app-card:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
  }

  .app-grid > .app-card:nth-child(3) {
    grid-column: 3;
    grid-row: 1;
  }

  .app-grid > .app-card:nth-child(4) {
    grid-column: 4;
    grid-row: 1;
  }

  .app-grid > .app-card:nth-child(5) {
    grid-column: 1;
    grid-row: 2;
  }

  .app-grid > .app-card:nth-child(6) {
    grid-column: 2;
    grid-row: 2;
  }

  .app-grid > .app-card:nth-child(7) {
    grid-column: 3;
    grid-row: 2;
  }

  .app-grid > .app-card:nth-child(8) {
    grid-column: 4;
    grid-row: 2;
  }

  .app-grid > .app-card:nth-child(2),
  .app-grid > .app-card:nth-child(3),
  .app-grid > .app-card:nth-child(4) {
    min-height: 308px;
  }

  .app-grid > .app-card:nth-child(5) {
    min-height: 150px;
  }

  .app-grid > .app-card:nth-child(6),
  .app-grid > .app-card:nth-child(7),
  .app-grid > .app-card:nth-child(8) {
    min-height: 232px;
  }

  .app-grid > .app-card:first-child .card-body {
    padding: 22px 24px;
  }

  .app-grid > .app-card:first-child .card-title h3 {
    font-size: clamp(44px, 4.4vw, 68px);
    line-height: 0.88;
  }

  .app-grid > .app-card:first-child .card-title strong {
    display: none;
  }

  .app-grid > .app-card:first-child .tag-row span {
    min-height: 36px;
    padding-inline: 14px;
    font-size: 13px;
  }

  .app-grid > .app-card:not(:first-child) .card-body {
    gap: 8px;
    padding: 16px;
  }

  .app-grid > .app-card:not(:first-child) .card-title h3 {
    font-size: clamp(21px, 1.55vw, 28px);
  }

  .app-grid > .app-card:not(:first-child) .card-title strong {
    font-size: clamp(15px, 1.1vw, 18px);
  }

}

.empty-state {
  display: grid;
  justify-items: start;
  gap: 10px;
  max-width: 470px;
  margin: 72px auto;
  padding: 28px;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.empty-state[hidden] {
  display: none;
}

.empty-state strong {
  color: var(--text);
  font-size: 22px;
}

.launcher {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 16px;
  background: rgba(5, 5, 4, 0.97);
}

.launcher[hidden] {
  display: none;
}

.launcher-topline {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 74px;
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  background: rgba(18, 19, 14, 0.92);
}

.launcher-topline h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.launcher-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.tool-button {
  min-height: 38px;
  padding: 0 12px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.tool-button.strong {
  color: #101500;
  background: var(--accent);
}

.loading-window,
.game-stage {
  min-height: 0;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
  background: #050504;
}

.loading-window {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 22px;
  padding: 28px;
  text-align: center;
}

.loading-window h3 {
  margin-bottom: 10px;
  font-size: clamp(28px, 4vw, 56px);
  line-height: 1;
}

.loading-window p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.loader-core {
  position: relative;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
}

.loader-core span {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(215, 255, 63, 0.34);
  border-radius: 16px;
  animation: loaderSpin 2.4s linear infinite;
}

.loader-core span:nth-child(2) {
  inset: 18px;
  border-color: rgba(246, 241, 223, 0.2);
  animation-direction: reverse;
  animation-duration: 3s;
}

.loader-core span:nth-child(3) {
  inset: 38px;
  background: var(--accent);
  border: 0;
  border-radius: 8px;
  animation: none;
}

.progress-track {
  width: min(520px, 82vw);
  height: 8px;
  overflow: hidden;
  background: rgba(246, 241, 223, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  transition: width 120ms ease;
}

.progress-meta {
  font-size: 13px;
}

.loading-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

.game-stage {
  position: relative;
}

.game-stage[hidden],
.loading-window[hidden] {
  display: none;
}

.iframe-mount,
.iframe-mount iframe {
  width: 100%;
  height: 100%;
}

.iframe-mount iframe {
  display: block;
  border: 0;
  background: #000;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 70;
  max-width: min(380px, calc(100vw - 44px));
  padding: 13px 15px;
  color: #101500;
  background: var(--accent);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  font-weight: 950;
}

.toast[hidden] {
  display: none;
}

@keyframes loaderSpin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 1180px) {
  .app-header {
    min-height: 330px;
  }

  .top-nav {
    grid-template-columns: minmax(180px, auto) 1fr auto;
    gap: 18px;
  }

  .nav-links {
    gap: 24px;
  }

  .hero-panel {
    min-height: 258px;
  }

  .command-deck {
    grid-template-columns: minmax(0, 1fr);
  }

  .deck-controls {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.9fr);
    gap: 12px;
  }

  .sort-box,
  .layout-toggle {
    grid-column: auto;
  }

  .app-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-grid > .app-card:first-child {
    grid-column: span 2;
    min-height: 520px;
  }
}

@media (max-width: 720px) {
  html,
  body {
    overflow-x: hidden;
  }

  .app-shell {
    padding: 12px;
  }

  .app-header {
    min-height: 360px;
  }

  .top-nav {
    grid-template-columns: 1fr auto;
    min-height: auto;
    gap: 12px;
    padding: 12px;
  }

  .nav-links {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    height: 42px;
    justify-content: space-around;
    border-top: 1px solid var(--line);
  }

  .nav-link {
    font-size: 14px;
  }

  .workspace {
    gap: 12px;
    padding-top: 12px;
  }

  .brand {
    padding: 0;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
    flex-basis: 44px;
  }

  .brand-logo-svg {
    width: 36px;
    height: 36px;
  }

  .hero-panel {
    min-height: 246px;
    padding: 26px 18px 30px;
  }

  h1 {
    font-size: clamp(42px, 16vw, 66px);
    overflow-wrap: anywhere;
  }

  .header-actions {
    flex-wrap: wrap;
    gap: 10px;
  }

  .language-switch {
    min-width: 0;
    width: min(150px, calc(100vw - 94px));
  }

  .command-deck {
    gap: 12px;
    padding: 12px;
  }

  .deck-controls {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .layout-toggle {
    display: none;
  }

  .search-box,
  .sort-box {
    gap: 5px;
  }

  .search-box input,
  .sort-box select {
    min-height: 40px;
  }

  .view-tabs {
    display: flex;
    width: 100%;
    overflow: hidden;
  }

  .view-tab {
    flex: 1 1 0;
    min-height: 39px;
    padding: 0 8px;
  }

  .filter-row {
    margin-right: -12px;
    padding-bottom: 2px;
  }

  .settings-panel {
    min-height: 440px;
    padding: 12px;
  }

  .settings-head {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-head h2 {
    font-size: clamp(30px, 10vw, 42px);
  }

  .settings-actions,
  .favorite-manager-actions {
    justify-content: stretch;
  }

  .settings-actions .button,
  .favorite-manager-actions .button {
    flex: 1 1 150px;
  }

  .settings-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .favorite-manager-item {
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
  }

  .favorite-manager-main {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
  }

  .favorite-manager-media {
    width: 104px;
  }

  .favorite-manager-body h3 {
    font-size: 22px;
  }

  .favorite-manager-body p {
    -webkit-line-clamp: 3;
  }

  .favorite-manager-actions {
    min-width: 0;
  }

  .app-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-grid > .app-card:first-child {
    grid-column: span 1;
    min-height: 430px;
  }

  .app-card {
    min-height: 330px;
  }

  .card-body {
    padding: 16px;
  }

  .card-title h3 {
    font-size: 28px;
  }

  .launcher {
    padding: 10px;
  }

  .launcher-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .launcher-controls {
    justify-content: stretch;
  }

  .tool-button {
    flex: 1 1 130px;
  }

  .loading-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .app-shell {
    padding: 10px;
  }

  h1 {
    font-size: 42px;
  }

  .hero-copy p {
    font-size: 16px;
  }

  .app-card,
  .app-grid > .app-card:first-child {
    min-height: 310px;
  }

  .tag-row span {
    min-height: 29px;
    padding-inline: 10px;
    font-size: 11px;
  }

  .settings-stats,
  .favorite-manager-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .favorite-manager-media {
    width: 100%;
  }
}
