/* Title-screen owner. Gameplay retains its independent modern-polish theme. */
:root {
  color-scheme: light;
  --title-paper: #f8f9fc;
  --title-white: #fff;
  --title-ink: #182a40;
  --title-muted: #67778a;
  --title-line: #dbe2e9;
  --title-gold: #a58b56;
  --title-blue: #366b8c;
  --title-danger: #a64249;
  --title-shadow: 0 22px 70px #1b38522b;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
body.title-page {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--title-ink);
  background: var(--title-paper);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 14px;
  line-height: 1.65;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body.title-has-modal { overflow: hidden; }
button, input, a, summary { touch-action: manipulation; }
button, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
button, summary, a { -webkit-user-select: none; user-select: none; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 3px solid #4186ac;
  outline-offset: 4px;
}
svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.title-icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.title-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; background: radial-gradient(ellipse at 15% 15%, #e2eff642, transparent 40%), radial-gradient(ellipse at 90% 80%, #e9e0f349, transparent 45%), linear-gradient(165deg, #fff 5%, #f6f8fb 65%, #eef3f7); }
.title-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 27%, #fff9 27.1%, #fff0 48%), linear-gradient(45deg, transparent 66%, #fff8 66.1%, #fff0 88%); }
.title-orbit { position: absolute; width: 900px; height: 900px; border: 1px solid #a58b561a; border-radius: 50%; }
.title-orbit--one { top: -560px; left: calc(50% - 530px); }
.title-orbit--two { bottom: -570px; right: calc(50% - 590px); }
.title-facet { position: absolute; width: 150px; height: 240px; border: 1px solid #a9bdcf27; transform: rotate(35deg) skewY(-20deg); }
.title-facet--one { left: calc(50% - 245px); top: 13%; }
.title-facet--two { right: calc(50% - 270px); bottom: 15%; width: 220px; height: 300px; border-color: #bea77420; }
.title-shell { width: min(100%, 540px); min-height: 100vh; min-height: 100svh; margin: auto; padding: max(16px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); display: flex; flex-direction: column; }
.title-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.title-beta-badge { margin: 0; display: inline-flex; align-items: center; gap: 7px; font-size: 10px; letter-spacing: .06em; color: #728093; }
.title-beta-badge > span { width: 5px; height: 5px; border-radius: 50%; background: #a58b56; box-shadow: 0 0 0 3px #a58b5612; }
.title-tool { border: 0; display: flex; align-items: center; gap: 7px; padding: 10px 0 10px 10px; color: #53697f; background: transparent; font-size: 11px; min-height: 44px; }
.title-hero { display: flex; align-items: center; justify-content: center; flex-direction: column; flex: 1 0 auto; min-height: 270px; min-height: clamp(240px, 35svh, 350px); padding: 28px 0 20px; }
.title-logo { width: calc(100% + 22px); margin: 0; }
.title-logo img { width: 100%; height: auto; display: block; mix-blend-mode: multiply; }
.title-elements { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 24px; width: 120px; }
.title-elements::before, .title-elements::after { content: ""; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, #b6a47c80); }
.title-elements::after { transform: rotate(180deg); }
.title-elements i { width: 3px; height: 3px; border-radius: 50%; background: #bc8a7c; }
.title-elements i:nth-child(2) { background: #89a493; }
.title-elements i:nth-child(3) { background: #bfa670; }
.title-elements i:nth-of-type(4) { background: #94adbf; }
.title-elements i:nth-of-type(5) { background: #c5b58b; }
.title-elements i:nth-of-type(6) { background: #a797b6; }
.title-elements b { width: 5px; height: 5px; border: 1px solid #a58b56; transform: rotate(45deg); }
.title-actions { min-height: 162px; align-content: center; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; padding-bottom: 30px; }
.title-save-status { grid-column: 1 / -1; margin: 0; text-align: center; color: #7b8795; font-size: 12px; }
.title-save-retry { grid-column: 1 / -1; justify-self: center; }
.btn { border: 1px solid var(--title-line); border-radius: 10px; color: var(--title-ink); background: #fff; min-height: 48px; padding: 12px 17px; font-size: 14px; font-weight: 600; line-height: 1.5; transition: background .18s, border-color .18s, box-shadow .18s, transform .18s; }
.btn:not(:disabled):active, .title-tool:active { transform: translateY(1px); }
.btn:disabled { color: #8a94a1; background: #f0f3f6; opacity: .65; }
.title-action { display: flex; align-items: center; gap: 12px; justify-content: center; text-align: center; padding: 17px 18px; letter-spacing: .08em; border-radius: 6px; border-color: #c5b389; background: linear-gradient(180deg, #fff, #f7f4ec); box-shadow: inset 0 0 0 2px #fff9; }
.title-action > span { flex: 1; }
.title-action--auto { grid-column: 1 / -1; min-height: 64px; }
.title-action--slots, .title-action--new { min-height: 56px; font-size: 13px; padding: 14px 15px; gap: 8px; }
body[data-has-auto="true"] .title-action--auto,
body[data-has-save="false"] .title-action--new,
body[data-has-save="true"][data-has-auto="false"] .title-action--slots {
  color: #fff; border-color: #b7a374; background: linear-gradient(115deg, #22394f, #1c3047 62%, #2b4963); box-shadow: inset 0 0 0 2px #20374e, inset 0 0 0 3px #c9b48659, 0 6px 18px #203f611c; font-size: 16px; min-height: 64px; padding: 17px 20px; position: relative; overflow: hidden;
}
body[data-has-save="false"] .title-action--new,
body[data-has-save="true"][data-has-auto="false"] .title-action--slots,
body[data-has-save="true"][data-has-auto="false"] .title-action--new { grid-column: 1 / -1; }
body[data-has-save="false"] .btn-load, body[data-has-auto="false"] .title-action--auto { display: none; }
.title-lower { border-top: 1px solid #cbd4df; padding-top: 20px; }
.title-news { width: 100%; display: grid; gap: 8px; border: 1px solid #dce3eb; border-radius: 10px; padding: 15px 16px; background: #ffffffb8; color: var(--title-ink); text-align: left; box-shadow: 0 3px 8px #304b6510; }
.title-news-heading { display: flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 600; color: #62788f; }
.title-news-heading time { margin-left: auto; color: #8895a4; font-size: 10px; font-weight: 400; font-variant-numeric: tabular-nums; }
.title-news-line { display: flex; align-items: center; justify-content: space-between; gap: 15px; font-size: 12px; line-height: 1.6; }
#title-news-headline { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.title-beta-note { margin-top: 10px; }
summary { list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
.title-beta-note > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 48px; color: #7b8591; font-size: 10px; letter-spacing: .01em; padding: 11px 2px; }
.title-beta-note > summary svg { width: 13px; height: 13px; transform: rotate(90deg); transition: transform .18s; }
.title-beta-note[open] > summary svg { transform: rotate(-90deg); }
.title-beta-content { padding: 2px 4px 14px; font-size: 12px; line-height: 1.9; color: #5b6b7e; }
.title-beta-content p { margin: 0 0 10px; }
.title-beta-content a { color: #2b688f; text-underline-offset: 3px; }
.title-footer { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; margin-top: auto; padding-top: 28px; font-size: 10px; color: #7e8b9b; }
.title-portal-link { display: flex; gap: 7px; align-items: center; min-height: 44px; color: #6c7e91; text-decoration: none; }
.title-portal-link svg { width: 12px; height: 12px; }
.title-support { text-align: right; }
.title-support > summary { display: flex; align-items: center; min-height: 44px; padding-left: 12px; }
.title-support-links { display: grid; gap: 4px; text-align: left; padding: 6px 0 8px; }
.title-support-links a { color: #667b91; padding: 7px 0; min-height: 36px; text-underline-offset: 4px; }
.title-modal-overlay, .title-dialog-overlay, #news-list-modal, #news-detail-modal {
  position: fixed; inset: 0; top: var(--title-viewport-top, 0px); height: var(--title-viewport-height, 100dvh); z-index: 1000; display: flex; align-items: flex-end; justify-content: center; background: #1a2c4561; backdrop-filter: blur(9px); -webkit-backdrop-filter: blur(9px); padding: max(16px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.title-modal-overlay { display: none; }
.save-slot-overlay { position: fixed; top: var(--title-viewport-top, 0px); height: var(--title-viewport-height, 100dvh); z-index: 1100; }
#news-list-modal { z-index: 1200; }
#news-detail-modal { z-index: 1300; }
.title-dialog-overlay { z-index: 1400; align-items: center; }
.title-modal-content, .title-dialog-box, .news-detail-dialog {
  width: min(100%, 480px); max-height: 100%; max-height: calc(var(--title-viewport-height, 100dvh) - max(16px, env(safe-area-inset-top)) - max(12px, env(safe-area-inset-bottom))); display: flex; flex-direction: column; min-height: 0; color: var(--title-ink); background: var(--title-white); border: 1px solid #d6dfe6; border-radius: 20px; box-shadow: var(--title-shadow); overflow: hidden; animation: title-sheet-enter .22s cubic-bezier(.2,.7,.2,1) both;
}
.title-modal-content { padding: 0 22px 20px; gap: 17px; overflow-y: auto; overscroll-behavior: contain; }
.title-sheet-header { display: flex; align-items: center; flex-shrink: 0; gap: 11px; min-height: 82px; border-bottom: 1px solid #e3e8ee; margin-bottom: 4px; }
.title-sheet-emblem { width: 34px; height: 34px; display: grid; place-items: center; color: #9f8b60; background: #f8f5ed; border-radius: 8px; }
.title-sheet-emblem svg { width: 22px; height: 22px; }
.modal-title { margin: 0; font-size: 18px; letter-spacing: .07em; font-weight: 600; }
.title-icon-button { display: grid; place-items: center; border: 0; border-radius: 50%; color: #738093; background: #f2f5f8; width: 40px; height: 40px; margin-left: auto; flex-shrink: 0; }
.title-icon-button svg { width: 18px; height: 18px; }
.title-data-actions { display: grid; gap: 0; border: 1px solid #e0e6ec; border-radius: 11px; overflow: hidden; }
.title-data-row { width: 100%; min-height: 60px; display: flex; gap: 14px; align-items: center; text-align: left; font-weight: 500; border: 0; border-radius: 0; padding: 17px 16px; background: #fff; }
.title-data-actions .title-data-row + .title-data-row { border-top: 1px solid #e7ecf1; }
.btn-danger { color: var(--title-danger); border: 1px solid #ebd5d7; background: #fff9f9; border-radius: 10px; }
.title-modal-actions, .title-dialog-buttons { display: flex; gap: 10px; flex-shrink: 0; }
.title-modal-actions .btn, .title-dialog-buttons .btn { flex: 1; min-width: 0; }
.title-modal-actions > .btn-new, .title-dialog-buttons > .btn:first-child { color: #fff; border-color: #233b53; background: #233b53; }
.title-modal-actions > .btn-close, .btn-muted { background: #f2f5f8; border-color: #e1e7ec; color: #66788b; }
.title-prologue-modal { padding: 0; gap: 0; border: 1px solid #b99761; border-radius: 10px; color: #f5dfb8; background: linear-gradient(160deg, #302015, #180e09 65%, #130905); }
.title-prologue-header { display: flex; align-items: center; gap: 12px; padding: 20px 22px 17px; flex-shrink: 0; border-bottom: 1px solid #b9976147; }
.title-prologue-header .modal-title { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(18px, 5.5vw, 22px); letter-spacing: .1em; color: #f0dbb6; font-weight: 500; white-space: nowrap; }
.title-prologue-header .title-icon-button { color: #d8c3a4; background: #ffffff0b; border: 1px solid #b9976142; }
.title-prologue-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.title-protagonist { position: relative; height: min(245px, 28svh, calc(var(--title-viewport-height, 100dvh) * .28)); margin: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 75%, #42615840, transparent 65%); }
.title-protagonist img { position: absolute; width: 340px; max-width: none; height: auto; top: -98px; left: 50%; transform: translateX(-50%); }
.title-protagonist::after { content: ""; position: absolute; inset: auto 0 0; height: 48px; background: linear-gradient(transparent, #1e140d); pointer-events: none; }
.title-name-entry { display: grid; gap: 9px; padding: 14px 24px 15px; border-top: 1px solid #b997612b; background: #1e140d; }
.setup-label { color: #d4bd96; font-size: 12px; letter-spacing: .06em; }
input[type="text"] { width: 100%; min-height: 52px; padding: 12px 15px; color: var(--title-ink); background: #f7f9fb; border: 1px solid #d9e1e9; border-radius: 9px; font-size: 16px; user-select: text; }
.title-name-entry input { text-align: center; color: #f8e8c8; background: #100905; border-color: #a98b595e; border-radius: 5px; letter-spacing: .12em; }
.title-name-entry input:focus-visible { outline-color: #d4b477; }
.title-name-help { margin: 0; color: #aa9372; font-size: 10px; text-align: center; }
.title-prologue-actions { padding: 16px 22px 20px; border-top: 1px solid #b9976147; background: #160c06; }
.title-prologue-actions .btn { border-radius: 6px; padding-left: 10px; padding-right: 10px; white-space: nowrap; }
.title-prologue-actions > .btn-new { color: #f9e7c4; border-color: #c4a065; background: linear-gradient(#5f3a1c, #281409); box-shadow: inset 0 1px 0 #fff2; }
.title-prologue-actions > .btn-muted { color: #c7b290; border-color: #866b424d; background: #26170d; }
@media (orientation: landscape) and (max-height: 520px) {
  .title-prologue-modal { width: min(100%, 680px); }
  .title-prologue-header { padding: 12px 20px; }
  .title-prologue-body { display: grid; grid-template-columns: 1fr 1fr; align-items: center; }
  .title-protagonist { height: 155px; }
  .title-protagonist img { width: 290px; top: -84px; }
  .title-name-entry { border-top: 0; background: transparent; padding: 15px 20px; }
  .title-prologue-actions { padding-top: 10px; padding-bottom: 12px; }
}
.title-dialog-box { width: min(100%, 410px); padding: 25px 23px 21px; gap: 24px; overflow-y: auto; }
.title-dialog-text { white-space: pre-wrap; font-size: 14px; line-height: 1.9; overflow-wrap: anywhere; }
.news-detail-dialog { height: min(78dvh, 720px); }
.news-detail-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 19px 20px; border-bottom: 1px solid #e3e8ee; flex-shrink: 0; }
.news-detail-title { color: var(--title-ink); font-size: 18px; font-weight: 600; line-height: 1.6; overflow-wrap: anywhere; }
.news-list-body, .news-detail-body { padding: 16px; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.news-detail-footer { padding: 12px 20px; border-top: 1px solid #e2e8ee; display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; background: #fbfcfd; }
.news-detail-close { width: 100%; }
.news-detail-heading { min-width: 0; }
.news-detail-header-close { font-size: 23px; line-height: 1; width: 40px; height: 40px; min-height: 40px; padding: 0; background: #f1f5f8; color: #788a9b; border: 0; border-radius: 50%; flex-shrink: 0; }
.news-entry-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; color: #8594a5; font-size: 10px; margin-bottom: 7px; }
.news-category { display: inline-block; border: 1px solid #dae4ed; background: #edf3f7; padding: 2px 6px; color: #607e96; font-size: 9px; border-radius: 4px; font-weight: 400; }
.news-category-operations { color: #97815b; background: #faf6ec; border-color: #e9deca; }
.news-list-entry { display: block; width: 100%; margin-bottom: 10px; text-align: left; padding: 15px; border-radius: 10px; font-size: 13px; font-weight: 500; }
.news-list-entry > span { display: block; line-height: 1.7; overflow-wrap: anywhere; }
.news-detail-body { font-size: 14px; line-height: 1.95; user-select: text; padding: 22px; }
.news-detail-body p { margin: 0 0 1.3em; white-space: pre-wrap; overflow-wrap: anywhere; }
.news-detail-body p:last-child { margin-bottom: 0; }
.news-detail-navigation { display: flex; gap: 10px; }
.news-detail-navigation .btn { flex: 1; font-size: 12px; }
@keyframes title-sheet-enter { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@media (hover: hover) {
  .btn:not(:disabled):hover, .title-news:hover { border-color: #9aafc2; box-shadow: 0 3px 12px #1c3d5614; }
  .title-data-row:hover { background: #f4f7fa; }
  .title-action:not(:disabled):hover { border-color: #ad9256; }
  .title-tool:hover { color: #a58b56; }
}
@media (min-width: 620px) {
  .title-shell { padding-top: 28px; padding-bottom: 22px; }
  .title-hero { min-height: clamp(300px, 42svh, 410px); }
  .title-modal-overlay, #news-list-modal, #news-detail-modal { align-items: center; padding: 30px; }
  .title-modal-content, .news-detail-dialog { max-height: calc(var(--title-viewport-height, 100dvh) - 60px); }
}
@media (max-width: 359px) {
  .title-shell { padding-right: 18px; padding-left: 18px; }
  .title-action--slots, .title-action--new { padding: 13px 12px; font-size: 12px; }
  .title-modal-content:not(.title-prologue-modal) { padding-right: 17px; padding-left: 17px; }
}
@media (max-height: 700px) {
  .title-hero { min-height: 215px; padding: 16px 0; }
  .title-actions { padding-bottom: 22px; }
  .title-footer { padding-top: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
