.library-home {
  --lh-card-width: clamp(184px, min(14.1vw, 24svh), 244px);
  --lh-gap: 10px;
  position: relative;
  isolation: isolate;
  width: 100%;
  height: calc(100svh - 68px);
  min-height: 730px;
  margin-left: 0;
  overflow: hidden;
  background: #fffdf9;
  color: #22252c;
}

.library-home button { font: inherit; }
.library-home .lh-poster-wall { position: absolute; inset: 4px 0 30px; z-index: 0; display: flex; flex-direction: column; justify-content: space-between; gap: var(--lh-gap); opacity: 1; transition: opacity 250ms ease; }
.library-home.is-composing .lh-poster-wall { opacity: .45; }
.library-home .lh-cover-row { flex: 0 0 auto; width: 100%; overflow: hidden; touch-action: pan-y; user-select: none; cursor: grab; }
.library-home .lh-cover-row.is-dragging, .library-home .lh-cover-row.is-dragging * { cursor: grabbing; }
.library-home .lh-cover-track { display: flex; gap: var(--lh-gap); width: max-content; will-change: transform; }
.library-home .lh-cover-set { position: relative; display: flex; flex: none; gap: var(--lh-gap); }
.library-home .lh-game-cover { position: relative; display: block; flex: 0 0 var(--lh-card-width); width: var(--lh-card-width); aspect-ratio: 16 / 9; overflow: hidden; padding: 0; border: 1px solid #e0dbd1; border-radius: 8px; background: #233742; box-shadow: 0 2px 4px #39271314; color: #fff; text-align: left; cursor: pointer; transition: border-color .18s, box-shadow .18s; }
.library-home .lh-game-cover img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.library-home .lh-cover-title { position: absolute; inset: auto 0 0; padding: 25px 10px 9px; overflow: hidden; background: linear-gradient(transparent, #07101bd9); color: #fff; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; opacity: 0; transition: opacity .18s; pointer-events: none; }
.library-home .lh-cover-flip { position: absolute; top: 7px; right: 7px; padding: 5px 7px; border: 1px solid #ffffff40; border-radius: 5px; background: #121d2bba; color: #fff; font-size: 10px; opacity: 0; transition: opacity .18s; pointer-events: none; }
.library-home .lh-game-cover:hover, .library-home .lh-game-cover:focus-visible { border-color: #ff965b; box-shadow: inset 0 0 0 1px #ff965b, 0 2px 6px #3e251d26; filter: none; }
.library-home .lh-game-cover:hover .lh-cover-title, .library-home .lh-game-cover:focus-visible .lh-cover-title, .library-home .lh-game-cover:hover .lh-cover-flip, .library-home .lh-game-cover:focus-visible .lh-cover-flip, .library-home .lh-image-unavailable .lh-cover-title { opacity: 1; }
.library-home .lh-image-unavailable img { visibility: hidden; }
.library-home .lh-image-unavailable .lh-cover-title { inset: 0; display: grid; place-items: center; padding: 16px; background: linear-gradient(130deg, #233742, #42695c); font-size: 20px; white-space: normal; text-align: center; }
.library-home .lh-cover-row.is-dragging .lh-cover-flip { opacity: 0; }
.library-home .lh-game-cover:focus-visible { outline: 3px solid #ff8d55; outline-offset: -3px; }

.library-home .lh-agent-center { position: absolute; top: 50%; left: 50%; z-index: 2; width: min(610px, calc(100% - 48px)); transform: translate(-50%, -46%); text-align: center; pointer-events: none; }
.library-home .lh-agent-center::before { content: ''; position: absolute; z-index: -1; inset: -32px -90px -26px; background: radial-gradient(ellipse closest-side at 50% 48%, #fffdf9 0%, #fffdf9f5 76%, #fffdf9b3 90%, #fffdf900 100%); filter: blur(12px); pointer-events: none; }
.library-home .lh-hero-spark { width: 33px; height: 33px; margin: 0 auto 16px; color: #ff7b36; }
.library-home .lh-hero-spark svg, .library-home .lh-agent-spark svg { display: block; width: 100%; height: 100%; }
.library-home h1 { margin: 0; color: #181916; font-family: "Songti SC", "STSong", "Noto Serif SC", serif; font-size: clamp(28px, 2.75vw, 43px); font-weight: 800; line-height: 1.35; letter-spacing: -.9px; white-space: nowrap; }
.library-home .lh-hero-description { margin: 8px 0 21px; color: #6e7381; font-size: 18px; line-height: 1.6; letter-spacing: 1px; }
.library-home .lh-agent-composer { padding: 18px 19px 13px; border: 1px solid #ece9e3; border-radius: 16px; background: #fffffff5; box-shadow: 0 12px 40px #654a2514, 0 2px 6px #4f36100a; text-align: left; pointer-events: auto; }
.library-home .lh-agent-heading { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 15px; }
.library-home .lh-agent-spark { display: block; width: 25px; height: 25px; flex: 0 0 25px; color: #ff7b36; }
.library-home .lh-agent-heading strong { display: block; padding-top: 2px; color: #24252a; font-size: 15px; font-weight: 700; line-height: 1.5; }
.library-home .lh-agent-heading p { margin: 3px 0 0; color: #777d8b; font-size: 13px; line-height: 1.7; }
.library-home #start-idea { display: block; width: 100%; min-height: 93px; max-height: 200px; padding: 14px 15px; resize: vertical; border: 1px solid #e4e7ed; border-radius: 9px; background: #fff; color: #414855; font-size: 14px; line-height: 1.7; outline-offset: 2px; }
.library-home #start-idea::placeholder { color: #abb1bd; opacity: 1; }
.library-home #start-idea:focus { border-color: #ffb894; }
.library-home .lh-composer-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.library-home .lh-add-reference { display: inline-flex; align-items: center; gap: 7px; padding: 7px 0; border: 0; background: none; color: #737c8c; font-size: 13px; }
.library-home .lh-add-reference svg { width: 24px; height: 24px; }
.library-home .lh-launch-button { display: flex; align-items: center; justify-content: center; gap: 20px; min-width: 142px; min-height: 42px; padding: 10px 20px; border: 1px solid #ff6a29; border-radius: 8px; background: linear-gradient(125deg, #ff7638, #ff6224); box-shadow: 0 2px 3px #ed6c1a12; color: #fff; font-size: 14px; font-weight: 550; }
.library-home .lh-launch-button span { font-size: 23px; line-height: 16px; }
.library-home .lh-reference-list { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 10px; }
.library-home .lh-reference-chip { display: flex; align-items: center; gap: 6px; max-width: 180px; padding: 3px 5px 3px 3px; border: 1px solid #ebe8e2; border-radius: 6px; background: #faf9f6; color: #6d7480; font-size: 10px; }
.library-home .lh-reference-chip > img { width: 31px; height: 25px; border-radius: 3px; object-fit: cover; }
.library-home .lh-reference-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.library-home .lh-reference-chip > button { flex: none; padding: 3px 5px; border: 0; border-radius: 3px; background: none; color: #7e858d; font-size: 16px; }
.library-home .lh-library-hint { display: inline-flex; align-items: center; gap: 8px; margin-top: 13px; padding: 4px 15px 4px 7px; border: 1px solid #ece8df; border-radius: 24px; background: #fffffff2; box-shadow: 0 3px 12px #654a2509; color: #737b8b; font-size: 12px; line-height: 1.5; pointer-events: auto; }
.library-home .lh-motion-toggle { display: grid; place-items: center; width: 26px; height: 26px; padding: 3px; border: 0; border-radius: 50%; background: none; color: #778191; }
.library-home .lh-motion-toggle:hover { background: #fff0e7; color: #f37339; }
.library-home .lh-motion-toggle:disabled { opacity: .65; cursor: default; }
.library-home .lh-motion-toggle svg { width: 19px; height: 19px; }
.library-home .lh-saved-project { display: flex; justify-content: center; flex-wrap: wrap; gap: 9px 18px; margin-top: 11px; }
.library-home .lh-saved-project button { max-width: 250px; overflow: hidden; padding: 2px 0; border: 0; background: none; color: #727b87; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; pointer-events: auto; }
.library-home .lh-saved-project button:hover { color: #f16c32; }

@media (min-width: 1800px) { .library-home { --lh-card-width: clamp(240px, 13vw, 310px); } }
@media (max-width: 720px) {
  .library-home { --lh-card-width: 176px; --lh-gap: 8px; height: calc(100svh - 66px); min-height: 670px; }
  .library-home .lh-poster-wall { inset: 0 0 20px; }
  .library-home .lh-game-cover { border-radius: 6px; }
  .library-home .lh-agent-center { width: min(540px, calc(100% - 28px)); transform: translate(-50%, -46%); }
  .library-home .lh-agent-center::before { inset: -29px -27px -30px; background: radial-gradient(ellipse closest-side, #fffdf9 0%, #fffdf9fa 80%, #fffdf9a6 93%, #fffdf900 100%); filter: blur(9px); }
  .library-home .lh-hero-spark { width: 28px; height: 28px; margin-bottom: 13px; }
  .library-home h1 { font-size: clamp(24px, 5.7vw, 36px); letter-spacing: -1px; }
  .library-home .lh-hero-description { margin: 8px 0 17px; font-size: 14px; letter-spacing: .4px; }
  .library-home .lh-agent-composer { padding: 16px 14px 12px; border-radius: 13px; box-shadow: 0 8px 30px #654a2514; }
  .library-home .lh-agent-heading { gap: 7px; margin-bottom: 13px; }
  .library-home .lh-agent-heading p { font-size: 11px; }
  .library-home .lh-agent-heading strong { font-size: 14px; }
  .library-home #start-idea { min-height: 110px; padding: 12px; font-size: 16px; }
  .library-home .lh-add-reference { gap: 4px; font-size: 12px; }
  .library-home .lh-add-reference svg { width: 21px; height: 21px; }
  .library-home .lh-launch-button { gap: 14px; min-width: 125px; min-height: 42px; padding: 10px 14px; font-size: 13px; }
  .library-home .lh-library-hint { margin-top: 12px; font-size: 11px; }
  .library-home .lh-saved-project { margin-top: 9px; }
}

@media (max-width: 360px) {
  .library-home h1 { font-size: 22px; }
  .library-home .lh-agent-center { width: calc(100% - 22px); }
  .library-home .lh-agent-heading p { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .library-home .lh-cover-track { will-change: auto; }
  .library-home .lh-game-cover, .library-home .lh-cover-title, .library-home .lh-cover-flip, .library-home .lh-poster-wall { transition: none; }
}
