/* title screen, subtitles, help — owned by main.js */
.title-screen { position: absolute; inset: 0; pointer-events: auto; overflow: hidden; cursor: pointer; background: #1d1838; }
.title-art { position: absolute; inset: -2%; background: url(assets/cover-bg.webp) center / cover no-repeat; animation: titleDrift 18s ease-in-out infinite alternate; }
@keyframes titleDrift { from { transform: scale(1.02) translateY(0); } to { transform: scale(1.06) translateY(-1.2%); } }
.title-logo { position: absolute; left: 50%; top: 6%; width: 82%; max-height: 30%; object-fit: contain; transform: translateX(-50%);
  filter: drop-shadow(0 4px 10px rgba(30, 20, 60, .45)); animation: logoIn .7s cubic-bezier(.2, 1.5, .4, 1) both, logoFloat 4s ease-in-out .8s infinite; }
@keyframes logoIn { from { opacity: 0; transform: translateX(-50%) translateY(-40px) scale(.7); } to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } }
@keyframes logoFloat { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }
.title-prompt { position: absolute; left: 50%; bottom: 9%; transform: translateX(-50%); padding: 10px 28px; white-space: nowrap;
  font: 700 20px var(--font, sans-serif); color: #fff; letter-spacing: .06em;
  background: linear-gradient(180deg, rgba(59, 40, 96, .72), rgba(43, 35, 80, .82)); border: 2px solid #d9b45a; border-radius: 999px;
  box-shadow: 0 0 0 4px rgba(217, 180, 90, .25), 0 6px 18px rgba(20, 10, 40, .4);
  text-shadow: 0 2px 0 #2b2350, 0 0 6px rgba(0, 0, 0, .4); animation: promptPulse 1.6s ease-in-out infinite; }
@keyframes promptPulse { 0%, 100% { opacity: 1; transform: translateX(-50%) scale(1); } 50% { opacity: .78; transform: translateX(-50%) scale(.96); } }
.title-endless { position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 112px; max-width: 46%; min-height: 50px; padding: 5px 12px; border-radius: 12px; border: 2.5px solid #d9b45a; cursor: pointer;
  background: linear-gradient(#4d5eae, #3b4a8c); color: #fff; box-shadow: 0 3px 8px rgba(20, 10, 50, .45); animation: k-pop .3s ease-out .4s both; }
.title-endless:active { transform: scale(.95); }
.title-endless .te-name { font: 700 15px/1.1 var(--title-font), serif; text-shadow: 0 2px 0 #1e1840, 0 0 3px #1e1840; white-space: nowrap; }
.title-endless .te-best { font: 700 12px/1.1 var(--font), sans-serif; color: #f6e3a1; text-shadow: 0 1px 0 #1e1840, 0 0 2px #1e1840; white-space: nowrap; }
.title-trophy { position: absolute !important; top: calc(10px + env(safe-area-inset-top)); right: 10px; }
.title-petals { position: absolute; inset: 0; pointer-events: none; }
.title-petals i { position: absolute; top: -5%; width: 12px; height: 9px; border-radius: 70% 0 70% 0; background: linear-gradient(135deg, #ffd6e4, #f4a7c0);
  opacity: .85; animation: petalFall linear infinite; }
@keyframes petalFall { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(-30px, 55vh) rotate(200deg); } 100% { transform: translate(20px, 110vh) rotate(420deg); } }
/* portrait game: on a wide window keep the stage 9:16 in the middle */
@media (min-aspect-ratio: 10/16) {
  html, body { background: #120f26; }
  #stage { width: calc(100dvh * 9 / 16); left: calc(50vw - 100dvh * 9 / 32); right: auto; }
}
.subtitle { position: absolute; left: 50%; bottom: 68%; transform: translateX(-50%) translateY(10px); max-width: 86%; padding: 8px 16px;
  font: 700 16px var(--font, sans-serif); color: #fff; text-align: center; background: rgba(43, 35, 80, .78); border: 1.5px solid #d9b45a;
  border-radius: 14px; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; z-index: 50; text-shadow: 0 1px 0 #2b2350; }
.subtitle.on { opacity: 1; transform: translateX(-50%) translateY(0); }
#ui:has(.k-modal) .subtitle { bottom: 2.5%; }
.help-text { font: 500 16px/1.6 var(--font, sans-serif); color: #2b2350; margin: 4px 2px; }
