/* Mobile-first title scene. All gameplay overlays retain their existing styles. */
#welcome.title54 {
  padding: max(20px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: #08142d;
  color: #fff;
  overflow: auto;
  overscroll-behavior: contain;
  place-items: stretch;
}
#welcome .title-art54 { position: fixed; opacity: 1; filter: none; background: #08142d; overflow: hidden; }
.title-illustration-v2 { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; image-rendering: auto; }
#welcome::before { position: fixed; background: linear-gradient(180deg, #06132b44 0%, #06132b00 25%, #06132b22 40%, #06132bb8 59%, #06132bf2 100%); }
#welcome .title-shell54 {
  width: min(100%, 1320px);
  max-width: none;
  min-height: calc(100svh - 40px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: auto;
  position: relative;
}
#welcome .title-brand54 { text-align: center; width: 100%; min-width: 0; }
.title-wordmark-v2 { position: relative; display: block; width: min(100%, 390px); margin: 0 auto; }
.title-logo-v2 { display: block; width: 100%; height: auto; filter: drop-shadow(0 2px 0 #071b3e) drop-shadow(0 5px 12px #030b20bb); }
#welcome .title-brand54 .title-accessible-v2 { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.title-emblem-v2 { position: static; flex-shrink: 0; width: 30px; height: 30px; padding: 0; border: 0; background: transparent; object-fit: contain; filter: drop-shadow(0 1px 1px #000) drop-shadow(0 2px 4px #000); }
#welcome .title-brand54 > .title-subtitle-v2 { display: inline-flex; align-items: center; justify-content: center; gap: 9px; max-width: 100%; box-sizing: border-box; padding: 0; border: 0; background: transparent; color: #fff5d2; margin: 8px auto 0; font: 850 10px/1.6 system-ui, sans-serif; letter-spacing: .13em; box-shadow: none; text-shadow: -1px -1px 1px #000, 1px -1px 1px #000, -1px 1px 1px #000, 1px 1px 1px #000, 0 2px 6px #000; }
#welcome .title-region54 { display: none; }
.title-stage-v2 { flex: 1; width: 100%; min-height: clamp(160px, 44vw, 280px); }
#welcome .title-panel54 { position: relative; isolation: isolate; width: min(100%, 450px); border: 0; border-radius: 0; padding: 0; margin: 0 auto; background: transparent; box-shadow: none; text-align: center; }
#welcome .title-panel54 > small { display: block; color: #b5f2ff; font: 800 10px/1.5 system-ui, sans-serif; letter-spacing: .14em; text-shadow: 0 2px 3px #000; }
#welcome .title-panel54 h2 { font: 850 clamp(20px, 5vw, 26px)/1.25 system-ui, sans-serif; margin: 7px 0; color: #fff; text-shadow: 0 2px 4px #000; text-wrap: balance; overflow-wrap: anywhere; }
#welcome .title-panel54 > p { color: #f4f8ff; font: 600 12px/1.6 system-ui, sans-serif; margin: 0 0 16px; text-shadow: 0 2px 3px #000; text-wrap: balance; }
#welcome .title-panel54 .primary { min-height: 56px; width: 100%; padding: 13px 8px; border: 0; border-radius: 0; background: transparent; color: #ffdf72; box-shadow: none; text-shadow: -1px -1px 1px #000, 1px 1px 1px #000, 0 2px 5px #000; font: 900 17px/1.4 system-ui, sans-serif; letter-spacing: .035em; cursor: pointer; }
#welcome .title-panel54 .primary::before { content: '▸'; display: inline-block; margin-right: 10px; color: #fff3bc; }
#welcome .title-panel54 .primary:hover { background: transparent; color: #fff0b2; }
.title-options-v2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; margin-top: 4px; }
#welcome .title-options-v2 button { box-sizing: border-box; width: 100%; margin: 0; min-height: 46px; padding: 10px 4px; border: 0; border-radius: 0; background: transparent; box-shadow: none; color: #fff; text-shadow: -1px -1px 1px #000, 1px 1px 1px #000, 0 2px 5px #000; text-align: center; font: 750 12px/1.4 system-ui, sans-serif; cursor: pointer; }
#welcome .title-options-v2 button:hover { background: transparent; color: #ffe39a; text-decoration: underline; text-underline-offset: 5px; }
#welcome .title-new-v2 { margin-top: 10px; min-height: 44px; color: #d2ebff; border: 0; text-align: center; background: transparent; font: 12px/1.4 system-ui, sans-serif; }
#welcome .title-new-v2[hidden] { display: none; }
#welcome .title-panel54 footer { margin-top: 18px; gap: 4px; color: #e1edff; font: 700 10px/1.5 system-ui, sans-serif; letter-spacing: .06em; text-shadow: 0 2px 3px #000; }
#welcome .title-panel54 footer small { color: #e1edff; font: 11px/1.5 system-ui, sans-serif; letter-spacing: 0; }
#welcome button { outline: none; }
#welcome button:focus-visible { outline: 2px solid #ffe39a; outline-offset: 2px; }

/* Trainer registration, save selection and import share an in-world travel-card design. */
#modal:has(:is(.trainer-pass-v2, .adventure-slots-v2, .title-import-v2)) { width: min(620px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 3px solid #c5f1fa; border-radius: 20px; background: #f1f9fc; color: #173653; box-shadow: 0 18px 80px #030c29a0; color-scheme: light; }
#modal:has(:is(.trainer-pass-v2, .adventure-slots-v2, .title-import-v2))::backdrop { background: #071332b8; backdrop-filter: blur(4px); }
#modal:has(:is(.trainer-pass-v2, .adventure-slots-v2, .title-import-v2)) .modal-head { background: linear-gradient(110deg, #163d73, #24677e); border-bottom: 3px solid #8bd8e9; padding: 14px 18px; }
#modal:has(:is(.trainer-pass-v2, .adventure-slots-v2, .title-import-v2)) #modalBody { padding: clamp(18px, 4vw, 30px); color: #173653; background: linear-gradient(145deg, #fffef5, #eaf6fb); font: 15px/1.55 system-ui, sans-serif; }
#modal:has(:is(.trainer-pass-v2, .adventure-slots-v2, .title-import-v2)) #modalBody :is(p, small) { color: #415d72; }
.trainer-intro-v2, .slot-intro-v2 { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; align-items: center; margin: 0 0 16px; }
.trainer-intro-v2 img, .slot-intro-v2 img { width: 64px; height: 64px; object-fit: contain; image-rendering: auto; }
#modal #modalBody :is(.trainer-intro-v2, .slot-intro-v2) h3 { font: 850 clamp(21px, 5vw, 28px)/1.15 system-ui, sans-serif; color: #163d73; margin: 6px 0 9px; }
#modal #modalBody :is(.trainer-intro-v2, .slot-intro-v2) small { color: #24647b; font: 850 9px/1.5 system-ui, sans-serif; letter-spacing: .15em; }
.trainer-intro-v2 p, .slot-intro-v2 p { font-size: 13px; margin: 0; }
#modal #modalBody .trainer-pass-v2 label { font-size: 13px; color: #244d6a; gap: 8px; }
#modal #modalBody .trainer-pass-v2 :is(input, select) { min-height: 50px; border: 2px solid #a2c8da; border-radius: 10px; background: #fff; color: #163653; padding: 11px 12px; font: 16px/1.4 system-ui, sans-serif; color-scheme: light; }
#modal #modalBody .trainer-pass-v2 input::placeholder { color: #647a8d; }
#modal #modalBody .trainer-pass-v2 :is(input, select):focus-visible { outline: 3px solid #64b6d1; outline-offset: 2px; }
.trainer-style-v2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.trainer-style-v2 label { min-width: 0; }
#modal #modalBody .trainer-pass-v2 .trainer-error54 { color: #a12636; font-size: 13px; }
.trainer-error54:empty { display: none; }
.trainer-actions-v2 { display: grid; gap: 10px; margin-top: 6px; }
#modal:has(:is(.trainer-pass-v2, .adventure-slots-v2, .title-import-v2)) #modalBody button.primary { min-height: 52px; background: #176481; color: #fff; border: 2px solid #0b4b6a; border-radius: 10px; font-weight: 800; }
#modal:has(:is(.trainer-pass-v2, .adventure-slots-v2, .title-import-v2)) #modalBody button.primary:hover { background: #104d69; color: #fff; }
#modal:has(:is(.trainer-pass-v2, .adventure-slots-v2, .title-import-v2)) #modalBody button.menu-btn { min-height: 46px; border-color: #9ebed0; background: #e3f0f7; color: #1c4564; }
#modal #modalBody .trainer-note-v2 { text-align: center; font-size: 11px; margin: 2px 0; }
.slot-list-v2 { display: grid; gap: 12px; margin: 20px 0; }
#modal #modalBody button.adventure-slot-v2 { display: grid; grid-template-columns: 42px minmax(0, 1fr) 20px; gap: 12px; align-items: center; width: 100%; min-height: 80px; padding: 14px; text-align: left; border: 2px solid #a8c9dc; border-radius: 12px; background: #fff; color: #163d5e; }
#modal #modalBody button.adventure-slot-v2:disabled { background: #def2ec; border-color: #61ad9b; opacity: 1; }
#modal #modalBody .adventure-slot-v2 .slot-number-v2 { background: #1c577e; color: #fff; border-radius: 10px; padding: 9px 3px; text-align: center; font-weight: 850; }
.slot-copy-v2 { min-width: 0; }
.slot-copy-v2 b { display: block; overflow-wrap: anywhere; font-size: 18px; }
#modal #modalBody .slot-copy-v2 small { display: block; font-size: 10px; margin-top: 5px; }
.slot-note-v2 { font-size: 12px; margin: 16px 0 0; }
.adventure-slots-v2 > .primary { width: 100%; }
.import-file-v2 { display: grid; gap: 10px; border: 2px dashed #619ab8; border-radius: 12px; background: #e5f3f9; padding: 18px; margin: 20px 0; cursor: pointer; }
.import-file-v2 > span { font-size: 12px; }
#modal #modalBody .import-file-v2 input[type=file] { width: 100%; box-sizing: border-box; min-width: 0; background: #fff; color: #234b65; font-size: 13px; }
#modal #modalBody .import-file-v2 input[type=file]::file-selector-button { background: #1d5c7c; color: #fff; border-color: #1d5c7c; }
.title-import-v2 > p { font-size: 12px; }
.title-import-v2 > button { width: 100%; }

@media (max-width: 360px) {
  #welcome.title54 { padding-left: 12px; padding-right: 12px; }
  .title-wordmark-v2 { width: 96%; }
  .title-options-v2 { gap: 7px; }
  #welcome .title-options-v2 button { font-size: 11px; }
  .trainer-style-v2 { grid-template-columns: 1fr; }
}
@media (min-width: 700px) {
  .title-illustration-v2 { top: 0; height: 100%; width: 100%; object-fit: cover; }
  #welcome::before { background: linear-gradient(180deg, #06132b44 0%, #06132b00 36%, #06132b66 52%, #06132be8 81%, #06132bf2 100%); }
  #welcome .title-shell54 { min-height: calc(100svh - 40px); }
  .title-wordmark-v2 { width: min(40vw, 540px); }
  .title-emblem-v2 { width: 36px; height: 36px; }
  #welcome .title-brand54 > .title-subtitle-v2 { font-size: 11px; }
  .title-stage-v2 { min-height: 160px; }
}
@media (max-height: 600px) and (min-width: 600px) {
  #welcome.title54 { padding-top: 12px; padding-bottom: 14px; }
  #welcome .title-shell54 { min-height: calc(100svh - 26px); }
  .title-wordmark-v2 { width: 250px; }
  .title-emblem-v2 { width: 26px; height: 26px; }
  .title-stage-v2 { min-height: 18px; }
  #welcome .title-panel54 { width: min(600px, 100%); }
  #welcome .title-panel54 > small, #welcome .title-subtitle-v2 { display: none; }
  #welcome .title-panel54 h2 { font-size: 19px; margin: 3px 0; }
  #welcome .title-panel54 > p { margin-bottom: 10px; }
  .title-options-v2 { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; }
  #welcome .title-options-v2 button { min-height: 44px; font-size: 11px; }
  #welcome .title-panel54 footer { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  #welcome *, #modal:has(.trainer-pass-v2) * { scroll-behavior: auto; transition: none; animation: none; }
}


/* Approved silver/lavender identity; retain current trainer, slot and import UI. */
.title-wordmark-v2 { width: min(100%, 420px); }
.title-stage-v2 { min-height: clamp(24px, 8vh, 100px); }
#welcome .title-brand54 > .title-subtitle-v2 { color: #e4deff; }
.title-emblem-v2 { width: 38px; height: 38px; }
#welcome .title-panel54 .primary { color: #c6ddff; }
#welcome .title-options-v2 button:hover { color: #d6c5ff; }
@media(min-width:700px) { .title-wordmark-v2 { width:min(46vw,580px); } .title-stage-v2 { min-height: 40px; } }
@media(max-height:600px) and (min-width:600px) { .title-wordmark-v2 { width:250px; } .title-stage-v2 { min-height:18px; } }


/* Centerpiece requested by Felipe: emblem between subtitle and start menu. */
#welcome .title-stage-v2 { display:flex; align-items:center; justify-content:center; min-height:130px; padding:14px 0; box-sizing:border-box; }
.title-center-emblem { display:block; width:clamp(100px,18vh,160px); height:auto; object-fit:contain; filter:drop-shadow(0 0 14px #a9b7ff55); }
#welcome .title-brand54 > .title-subtitle-v2 { display:block; margin:10px auto 0; padding:4px 8px; font:900 clamp(16px,3.8vw,26px)/1.25 Georgia,'Times New Roman',serif; letter-spacing:.055em; color:#e4deff; text-shadow:0 2px 0 #38325e,0 4px 0 #0b1638,0 0 12px #7198e766; -webkit-text-stroke:.35px #e4eaff; }
@supports(background-clip:text) { #welcome .title-brand54 > .title-subtitle-v2 { background:linear-gradient(180deg,#fff 8%,#ddd9ff 32%,#9388d6 52%,#e9e3ff 72%,#b6a4ed 100%); background-clip:text; -webkit-background-clip:text; color:transparent; text-shadow:none; filter:drop-shadow(0 2px 0 #293b65) drop-shadow(0 0 5px #829ee75c); } }
@media(max-height:600px) and (min-width:600px) { #welcome .title-stage-v2 { min-height:64px; padding:6px 0; } .title-center-emblem { width:64px; } #welcome .title-brand54 > .title-subtitle-v2 { display:block; font-size:16px; margin-top:3px; } }
