/* REMENATRY phase 7: title engagement deck */

#title-screen.title-screen--premium {
  --title-accent: #72e6ef;
  --title-accent-rgb: 114, 230, 239;
  --title-warm: #efbd67;
  --title-ink: #03080d;
  --title-panel: rgba(5, 15, 22, .88);
  overflow: hidden !important;
  background: #02070c !important;
}

#title-screen[data-ship-skin="sakuratake"] {
  --title-accent: #9be3ba;
  --title-accent-rgb: 155, 227, 186;
  --title-warm: #f1a9bd;
}

#title-screen.title-screen--premium .title-premium-wrap {
  grid-template-rows: auto auto minmax(170px, 1fr) auto auto auto !important;
  gap: clamp(7px, 1.35vh, 13px) !important;
  padding:
    max(14px, env(safe-area-inset-top))
    clamp(14px, 4.8vw, 24px)
    max(10px, env(safe-area-inset-bottom)) !important;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(var(--title-accent-rgb), .13), transparent 31%),
    radial-gradient(ellipse at 90% 18%, rgba(81, 44, 126, .2), transparent 34%),
    linear-gradient(180deg, #071321 0%, #030a11 60%, #020609 100%) !important;
}

#title-screen .title-premium-wrap::before {
  opacity: .8 !important;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(var(--title-accent-rgb), .07) 50%, transparent 50.2%),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(var(--title-accent-rgb), .025) 40px),
    linear-gradient(180deg, transparent 72%, rgba(182, 69, 119, .08)) !important;
}

#title-screen .title-premium-wrap::after {
  inset: 7px !important;
  border-color: rgba(var(--title-accent-rgb), .19) !important;
  clip-path: polygon(0 0, 54px 0, 54px 1px, 100% 1px, 100% calc(100% - 34px), calc(100% - 34px) 100%, 0 100%) !important;
}

#title-screen .entry-title-world {
  inset: 16% -24% 17% 5% !important;
  opacity: .9;
}

#title-screen .entry-title-orbit--a {
  border-color: rgba(var(--title-accent-rgb), .2) !important;
  animation: titleOrbitDrift 18s linear infinite;
}

#title-screen .entry-title-orbit--b {
  animation: titleOrbitCounter 24s linear infinite;
}

#title-screen .entry-title-rift {
  opacity: .42 !important;
}

#title-screen .neo-title-top {
  grid-row: 1;
  min-height: 20px;
  padding: 0 2px 7px !important;
  align-items: center;
  border-bottom-color: rgba(var(--title-accent-rgb), .28) !important;
  color: #71868f !important;
  font-size: clamp(6px, 1.8vw, 8px) !important;
}

#title-screen .neo-title-top span {
  color: var(--title-accent) !important;
}

#title-screen .neo-title-main {
  grid-row: 2;
  width: 100%;
  padding-left: clamp(2px, 1vw, 6px);
}

#title-screen .neo-logo {
  max-width: 100%;
  color: #f2fbff !important;
  font-size: clamp(34px, 11vw, 54px) !important;
  letter-spacing: .025em !important;
  text-shadow:
    3px 0 0 #315f70,
    3px 3px 0 #122b38,
    0 0 22px rgba(var(--title-accent-rgb), .22) !important;
}

#title-screen .neo-logo::before {
  right: 0 !important;
  background: linear-gradient(90deg, var(--title-accent), rgba(var(--title-accent-rgb), .22) 72%, transparent) !important;
}

#title-screen .neo-logo-jp::before,
#title-screen .neo-logo-jp::after,
#title-screen .neo-sub-en {
  color: var(--title-accent) !important;
}

#title-screen .neo-sub-jp {
  color: #8da0a7 !important;
}

/* Central launch deck */
#title-screen .title-launch-deck {
  grid-row: 3;
  position: relative;
  z-index: 8;
  align-self: stretch !important;
  height: auto !important;
  min-height: 170px;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(var(--title-accent-rgb), .24);
  background:
    linear-gradient(90deg, rgba(var(--title-accent-rgb), .05) 1px, transparent 1px),
    linear-gradient(rgba(var(--title-accent-rgb), .04) 1px, transparent 1px),
    radial-gradient(ellipse at 50% 58%, rgba(var(--title-accent-rgb), .16), transparent 42%),
    linear-gradient(180deg, rgba(4, 14, 22, .52), rgba(2, 8, 13, .94));
  background-size: 30px 30px, 30px 30px, auto, auto;
  clip-path: polygon(0 0, calc(100% - 20px) 0, 100% 20px, 100% 100%, 20px 100%, 0 calc(100% - 20px));
}

#title-screen .title-launch-deck::before,
#title-screen .title-launch-deck::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

#title-screen .title-launch-deck::before {
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, var(--title-accent), transparent) top left / 34% 2px no-repeat,
    linear-gradient(270deg, var(--title-warm), transparent) bottom right / 26% 2px no-repeat;
  opacity: .72;
}

#title-screen .title-launch-deck::after {
  z-index: 7;
  left: 8%;
  right: 8%;
  top: -12%;
  height: 26%;
  opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(var(--title-accent-rgb), .13), transparent);
  animation: titleDeckScan 5.6s ease-in-out 1.3s infinite;
}

#title-screen .title-deck-radar {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(44vw, 176px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotateX(62deg);
  opacity: .55;
  border: 1px solid rgba(var(--title-accent-rgb), .27);
  border-radius: 50%;
}

#title-screen .title-deck-radar::before,
#title-screen .title-deck-radar::after,
#title-screen .title-deck-radar i {
  content: "";
  position: absolute;
  border: 1px solid rgba(var(--title-accent-rgb), .18);
  border-radius: 50%;
}

#title-screen .title-deck-radar::before { inset: 15%; }
#title-screen .title-deck-radar::after { inset: 31%; }
#title-screen .title-deck-radar i:nth-child(1) { inset: 49% -9% auto; border: 0; border-top: 1px solid rgba(var(--title-accent-rgb), .22); border-radius: 0; }
#title-screen .title-deck-radar i:nth-child(2) { inset: -9% 49% -9% auto; border: 0; border-left: 1px solid rgba(var(--title-accent-rgb), .18); border-radius: 0; }
#title-screen .title-deck-radar i:nth-child(3) {
  inset: 2px 50% 50% 2px;
  border: 0;
  border-right: 2px solid rgba(var(--title-accent-rgb), .46);
  border-radius: 100% 0 0;
  transform-origin: 100% 100%;
  animation: titleRadarSweep 5s linear infinite;
}

#title-screen .title-deck-readout {
  position: absolute;
  z-index: 6;
  top: 13px;
  display: grid;
  gap: 5px;
  max-width: 34%;
  color: #748a92;
  font: 700 6px/1 var(--entry-display);
  letter-spacing: .12em;
}

#title-screen .title-deck-readout b {
  min-width: 0;
  overflow: hidden;
  color: #d6e6e8;
  font: 800 clamp(9px, 2.5vw, 11px)/1.2 var(--entry-body);
  letter-spacing: .04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#title-screen .title-deck-readout--pilot { left: 13px; }
#title-screen .title-deck-readout--frame { right: 13px; text-align: right; }
#title-screen .title-deck-readout--frame b { color: var(--title-warm); }

#title-screen .title-launch-deck .title-ship {
  position: absolute !important;
  z-index: 5 !important;
  left: 50% !important;
  top: 51% !important;
  width: 132px !important;
  height: 86px !important;
  margin: 0 !important;
  filter: drop-shadow(0 10px 12px rgba(0, 0, 0, .46)) !important;
  transform: translate(-50%, -50%) scale(1.05) !important;
  animation: titleShipHover 4.2s ease-in-out infinite;
}

#title-screen .title-launch-deck .title-ship::before {
  width: 210px !important;
  background: linear-gradient(90deg, transparent, rgba(var(--title-accent-rgb), .58), transparent) !important;
}

#title-screen .title-launch-deck .title-ship::after {
  width: 104px !important;
  height: 26px !important;
  border-color: rgba(var(--title-accent-rgb), .28) !important;
  border-top-color: rgba(var(--title-accent-rgb), .7) !important;
  box-shadow: 0 6px 17px rgba(var(--title-accent-rgb), .12);
}

#title-screen .title-ship-core {
  box-shadow: 0 0 0 1px #d5fbff, 0 0 18px rgba(var(--title-accent-rgb), .42) !important;
}

#title-screen .title-deck-lock {
  position: absolute;
  z-index: 6;
  left: 50%;
  bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  color: #64777e;
  font: 700 6px/1 var(--entry-display);
  letter-spacing: .12em;
  white-space: nowrap;
}

#title-screen .title-deck-lock b {
  color: var(--title-accent);
  font-weight: 800;
}

#title-screen .title-deck-floor {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 20px;
  height: 22px;
  opacity: .52;
  border-top: 1px solid rgba(var(--title-accent-rgb), .42);
  background: repeating-linear-gradient(90deg, transparent 0 19px, rgba(var(--title-accent-rgb), .12) 20px);
  transform: perspective(100px) rotateX(65deg);
}

/* The save-state briefing makes CONTINUE feel concrete. */
#title-screen .title-operation-card {
  grid-row: 4;
  position: relative;
  z-index: 8;
  display: grid;
  gap: 7px;
  padding: 10px 12px 10px 14px;
  overflow: hidden;
  border: 1px solid rgba(var(--title-accent-rgb), .22);
  border-left: 3px solid var(--title-accent);
  background: linear-gradient(105deg, rgba(var(--title-accent-rgb), .1), rgba(4, 13, 20, .94) 38%, rgba(4, 12, 18, .82));
}

#title-screen .title-operation-head,
#title-screen .title-operation-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#title-screen .title-operation-head {
  color: var(--title-accent);
  font: 800 7px/1 var(--entry-display);
  letter-spacing: .14em;
}

#title-screen .title-operation-head b {
  color: var(--title-warm);
  font-size: 6px;
}

#title-screen .title-operation-stage,
#title-screen .title-operation-loadout {
  display: grid;
  min-width: 0;
  gap: 3px;
}

#title-screen .title-operation-stage { flex: 0 0 auto; }
#title-screen .title-operation-loadout { flex: 1 1 auto; text-align: right; }
#title-screen .title-operation-card small { color: #596d75; font: 700 6px/1 var(--entry-display); letter-spacing: .1em; }
#title-screen .title-operation-card strong { color: #e5eff0; font: 800 10px/1.2 var(--entry-body); letter-spacing: .04em; }
#title-screen .title-operation-loadout strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#title-screen .title-operation-stage strong { color: #fff0ce; font-family: var(--entry-display); }

#title-screen .title-operation-progress {
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .07);
}

#title-screen .title-operation-progress i {
  display: block;
  width: var(--title-progress, 2%);
  height: 100%;
  background: linear-gradient(90deg, var(--title-accent), var(--title-warm));
  box-shadow: 0 0 8px rgba(var(--title-accent-rgb), .4);
  transition: width .45s ease;
}

#title-screen .title-operation-card p {
  margin: 0;
  color: #81949a;
  font: 600 8px/1.35 var(--entry-body);
  letter-spacing: .025em;
}

#title-screen .neo-event-card {
  grid-row: 5;
  grid-template-columns: auto minmax(0, 1fr) !important;
  align-items: center;
  gap: 10px !important;
  padding: 8px 10px 8px 12px !important;
  border-left-width: 2px !important;
}

#title-screen .neo-event-label {
  display: block !important;
  white-space: nowrap;
}

#title-screen .neo-event-label span { display: none; }
#title-screen .neo-event-text { min-width: 0; font-size: 9px !important; line-height: 1.3 !important; }

#title-screen .neo-title-actions {
  grid-row: 6;
  position: relative !important;
  z-index: 9 !important;
}

#title-screen #tap-start-btn {
  min-height: 66px !important;
  border-color: rgba(var(--title-accent-rgb), .7) !important;
  color: #f2fbfb !important;
  background:
    linear-gradient(105deg, rgba(var(--title-accent-rgb), .2), transparent 52%),
    linear-gradient(180deg, #112a32, #09171e) !important;
  box-shadow:
    inset 4px 0 var(--title-accent),
    inset 0 1px rgba(255, 255, 255, .08),
    0 10px 24px rgba(0, 0, 0, .3),
    0 0 18px rgba(var(--title-accent-rgb), .08) !important;
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%);
}

#title-screen #tap-start-btn::before {
  right: 76%;
  background: linear-gradient(90deg, var(--title-accent), var(--title-warm)) !important;
  animation: titleStartCharge 2.8s ease-in-out infinite;
}

#title-screen #tap-start-btn:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 3px;
}

#title-screen #tap-start-btn:active {
  transform: scale(.985) !important;
}

#title-screen .entry-start-index {
  color: #032229;
  background: var(--title-accent);
}

#title-screen .entry-start-copy b {
  color: #f6ffff;
  font-size: clamp(13px, 3.6vw, 16px);
}

#title-screen .entry-start-copy small { color: #93adb1; }
#title-screen .entry-start-arrow { color: var(--title-warm); }
#title-screen .title-start-note { color: #789096 !important; text-align: center !important; }

#title-screen .title-footer-row {
  color: #566b72 !important;
}

#title-screen #title-update-btn {
  border-color: rgba(var(--title-accent-rgb), .2) !important;
  background: rgba(5, 16, 22, .72) !important;
}

/* One entrance, then a calm screen. */
#title-screen.screen-entering .neo-title-main { animation: titleLogoArrive .58s cubic-bezier(.2,.75,.2,1) both; }
#title-screen.screen-entering .title-launch-deck { animation: titleDeckArrive .62s .08s cubic-bezier(.16,.8,.25,1) both; }
#title-screen.screen-entering .title-operation-card { animation: titleBriefArrive .52s .18s ease-out both; }
#title-screen.screen-entering .neo-event-card { animation: titleBriefArrive .48s .24s ease-out both; }
#title-screen.screen-entering .neo-title-actions { animation: titleBriefArrive .48s .3s ease-out both; }

#title-screen .title-start-warp .title-launch-deck {
  animation: titleLaunchConfirm .3s ease-in both !important;
}

#title-screen .title-start-warp #tap-start-btn {
  box-shadow: inset 4px 0 #fff, 0 0 30px rgba(var(--title-accent-rgb), .42) !important;
}

@keyframes titleLogoArrive {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes titleDeckArrive {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes titleBriefArrive {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes titleShipHover {
  0%, 100% { transform: translate(-50%, -50%) scale(1.05); }
  50% { transform: translate(-50%, calc(-50% - 4px)) scale(1.05); }
}

@keyframes titleRadarSweep { to { transform: rotate(360deg); } }
@keyframes titleOrbitDrift { to { transform: rotate(339deg); } }
@keyframes titleOrbitCounter { to { transform: rotate(-312deg); } }

@keyframes titleDeckScan {
  0%, 70%, 100% { opacity: 0; transform: translateY(0); }
  75% { opacity: .8; }
  92% { opacity: 0; transform: translateY(540%); }
}

@keyframes titleStartCharge {
  0%, 100% { right: 76%; opacity: .65; }
  50% { right: 18%; opacity: 1; }
}

@keyframes titleLaunchConfirm {
  0% { filter: brightness(1); transform: scale(1); }
  45% { filter: brightness(1.55); transform: scale(1.012); }
  100% { filter: brightness(2); transform: scale(1.04); opacity: .18; }
}

@media (max-width: 370px) {
  #title-screen.title-screen--premium .title-premium-wrap { padding-inline: 12px !important; }
  #title-screen .neo-logo { font-size: clamp(31px, 10.5vw, 39px) !important; }
  #title-screen .neo-logo-jp { font-size: 10px !important; }
  #title-screen .neo-sub-en { margin-top: 7px !important; }
  #title-screen .title-deck-readout { top: 10px; }
  #title-screen .title-operation-card { padding-inline: 10px; }
  #title-screen .title-operation-loadout strong { max-width: 180px; }
}

@media (max-height: 720px) and (orientation: portrait) {
  #title-screen.title-screen--premium .title-premium-wrap {
    grid-template-rows: auto auto minmax(132px, 1fr) auto auto auto !important;
    gap: 5px !important;
    padding-top: max(10px, env(safe-area-inset-top)) !important;
    padding-bottom: max(7px, env(safe-area-inset-bottom)) !important;
  }
  #title-screen .neo-title-top { padding-bottom: 5px !important; }
  #title-screen .neo-logo { font-size: clamp(30px, 9.8vw, 39px) !important; }
  #title-screen .neo-logo-jp { margin-top: 5px !important; font-size: 9px !important; }
  #title-screen .neo-sub-en { margin-top: 5px !important; }
  #title-screen .neo-sub-jp { margin-top: 2px !important; font-size: 8px !important; }
  #title-screen .title-launch-deck { min-height: 132px; }
  #title-screen .title-launch-deck .title-ship { transform: translate(-50%, -50%) scale(.84) !important; animation-name: none; }
  #title-screen .title-deck-radar { width: 128px; }
  #title-screen .title-deck-lock { bottom: 6px; }
  #title-screen .title-deck-floor { bottom: 14px; }
  #title-screen .title-operation-card { gap: 4px; padding-block: 7px; }
  #title-screen .title-operation-card p { display: none; }
  #title-screen .neo-event-card { padding-block: 6px !important; }
  #title-screen #tap-start-btn { min-height: 54px !important; }
  #title-screen .title-start-note { margin-top: 3px !important; }
  #title-screen .title-footer-row { margin-top: 3px !important; }
}

@media (orientation: landscape) and (max-height: 560px) {
  #title-screen.title-screen--premium .title-premium-wrap {
    max-width: 900px !important;
    grid-template-columns: minmax(240px, .8fr) minmax(320px, 1.2fr) !important;
    grid-template-rows: auto auto minmax(92px, 1fr) auto !important;
    column-gap: 20px !important;
  }
  #title-screen .neo-title-top { grid-column: 1 / -1; }
  #title-screen .neo-title-main { grid-column: 1; grid-row: 2; }
  #title-screen .title-launch-deck { grid-column: 2; grid-row: 2 / 4; min-height: 120px; }
  #title-screen .title-operation-card { grid-column: 1; grid-row: 3; align-self: end; }
  #title-screen .neo-event-card { display: grid !important; grid-column: 2; grid-row: 4; align-self: end; }
  #title-screen .neo-title-actions { grid-column: 1; grid-row: 4; }
  #title-screen .title-launch-deck .title-ship { transform: translate(-50%, -50%) scale(.9) !important; }
}

@media (prefers-reduced-motion: reduce) {
  #title-screen .entry-title-orbit--a,
  #title-screen .entry-title-orbit--b,
  #title-screen .title-deck-radar i,
  #title-screen .title-launch-deck::after,
  #title-screen .title-launch-deck .title-ship,
  #title-screen #tap-start-btn::before,
  #title-screen.screen-entering .neo-title-main,
  #title-screen.screen-entering .title-launch-deck,
  #title-screen.screen-entering .title-operation-card,
  #title-screen.screen-entering .neo-event-card,
  #title-screen.screen-entering .neo-title-actions {
    animation: none !important;
  }
}

.lowfx #title-screen .entry-title-orbit--a,
.lowfx #title-screen .entry-title-orbit--b,
.lowfx #title-screen .title-deck-radar i,
.lowfx #title-screen .title-launch-deck::after,
.lowfx #title-screen .title-launch-deck .title-ship {
  animation: none !important;
}
