#game-root[hidden], #title-screen[hidden] { display: none !important; }
.title-screen { position: fixed; inset: 0; z-index: 20; isolation: isolate; overflow: hidden; color: #234d41; background: radial-gradient(ellipse at 50% 90%,#dff0d9 0,#edf4df 48%,#f8f2d9 100%); }
.title-art { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.title-art--wide { background-color: #dcebd7; background-image: url('/src/assets/luna-i-title-screen/title-background-landscape.png'),linear-gradient(160deg,#f8f2d9,#dff0d9); background-position: center,center; background-repeat: no-repeat; background-size: cover,cover; }
.title-art--wide::after { content: ""; position: absolute; left: 3%; bottom: 0; width: min(31vw,430px); height: min(80vh,780px); background-image: url('/src/assets/luna-i-title-screen/alinshi-title-mascot.png'); background-position: center bottom; background-repeat: no-repeat; background-size: contain; filter: drop-shadow(0 8px 12px #213d3533); }
.title-art--mobile { display: none; background-color: #dcebd7; background-position: center,center; background-repeat: no-repeat; background-size: cover,cover; }
.title-center { position: absolute; inset: 0; z-index: 1; text-align: center; pointer-events: none; }
.title-copy { position: absolute; top: 10%; left: 35%; box-sizing: border-box; width: 42%; margin: 0; padding: 13px 18px; border: 1px solid #fffde1cc; border-radius: 22px; background: #fff9e8e8; box-shadow: 0 12px 34px #183e382b; backdrop-filter: blur(5px); }
.title-eyebrow { margin: 0 0 5px; color: #7a5930; font-size: clamp(12px,1.2vw,16px); font-weight: 800; letter-spacing: .12em; }
.title-center h1 { margin: 0; font-family: "Noto Serif TC","Songti TC",serif; font-weight: 900; font-size: clamp(30px,4.3vw,56px); letter-spacing: .06em; line-height: 1.2; color: #245e49; }
.title-subtitle { margin: 5px 0 0; color: #385d4b; font-size: clamp(13px,1.25vw,17px); line-height: 1.5; }
.title-actions { position: absolute; top: 68%; left: 43%; display: grid; width: 26%; max-width: none; gap: 10px; margin: 0; pointer-events: auto; }
.title-button { min-height: 52px; padding: 12px 20px; border: 2px solid transparent; border-radius: 16px; font: inherit; font-size: 17px; font-weight: 800; cursor: pointer; box-shadow: 0 4px 0 #0003; }
.title-button--primary { color: #fff7df; background: #23654d; }
.title-button--secondary { color: #244d3d; background: #fff9df; border-color: #a8bc91; }
.title-button:disabled { opacity: .72; cursor: not-allowed; box-shadow: none; }
.title-button:focus-visible,.version-chip:focus-visible,.app-dialog button:focus-visible { outline: 3px solid #f2bf5e; outline-offset: 3px; }
.title-status { position: absolute; top: 89%; left: 32%; display: grid; width: 36%; gap: 0; }
.title-hint,.title-error { box-sizing: border-box; min-height: 1.5em; margin: 0; padding: 4px 10px; border-radius: 12px; background: #fff9e8ed; box-shadow: 0 3px 10px #183e3822; font-size: 13px; line-height: 1.4; color: #334e3e; }
.title-error { color: #812c22; font-weight: 700; }
.title-error[hidden] { display: none; }
.title-error:not([hidden]) { max-height: 3.5em; overflow: auto; }
.version-chip { position: fixed; z-index: 30; min-height: 44px; padding: 7px 12px; border: 1px solid #d1dcb8; border-radius: 999px; color: #42664e; background: #fffbe9ed; font: 700 12px/1 inherit; cursor: pointer; box-shadow: 0 2px 9px #264d4120; }
.version-chip--title { right: max(12px,env(safe-area-inset-right)); bottom: max(12px,env(safe-area-inset-bottom)); }
.version-chip--game { right: max(12px,env(safe-area-inset-right)); bottom: calc(92px + env(safe-area-inset-bottom)); }
#game-settings { position: fixed; z-index: 30; right: max(100px,calc(80px + env(safe-area-inset-right))); bottom: calc(92px + env(safe-area-inset-bottom)); min-width: 44px; min-height: 44px; border: 1px solid #d1dcb8; border-radius: 50%; color: #42664e; background: #fffbe9ed; font-size: 18px; box-shadow: 0 2px 9px #264d4120; }
.app-dialog { width: min(480px,calc(100% - 28px)); max-height: min(80dvh,620px); padding: 24px; border: 2px solid #d8dfb2; border-radius: 22px; color: #315e4b; background: #fffbeb; box-shadow: 0 20px 90px #244e5144; }
.app-dialog::backdrop { background: #244c4475; backdrop-filter: blur(4px); }
.app-dialog h2 { margin: 0 0 12px; font-family: "Noto Serif TC","Songti TC",serif; }
.app-dialog p { line-height: 1.8; }
.app-dialog>div { display: flex; justify-content: flex-end; gap: 10px; }
.app-dialog button { min-height: 44px; padding: 9px 16px; border: 1px solid #cad7b1; border-radius: 12px; color: #31614b; background: #f4f3db; font: inherit; font-weight: 700; cursor: pointer; }
#confirm-restart { color: white; background: #a24d39; border-color: #a24d39; }
.app-dialog__close { float: right; width: 44px; padding: 4px !important; font-size: 24px !important; }
#release-content { max-height: 60dvh; overflow: auto; white-space: pre-wrap; font: 14px/1.8 system-ui,sans-serif; color: #4d6854; }
.first-shipment-ending[open] { display: grid; gap: 12px; max-height: min(88dvh,680px); overflow-y: auto; }
.first-shipment-ending__eyebrow { margin: 0; color: #a77b3c; font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.first-shipment-ending h2 { margin: 0; padding-right: 42px; font-size: clamp(22px,4vw,30px); line-height: 1.35; }
.first-shipment-ending__copy { margin: 0; }
.first-shipment-ending__receipt,.first-shipment-ending__links { display: grid; gap: 6px; padding: 12px 14px; border-radius: 14px; background: #edf1dc; }
.first-shipment-ending__receipt h3 { margin: 0; font-size: 14px; }
.first-shipment-ending__receipt p { margin: 0; white-space: pre-line; font-weight: 800; }
.first-shipment-ending__season { display: grid; gap: 6px; margin-top: 9px; padding-top: 9px; border-top: 1px solid #dce4cb; }
.first-shipment-ending__season[hidden] { display: none; }
.first-shipment-ending__receipt-details { display: grid; gap: 7px; padding-top: 7px; border-top: 1px solid #dce4cb; }
.first-shipment-ending__receipt-details summary,.first-shipment-ending__receipt-raw summary { color: #42664e; cursor: pointer; font-size: 11px; font-weight: 800; }
.first-shipment-ending__receipt-details p { color: #526d58; font-size: 11px; font-weight: 600; line-height: 1.7; }
.first-shipment-ending__receipt-raw { padding-top: 5px; }
.first-shipment-ending__receipt-raw pre { max-height: 180px; overflow: auto; margin: 5px 0 0; color: #71836a; font: 9px/1.5 ui-monospace,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.first-shipment-ending__receipt small,.first-shipment-ending__links { color: #71836a; font-size: 11px; line-height: 1.6; }
.first-shipment-ending__links b { color: #42664e; }
.first-shipment-ending__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.first-shipment-ending__restart { color: #fff7df !important; background: #2d805e !important; }
@media(max-width:520px) { .first-shipment-ending[open] { padding: 18px; } .first-shipment-ending__actions { display: grid; grid-template-columns: 1fr 1fr; } .first-shipment-ending__actions button { padding-inline: 8px; } }
@media (max-width: 950px) and (orientation: landscape) and (max-height: 520px) {
 .version-chip--game,#game-settings { z-index: 19; }
}
@media(max-width:700px) and (orientation:portrait) {
 .version-chip--game,#game-settings { bottom: calc(112px + env(safe-area-inset-bottom)); }
 .title-screen { display: flex; flex-direction: column; justify-content: flex-start; gap: 8px; padding: max(22px,env(safe-area-inset-top)) 18px 70px; }
 .title-center { order: 0; padding: 8px 0 4px; }
 .title-center h1 { font-size: clamp(28px,8vw,38px); }
 .title-subtitle { margin-bottom: 15px; font-size: 14px; }
 .title-actions { gap: 10px; }
 .title-button { min-height: 50px; }
 .title-art { flex: 1 1 0; width: min(100%,420px); min-height: 100px; max-height: 190px; border-radius: 28px; }
 .title-art--character { order: 1; }
 .title-art--pond { order: 2; }
 .title-art__figure { font-size: 90px; }
 .title-art__water { font-size: 100px; }
 .title-art small { bottom: 6px; }
}
@media(max-width:700px) and (orientation:landscape) {
 .title-screen { grid-template-columns: .7fr 1.2fr .7fr; gap: 10px; padding: 12px 42px 12px 16px; }
 .title-art { min-height: min(78dvh,285px); border-radius: 30px; }
 .title-center { padding: 5px; }
 .title-center h1 { font-size: clamp(23px,5vw,36px); }
 .title-eyebrow,.title-subtitle { margin: 6px 0; font-size: 11px; }
 .title-actions { gap: 7px; }
 .title-button { min-height: 44px; padding: 8px; font-size: 14px; }
 .title-art__figure { font-size: 74px; }
 .title-art__water { font-size: 90px; }
}

@media(max-width:700px) and (orientation:portrait) {
 .title-screen { display: block; padding: 0; }
 .title-art--wide { display: none; }
 .title-art--mobile { display: block; background-image: url('/src/assets/luna-i-title-screen/title-screen-mobile-portrait-preview.png'),linear-gradient(160deg,#f8f2d9,#dff0d9); }
 .title-copy { top: max(8%,env(safe-area-inset-top)); left: 12%; width: 76%; padding: 8px 11px; border-radius: 17px; }
 .title-eyebrow { margin-bottom: 3px; font-size: 10px; letter-spacing: .08em; }
 .title-center h1 { font-size: clamp(25px,7.3vw,31px); letter-spacing: .025em; line-height: 1.18; }
 .title-subtitle { margin-top: 3px; font-size: 12px; line-height: 1.35; }
 .title-actions { top: 77%; left: 53%; width: 38%; gap: 6px; }
 .title-button { min-height: 44px; padding: 7px 8px; border-radius: 13px; font-size: 14px; }
 .title-status { top: 89%; left: 6%; width: 68%; }
 .title-hint,.title-error { padding: 3px 8px; font-size: 11px; line-height: 1.35; }
 .version-chip--title { right: max(10px,env(safe-area-inset-right)); bottom: max(10px,env(safe-area-inset-bottom)); }
}

@media(max-width:950px) and (orientation:landscape) and (max-height:520px) {
 .title-screen { display: block; padding: 0; }
 .title-art--wide { display: none; }
 .title-art--mobile { display: block; background-image: url('/src/assets/luna-i-title-screen/title-screen-mobile-landscape-preview.png'),linear-gradient(160deg,#f8f2d9,#dff0d9); }
 .title-copy { top: max(8%,env(safe-area-inset-top)); left: 36%; width: 40%; padding: 7px 11px; border-radius: 15px; }
 .title-eyebrow { margin-bottom: 2px; font-size: 10px; letter-spacing: .06em; }
 .title-center h1 { font-size: clamp(21px,3vw,26px); letter-spacing: .02em; line-height: 1.15; }
 .title-subtitle { margin-top: 2px; font-size: 11px; line-height: 1.25; }
 .title-actions { top: 72%; left: 42%; display: grid; grid-template-columns: 1fr 1fr; width: 30%; gap: 6px; }
 .title-button { min-height: 44px; padding: 5px 4px; border-radius: 12px; font-size: clamp(11px,1.5vw,13px); white-space: nowrap; }
 .title-status { top: 85%; left: 24%; width: 52%; }
 .title-hint,.title-error { padding: 2px 7px; font-size: 11px; line-height: 1.3; }
 .version-chip--title { right: max(8px,env(safe-area-inset-right)); bottom: max(8px,env(safe-area-inset-bottom)); }
}

@media(max-width:700px) and (orientation:portrait) {
 /* Override the legacy card sizing: this art layer covers the whole viewport. */
 .title-art--mobile { inset: 0; width: auto; height: auto; min-height: 0; max-height: none; border-radius: 0; }
}

#restart-confirm,#release-dialog { overflow-y: auto; }
