:root {
  --gold: #f0c27b;
  --ivory: #f2ecdc;
  --nfh-ink: #10191e;
}

body[data-screen="title"] {
  background: var(--nfh-ink) url("/public/nfh-cover.webp") right center / contain no-repeat;
}
body[data-screen="title"] #scene { visibility: hidden; }
body[data-screen="title"] .menu-shade {
  background: linear-gradient(90deg, #0d161a 0%, #111d23f2 26%, #111c21a6 48%, #10171a18 77%),
    linear-gradient(0deg,#0d151e8f,transparent 30%);
}
#title-screen {
  grid-template-columns: minmax(0, 490px);
  overflow: visible;
  color: var(--ivory);
}
#title-screen .fighter { display: none; }
#title-screen h1 {
  margin: 0;
  color: #fff2d6;
  font-family: Georgia, "Times New Roman", serif;
  line-height: .83;
  font-size: clamp(58px, min(12vw, 20dvh), 164px);
  font-weight: 700;
  letter-spacing: -.075em;
  text-shadow: 0 2px 25px #0a1119;
}
#title-screen h1 em {
  display: block;
  margin-top: .54em;
  color: #e8c486;
  font-family: system-ui, sans-serif;
  font-size: clamp(12px, 1.65vw, 22px);
  font-style: normal;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: .36em;
}
.nfh-tagline {
  max-width: 32ch;
  margin: 15px 0 clamp(16px, 3.8vh, 38px);
  color: #dfdfd1;
  font-size: clamp(.85rem, 1.15vw, 1.02rem);
  line-height: 1.4;
}
#title-screen :is(.menu-label, .spawn-select > span) { color: #e0d9c8; }
#title-screen .skin-card {
  border-color: #bfb09254;
  border-radius: 6px;
  background: #232e34ed;
}
#title-screen .skin-card[aria-pressed="true"] { border-color: #f0c27b; background: #5c4832; }
#title-screen .skin-card[aria-pressed="true"] span { background: #f0c27b; }
#title-screen .opening-actions { gap: 8px; margin-top: clamp(13px, 2.8vh, 26px); }
#title-screen :is(#story-start,#story-coop) {
  display: grid;
  align-content: center;
  grid-column: auto;
  min-height: 52px;
  border: 1px solid #e6bb7c9e;
  border-radius: 6px;
  color: #211a10;
  background: #f0c27b;
  box-shadow: none;
}
#title-screen #story-start::before { content: none; }
#title-screen #story-coop { color: #fff1d2; background: #263d43ee; }
#title-screen :is(#story-start,#story-coop):hover { filter: brightness(1.12); }
#title-screen .opening-actions strong,
#title-screen .opening-actions strong + span { display: block; }
#title-screen .opening-actions strong + span { margin-top: 3px; font-size: .73rem; font-weight: 470; }
#title-screen :is(#online,#solo) {
  min-height: 42px;
  border: 1px solid #aaa29370;
  border-radius: 6px;
  background: #19262ce8;
  color: #f3eadc;
}
.game-modes {
  grid-template-columns: repeat(auto-fit,minmax(120px,1fr));
}
#resume-coop { margin-top: 10px; }
#realm-reputation {
  max-width: 22ch;
  margin-top: 6px;
  color: #e8c486;
  font-size: .73rem;
  line-height: 1.24;
}
#realm-reputation:not([hidden]) { display: block; }
#shield .shield-icon, #shield .shield-charge { color: var(--hat-shield, #cfedf0); }
.nfh-party-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #e5e9dd;
  border-left: 2px solid #8cc4b4;
  background: #273934;
  line-height: 1.4;
}

@media (max-width: 700px) {
  body[data-screen="title"] {
    background-image: url("/public/nfh-cover-mobile.webp");
    background-position: center top;
  }
}
@media (max-width: 650px) and (orientation: portrait) {
  #title-screen {
    inset: 62px max(16px,var(--safe-right)) max(15px,var(--safe-bottom)) max(16px,var(--safe-left));
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
    align-items: end;
  }
  #title-screen .menu-main { grid-row: 1; }
  #title-screen h1 span { display: block; }
  body[data-screen="title"] .menu-shade {
    background: linear-gradient(0deg,#10191efc 3%,#10191ee8 38%,#10191e6e 68%,#10191e20),
      linear-gradient(90deg,#10191e7c,transparent);
  }
}
@media (max-height: 520px) and (orientation: landscape) {
  #title-screen {
    inset-block: max(10px,var(--safe-top)) max(9px,var(--safe-bottom));
    align-items: start;
  }
  #title-screen h1 { font-size: clamp(44px, 15dvh, 77px); }
  #title-screen h1 em { font-size: .23em; }
  .nfh-tagline { margin-block: 9px 12px; }
  #title-screen .opening-actions { margin-top: 7px; }
  #title-screen :is(#story-start,#story-coop) { min-height: 42px; }
}
@media (max-height: 740px) {
  #title-screen { inset-block: max(14px,var(--safe-top)) max(12px,var(--safe-bottom)); }
  #title-screen .skin-card canvas { height: clamp(30px,7dvh,62px); }
  #title-screen .menu-main .spawn-select { margin-top: 9px; }
  .nfh-tagline { margin-block: 10px clamp(8px,2dvh,17px); }
}
@media (max-height: 420px) and (orientation: landscape) {
  #title-screen h1 { font-size: clamp(38px, 13dvh, 58px); }
  #title-screen h1 em { margin-top: .35em; }
  #title-screen .skin-card span { padding-block: 2px; }
  #title-screen :is(#story-start,#story-coop,#online,#solo) { min-height: 32px; padding-block: 4px; }
  #title-screen .opening-actions { gap: 5px; }
}

body[data-compact="true"][data-screen="playing"] :is(.glass,.touch-button,.spell,.stick) {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

@media (orientation: portrait) {
  body[data-input="touch"][data-screen="playing"] .spell-dock {
    bottom: var(--safe-bottom);
    width: min(94vw,420px);
  }
  body[data-input="touch"] .stick {
    width: clamp(72px,23vw,100px);
    height: clamp(72px,23vw,100px);
    bottom: calc(var(--safe-bottom) + 77px);
  }
  body[data-input="touch"] .cast {
    width: clamp(60px,19vw,84px);
    height: clamp(60px,19vw,84px);
    bottom: calc(var(--safe-bottom) + 77px);
  }
  body[data-input="touch"] .jump {
    bottom: calc(var(--safe-bottom) + 164px);
  }
  body[data-input="touch"] .shield-action {
    right: calc(var(--safe-right) + clamp(63px,20vw,86px));
    bottom: calc(var(--safe-bottom) + 81px);
  }
  body[data-input="touch"] .altitude-controls {
    bottom: calc(var(--safe-bottom) + 164px);
  }
  body[data-input="touch"] .spell-info > span {
    display: none;
  }
}
