/* 主页。海报宽度贴满、底边对齐；屏幕比海报高时，上面多出来的部分用海报的天空色补齐。
   起点格按钮按海报坐标定位，正好盖住海报底部路线终点那块空地（x 21%–76%，y 88%–97%）。 */
#home { background: linear-gradient(var(--sky) 50%, #08B96C 50%); }   /* 下半是海报底边的绿 */

.poster { position: absolute; left: 0; right: 0; bottom: env(safe-area-inset-bottom); aspect-ratio: 941 / 1672; }
.poster-art { width: 100%; height: 100%; }

.start { position: absolute; left: 12.7%; top: 87%; width: 72%; z-index: 2; }

/* 标题：位置和宽度由 home.js 按屏幕算 */
.title { position: absolute; left: 0; top: 0; width: 0; z-index: 2; pointer-events: none; }
.title img { width: 100%; height: auto; }

.chips { position: absolute; top: calc(env(safe-area-inset-top) + 10px); right: 8px; display: flex; gap: 4px; z-index: 3; }
#chip-sound .on, #chip-sound[aria-pressed="true"] .off { display: none; }
#chip-sound[aria-pressed="true"] .on { display: block; }

/* 继续上一局 */
#resume { z-index: 5; }
.rs-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-top: 1px dashed rgba(42, 10, 30, .15); }
.rs-row:first-child { border-top: 0; }
.rs-row > div { min-width: 0; }
.rs-row b { display: block; font-size: 18px; }
.rs-row span:not(.av) { display: block; font-size: 15px; color: #6A3B2C; margin-top: 2px; }
.rs-city { flex: none; width: 60px; height: 60px; }
.rs-row .av { flex: none; width: 50px; height: 50px; margin: 0 5px; }
.rs-acts { display: flex; gap: 10px; margin-top: 14px; }
.rs-acts .slab { flex: 1; font-size: 21px; }
.rs-acts .slab.cream { flex: .62; }

/* 进场：图和字都准备好后再一起出现 */
#home .poster-art, #home .title, #home .start, #home .chips { opacity: 0; }
#home.ready .poster-art { opacity: 1; transition: opacity .35s ease-out; }
#home.ready .chips { opacity: 1; transition: opacity .3s .5s; }
#home.ready .title { opacity: 1; animation: drop .75s .15s cubic-bezier(.3, 1.4, .5, 1) backwards; }
#home.ready .start { opacity: 1; animation: pop .5s .55s cubic-bezier(.3, 1.6, .5, 1) backwards, breathe 2s 1.4s ease-in-out infinite; }
#home.ready .start:active { animation: none; }
#home.again .title, #home.again .start { animation-delay: 0s, 1s; animation-duration: .01s, 2s; }   /* 从别的页回来不再重播进场 */
@keyframes drop { from { opacity: 0; transform: translateY(-40px) scale(.7); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  #home.ready .title, #home.ready .start { animation: none; }
}
