/* The harbor is a title screen, not a document: navigation and decoration
   have separate layers so every command fits in the available viewport. */
.title-screen {
  --title-edge: clamp(20px, 4vw, 72px);
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  color: #293f39;
  background: var(--fiber), #dce0c8;
}
.title-screen::before,
.title-screen::after {
  content: "";
  position: absolute;
  pointer-events: none;
}
.title-screen::before {
  display: block;
  inset: 0;
  z-index: 1;
  opacity: 1;
  background:
    linear-gradient(90deg, #e8e4ceee 0%, #e8e4ce40 48%, transparent 74%),
    radial-gradient(ellipse at 70% 55%, transparent 28%, #dfd7b9b0 100%);
}
.title-screen::after {
  inset: 10px;
  z-index: 6;
  border: 1px solid #88764a85;
  outline: 6px solid #ede2c240;
  box-shadow:
    inset 0 0 0 3px #f2e7c42b,
    0 0 0 10px #3b382c;
}
.title-world {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}
.title-world::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 72% 62%, #5c968863, transparent 54%),
    var(--fiber);
}
.title-chart {
  position: absolute;
  width: max(150vw, 170vh);
  max-width: none;
  left: 58%;
  top: 52%;
  transform: translate(-50%, -50%) rotate(-12deg);
  opacity: 0.55;
  mix-blend-mode: multiply;
  mask-image: radial-gradient(ellipse at 52% 49%, #000 12%, transparent 67%);
}
.title-compass {
  position: absolute;
  width: min(65vw, 86vh);
  aspect-ratio: 1;
  left: 66%;
  top: 57%;
  transform: translate(-50%, -50%) rotate(-12deg);
  border: 1px solid #63795f4d;
  border-radius: 50%;
  box-shadow:
    0 0 0 22px #ecdfb70c,
    0 0 0 23px #62765e26;
}
.title-compass::before,
.title-compass::after {
  content: "";
  position: absolute;
  background: #6b7a5f45;
}
.title-compass::before {
  height: 1px;
  width: 125%;
  left: -12.5%;
  top: 50%;
}
.title-compass::after {
  width: 1px;
  height: 125%;
  left: 50%;
  top: -12.5%;
}
.title-compass > span {
  position: absolute;
  top: -31px;
  left: 50%;
  color: #637254;
  font: 14px var(--serif);
}
.sea-inscription {
  position: absolute;
  color: #667759;
  font: italic 18px var(--serif);
  letter-spacing: 1px;
  transform: rotate(-12deg);
}
.sea-inscription-west {
  left: 42%;
  top: 43%;
}
.sea-inscription-east {
  right: 9%;
  bottom: 25%;
}
.title-masthead {
  position: absolute;
  z-index: 3;
  top: clamp(32px, 6vh, 75px);
  left: var(--title-edge);
  display: flex;
  align-items: center;
  gap: 20px;
}
.title-seal {
  width: clamp(65px, 7vw, 100px);
  height: auto;
  filter: sepia(0.3) brightness(0.65);
}
.title-masthead h1 {
  font: 500 clamp(68px, 8vw, 126px)/0.9 var(--serif);
  text-transform: uppercase;
  letter-spacing: 0.035em;
  color: #30483d;
  text-shadow: 0 1px #f8edc9;
  margin: 0;
}
.title-masthead p {
  font: 500 clamp(12px, 1.25vw, 19px)/1.5 var(--serif);
  text-transform: uppercase;
  letter-spacing: 0.24em;
  margin: 12px 0 0 5px;
  color: #7d6a42;
}
/* This berth is deliberately separate from the play menu. A future account
   can replace the visitor identity here without moving the game commands. */
.visitor-berth {
  position: absolute;
  z-index: 3;
  right: var(--title-edge);
  top: 38px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 10px 18px;
  border-left: 1px solid #8f8b6677;
}
.visitor-berth > .ui-icon {
  width: 26px;
  height: 26px;
  color: #6e7c59;
}
.visitor-berth span {
  display: block;
  color: #7b704f;
  font:
    9px/1.5 system-ui,
    sans-serif;
  text-transform: uppercase;
  letter-spacing: 1.7px;
}
.visitor-berth p {
  color: #4c5b42;
  font: 18px/1.4 var(--serif);
}
.harbor-menu {
  position: absolute;
  z-index: 4;
  left: calc(var(--title-edge) + 20px);
  bottom: clamp(96px, 13vh, 170px);
  display: grid;
  gap: 10px;
  width: clamp(300px, 31vw, 440px);
}
.harbor-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  margin-bottom: 8px;
}
.harbor-heading p {
  color: #6f7355;
  font: italic 17px var(--serif);
  white-space: nowrap;
}
.harbor-heading > span {
  height: 1px;
  background: #a2946c;
  flex: 1;
}
.harbor-order {
  position: relative;
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  min-height: 70px;
  padding: 12px 20px;
  color: #e5d5ac;
  background: var(--timber) repeat #373028;
  border: 1px solid #806b43;
  border-radius: 2px;
  text-align: left;
  box-shadow:
    0 3px 0 #2a2c26,
    0 5px 10px #303b3633,
    inset 0 0 0 3px #ba9b5e16;
}
.harbor-order::before,
.harbor-order::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 3px;
  height: 3px;
  background: #b79a64;
  border-radius: 50%;
  transform: translateY(-50%);
}
.harbor-order::before {
  left: 6px;
}
.harbor-order::after {
  right: 6px;
}
.harbor-order > span:nth-child(2) {
  font: 500 26px/1.05 var(--serif);
  flex: 1;
}
.harbor-order small {
  display: block;
  margin-top: 5px;
  font:
    10px/1.4 system-ui,
    sans-serif;
  font-weight: 400;
  color: #c2b591;
}
.harbor-order .order-symbol {
  display: grid;
  place-items: center;
  width: 30px;
  color: #b89d66;
}
.harbor-order .order-symbol .ui-icon {
  width: 25px;
  height: 25px;
  stroke-width: 1.3;
}
.harbor-order .order-arrow {
  color: #bda36d;
  font: 23px var(--serif);
  opacity: 0.6;
}
.harbor-order.first-order,
.harbor-order.resume-order {
  border-color: #d1b477;
  color: #fff0c9;
  box-shadow:
    0 3px 0 #38372a,
    0 5px 10px #303b3640,
    inset 0 0 0 3px #c2a46b44;
}
.harbor-order:hover:not(:disabled) {
  background: var(--timber) repeat #373028;
  color: #fff3d4;
  border-color: #dfc68e;
  filter: brightness(1.13);
}
.harbor-order:focus-visible {
  outline: 3px solid #836330;
  outline-offset: 4px;
}
.harbor-order:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: inset 0 0 0 3px #c2a46b44;
}
.harbor-order:hover .order-arrow,
.harbor-order:focus-visible .order-arrow {
  opacity: 1;
}
.harbor-motto {
  text-align: center;
  margin-top: 9px;
  color: #6b7456;
  font: italic 15px var(--serif);
}
.title-vessel {
  position: absolute;
  z-index: 2;
  left: 68%;
  top: 57%;
  width: min(39vw, 39vh);
  transform: translate(-50%, -50%) rotate(7deg);
}
.title-vessel > img {
  width: 100%;
  display: block;
  filter: drop-shadow(13px 24px 9px #3d655a40);
  animation: afloat 10s ease-in-out infinite;
}
.vessel-wake {
  position: absolute;
  width: 75%;
  height: 20%;
  border: 1px solid #f4e8c2a8;
  border-radius: 50%;
  left: 15%;
  bottom: 3%;
  transform: rotate(18deg);
  box-shadow:
    0 0 0 10px #e3e5c52b,
    0 0 0 12px #f3ebcb66,
    0 0 0 28px #e3e5c518,
    0 0 0 29px #f3ebcb33;
}
.vessel-name {
  position: absolute;
  z-index: 3;
  left: 68%;
  bottom: 12%;
  transform: translateX(-50%);
  text-align: center;
  color: #455e49;
}
.vessel-name span {
  display: block;
  font: italic 26px/1.1 var(--serif);
}
.vessel-name small {
  display: block;
  font:
    10px/1.6 system-ui,
    sans-serif;
  color: #6c785d;
  margin-top: 6px;
  letter-spacing: 0.4px;
}
.title-foot {
  position: absolute;
  z-index: 4;
  bottom: 22px;
  left: var(--title-edge);
  right: var(--title-edge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid #99885d80;
}
.title-foot .title-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: transparent;
  border: 0;
  padding: 8px 0;
  color: #57664b;
  font: 16px var(--serif);
  box-shadow: none;
}
.title-audio {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 16px);
}
.title-audio [data-action="audio-settings"] {
  justify-content: center;
  min-width: 36px;
}
.title-foot .title-link:hover {
  background: transparent;
  color: #344c3e;
}
.title-foot .title-link .ui-icon {
  width: 18px;
  height: 18px;
}
.title-foot .title-link[aria-pressed="true"] {
  color: #30594f;
}
.title-edition {
  font-size: 10px;
  letter-spacing: 1px;
  color: #74775c;
}
@media (min-width: 761px) and (max-height: 700px) {
  .title-masthead {
    top: 30px;
  }
  .title-masthead h1 {
    font-size: clamp(64px, 7vw, 96px);
  }
  .title-seal {
    width: 65px;
  }
  .harbor-menu {
    bottom: 83px;
    gap: 8px;
  }
  .harbor-order {
    min-height: 56px;
    padding-block: 8px;
  }
  .harbor-order > span:nth-child(2) {
    font-size: 24px;
  }
  .harbor-heading {
    margin-bottom: 0;
  }
  .harbor-motto {
    margin-top: 3px;
  }
}
@media (max-width: 1000px) and (min-width: 761px) {
  .visitor-berth {
    top: 30px;
  }
  .visitor-berth p {
    font-size: 15px;
  }
  .title-masthead h1 {
    font-size: 76px;
  }
  .title-masthead {
    gap: 10px;
    top: 80px;
  }
  .title-seal {
    width: 65px;
  }
  .harbor-menu {
    left: var(--title-edge);
  }
  .harbor-order {
    gap: 10px;
  }
}
@media (max-width: 760px) {
  .title-screen {
    --title-edge: 25px;
  }
  .title-masthead {
    left: 50%;
    transform: translateX(-50%);
    top: max(70px, 10vh);
    gap: 8px;
    width: max-content;
    max-width: calc(100% - 40px);
  }
  .title-masthead h1 {
    font-size: clamp(52px, 12vw, 82px);
  }
  .title-seal {
    width: 47px;
  }
  .title-masthead p {
    font-size: 10px;
    margin-top: 7px;
    letter-spacing: 0.16em;
  }
  .visitor-berth {
    top: 21px;
    right: 25px;
    padding: 0;
    border: 0;
    gap: 6px;
  }
  .visitor-berth > .ui-icon {
    width: 16px;
    height: 16px;
  }
  .visitor-berth span {
    display: none;
  }
  .visitor-berth p {
    font: 12px/1.5 var(--serif);
  }
  .harbor-menu {
    left: var(--title-edge);
    right: var(--title-edge);
    bottom: 82px;
    width: auto;
    gap: 9px;
  }
  .harbor-order {
    min-height: 61px;
    padding: 10px 15px;
    gap: 12px;
  }
  .harbor-order > span:nth-child(2) {
    font-size: 24px;
  }
  .harbor-order small {
    font-size: 9px;
    margin-top: 4px;
  }
  .harbor-order .order-symbol {
    width: 26px;
  }
  .harbor-order .order-symbol .ui-icon {
    width: 23px;
    height: 23px;
  }
  .harbor-heading {
    padding: 0;
    margin-bottom: 2px;
  }
  .harbor-heading p {
    font-size: 16px;
  }
  .harbor-motto {
    font-size: 13px;
    margin-top: 4px;
  }
  .title-chart {
    width: 210vh;
    left: 70%;
    top: 43%;
    opacity: 0.5;
  }
  .title-vessel {
    left: 60%;
    top: 35%;
    width: min(58vw, 28vh);
    opacity: 0.9;
  }
  .title-compass {
    width: 90vw;
    left: 58%;
    top: 32%;
    opacity: 0.6;
  }
  .sea-inscription-west {
    left: 8%;
    top: 30%;
    font-size: 13px;
  }
  .sea-inscription-east {
    display: none;
  }
  .vessel-name {
    display: none;
  }
  .title-foot {
    bottom: 21px;
    padding-top: 7px;
    gap: 6px;
  }
  .title-foot .title-link {
    font-size: 13px;
    gap: 5px;
    min-height: 36px;
  }
  .title-foot .title-link .ui-icon {
    width: 15px;
    height: 15px;
  }
  .title-edition {
    display: none;
  }
}
@media (max-width: 760px) and (max-height: 700px) {
  .title-masthead {
    top: 65px;
  }
  .title-vessel {
    top: 34%;
    width: min(48vw, 23vh);
    left: 68%;
    opacity: 0.65;
  }
  .harbor-menu {
    bottom: 74px;
    gap: 7px;
  }
  .harbor-order {
    min-height: 54px;
    padding-block: 7px;
  }
  .harbor-order > span:nth-child(2) {
    font-size: 22px;
  }
  .harbor-motto {
    display: none;
  }
  .harbor-heading p {
    font-size: 14px;
  }
}
@media (max-width: 760px) and (max-height: 540px) {
  .title-masthead {
    top: 47px;
  }
  .title-masthead h1 {
    font-size: 46px;
  }
  .title-masthead p {
    font-size: 9px;
    margin-top: 4px;
  }
  .title-seal {
    width: 37px;
  }
  .visitor-berth {
    top: 18px;
  }
  .harbor-menu {
    bottom: 67px;
    gap: 6px;
  }
  .harbor-order {
    min-height: 48px;
    padding-block: 6px;
  }
  .harbor-order > span:nth-child(2) {
    font-size: 20px;
  }
  .harbor-order small {
    font-size: 8px;
    margin-top: 2px;
  }
  .harbor-heading {
    display: none;
  }
  .title-vessel {
    top: 34%;
    opacity: 0.35;
  }
  .title-foot {
    bottom: 18px;
    padding-top: 4px;
  }
}
/* A wide, shallow phone uses the same left menu/right vessel composition. */
@media (orientation: landscape) and (max-height: 500px) {
  .title-screen {
    --title-edge: 26px;
  }
  .title-masthead {
    top: 22px;
    left: var(--title-edge);
    transform: none;
    gap: 8px;
  }
  .title-masthead h1 {
    font-size: 48px;
  }
  .title-masthead p {
    font-size: 9px;
    margin-top: 3px;
  }
  .title-seal {
    width: 42px;
  }
  .visitor-berth {
    top: 23px;
    right: 28px;
    padding: 0;
    border: 0;
  }
  .visitor-berth p {
    font-size: 13px;
  }
  .visitor-berth span {
    display: none;
  }
  .harbor-menu {
    left: var(--title-edge);
    right: auto;
    bottom: 60px;
    width: min(44vw, 340px);
    gap: 5px;
  }
  .harbor-heading,
  .harbor-motto {
    display: none;
  }
  .harbor-order {
    min-height: 43px;
    padding: 5px 12px;
    gap: 9px;
  }
  .harbor-order > span:nth-child(2) {
    font-size: 20px;
  }
  .harbor-order small {
    font-size: 8px;
    margin-top: 1px;
  }
  .harbor-order .order-symbol {
    width: 22px;
  }
  .harbor-order .order-symbol .ui-icon {
    width: 19px;
    height: 19px;
  }
  .title-vessel {
    left: 73%;
    top: 53%;
    width: min(37vw, 61vh);
    opacity: 0.9;
  }
  .title-compass {
    left: 72%;
    top: 52%;
    width: 65vh;
  }
  .sea-inscription {
    display: none;
  }
  .vessel-name {
    display: none;
  }
  .title-foot {
    bottom: 15px;
    padding-top: 4px;
  }
  .title-foot .title-link {
    font-size: 12px;
    min-height: 29px;
  }
  .title-edition {
    display: none;
  }
}
@media (max-width: 380px) {
  .title-music-prefix {
    display: none;
  }
  .title-audio [data-action="music"] {
    white-space: nowrap;
  }
}
@media (prefers-reduced-motion: reduce) {
  .title-vessel > img {
    animation: none;
  }
}
