@font-face {
  font-family: "Press Start 2P";
  src: url("fonts/PressStart2P-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: "VT323";
  src: url("fonts/VT323-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  --flag: #071315;
  --ink: #102425;
  --ink-soft: #385151;
  --deep-sea: #06363d;
  --hull: #0a4b52;
  --teal: #087b7b;
  --sea-glass: #52b9a8;
  --parchment: #f3e5bf;
  --parchment-deep: #ddc590;
  --paper-shadow: #ad8d55;
  --gold: #f6bd2f;
  --gold-bright: #ffe274;
  --gold-deep: #ad7413;
  --danger: #be4936;
  --danger-bright: #ef795c;
  --common: #9db1ab;
  --rare: #43a9c8;
  --epic: #dd795c;
  --legendary: #f6bd2f;
  --divine: #dbeee4;
  --line: #17393a;
  --pixel: "Press Start 2P", monospace;
  --body: "VT323", monospace;
  --shadow-hard: 6px 6px 0 rgba(5, 14, 15, 0.72);
  --nav-height: 84px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--parchment);
  font-family: var(--body);
  font-size: 20px;
  line-height: 1.42;
  background:
    radial-gradient(circle at 10% 8%, rgba(73, 178, 164, 0.18), transparent 22rem),
    radial-gradient(circle at 92% 22%, rgba(246, 189, 47, 0.09), transparent 30rem),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 5px),
    linear-gradient(160deg, #052b31 0%, #073e45 48%, #041f24 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(90deg, transparent 49%, rgba(126, 215, 197, 0.08) 50%, transparent 51%),
    linear-gradient(0deg, transparent 49%, rgba(126, 215, 197, 0.06) 50%, transparent 51%);
  background-size: 12px 12px;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.12;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(0, 0, 0, 0.38) 3px 4px);
  mix-blend-mode: multiply;
}

::selection {
  color: var(--flag);
  background: var(--gold);
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

img,
svg {
  display: block;
  max-width: 100%;
}

img {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

[hidden] {
  display: none !important;
}

html[lang="zh"] .lang-en {
  display: none !important;
}

.lang-zh {
  display: none !important;
}

html[lang="zh"] .lang-zh {
  display: inline !important;
}

:focus-visible {
  outline: 4px solid var(--gold-bright);
  outline-offset: 4px;
}

.skip-to-loot {
  position: fixed;
  z-index: 1000;
  top: -100px;
  left: 16px;
  padding: 12px 16px;
  color: var(--flag);
  background: var(--gold);
  border: 3px solid var(--flag);
  font-family: var(--pixel);
  font-size: 10px;
}

.skip-to-loot:focus {
  top: 12px;
}

/* Game-menu masthead */
.quarterdeck {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: var(--nav-height);
  padding: 10px clamp(12px, 2.5vw, 36px);
  background:
    linear-gradient(180deg, rgba(20, 63, 64, 0.42), transparent 40%),
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255, 255, 255, 0.025) 31px 32px),
    #071315;
  border-top: 5px solid var(--teal);
  border-bottom: 5px solid var(--gold-deep);
  box-shadow: 0 7px 0 rgba(0, 0, 0, 0.45);
}

.quarterdeck::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -10px;
  left: 0;
  height: 5px;
  background: repeating-linear-gradient(90deg, var(--gold) 0 24px, transparent 24px 32px);
  opacity: 0.3;
}

.ship-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--parchment);
  text-decoration: none;
}

.ship-mark__flag {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--flag);
  background: var(--gold);
  box-shadow: 4px 4px 0 var(--hull);
}

.ship-mark__flag svg {
  width: 27px;
  height: 27px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.ship-mark__word {
  font-family: var(--pixel);
  font-size: clamp(9px, 1.05vw, 13px);
  line-height: 1.4;
  letter-spacing: -0.04em;
}

.game-menu {
  display: flex;
  min-width: 0;
  align-items: stretch;
  border: 2px solid #1b5050;
  background: #0b2223;
  box-shadow: inset 0 0 0 2px #061011;
}

.game-menu__tab {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  min-height: 43px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  color: #b7d7c8;
  border-right: 2px solid #1b5050;
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  text-shadow: 2px 2px 0 #000;
}

.game-menu__tab:last-child {
  border-right: 0;
}

.game-menu__tab:hover {
  color: var(--gold-bright);
  background: #113436;
}

.game-menu__tab.is-active {
  color: var(--flag);
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(83, 50, 5, 0.08) 4px 5px),
    var(--gold);
  text-shadow: none;
}

.pixel-cursor {
  display: none;
  width: 7px;
  height: 7px;
  background: currentColor;
  box-shadow: 7px -7px 0 currentColor, 7px 7px 0 currentColor;
  transform: translateY(0);
}

.game-menu__tab.is-active .pixel-cursor {
  display: block;
}

.wallet-rig {
  display: flex;
  align-items: center;
  gap: 9px;
}

.language-switch {
  min-width: 58px;
  min-height: 42px;
  padding: 0 10px;
  color: var(--gold-bright);
  background: #0b2223;
  border: 2px solid #2d6763;
  box-shadow: 3px 3px 0 #000;
  font-family: var(--pixel);
  font-size: 9px;
}

.language-switch:hover {
  color: var(--flag);
  background: var(--gold);
}

.connect-cutlass {
  position: relative;
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--flag);
  background: var(--sea-glass);
  border: 2px solid #8fe0cb;
  box-shadow: 3px 3px 0 #000;
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.5;
  text-transform: uppercase;
}

.connect-cutlass:hover {
  background: var(--gold-bright);
}

.connect-cutlass.is-connected {
  color: var(--gold-bright);
  background: #0b2223;
  border-color: var(--gold);
}

.connect-cutlass__lamp {
  width: 8px;
  height: 8px;
  background: #dffdf2;
  box-shadow: 0 0 9px #dffdf2;
}

.connect-cutlass.is-connected .connect-cutlass__lamp {
  background: var(--gold);
  box-shadow: 0 0 9px var(--gold);
}

/* Hero: RPG cover scene */
.raid-deck {
  position: relative;
  display: grid;
  width: min(1440px, 100%);
  min-height: clamp(690px, calc(100svh - var(--nav-height)), 880px);
  margin: 0 auto;
  padding: clamp(34px, 5vw, 72px) clamp(16px, 5vw, 76px) clamp(60px, 8vw, 92px);
  overflow: hidden;
  align-items: end;
  isolation: isolate;
  background:
    linear-gradient(90deg, rgba(4, 22, 25, 0.22), transparent 45%),
    linear-gradient(0deg, #062e34 0%, transparent 45%),
    #0c5f66;
  border-bottom: 9px solid var(--gold-deep);
}

.raid-deck__art {
  position: absolute;
  inset: 0;
  z-index: -3;
  background: url("media/hero.png") center 42% / cover no-repeat;
  image-rendering: pixelated;
  filter: saturate(1.08) contrast(1.05);
}

.raid-deck::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(2, 20, 23, 0.08) 20%, rgba(2, 20, 23, 0.28) 58%, #062e34 98%),
    linear-gradient(90deg, rgba(4, 25, 27, 0.52), transparent 55%);
}

.raid-deck::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.24;
  background:
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(0, 0, 0, 0.3) 5px 6px),
    repeating-linear-gradient(90deg, transparent 0 47px, rgba(177, 255, 231, 0.08) 47px 48px);
  pointer-events: none;
}

.raid-deck__masthead {
  position: absolute;
  top: clamp(30px, 6vw, 76px);
  left: clamp(16px, 5vw, 76px);
  width: min(690px, calc(100% - 32px));
  animation: banner-drop 650ms steps(7, end) both;
}

.overrun-tag {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  margin: 0 0 20px;
  padding: 9px 12px;
  color: var(--flag);
  background: var(--gold);
  border: 3px solid var(--flag);
  box-shadow: 5px 5px 0 var(--hull);
  font-family: var(--pixel);
  font-size: clamp(7px, 0.75vw, 9px);
  line-height: 1.7;
  text-transform: uppercase;
}

.signal-pip {
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  background: #276c47;
  box-shadow: 7px 0 0 #276c47, 0 7px 0 #276c47, 7px 7px 0 #276c47;
  animation: signal-blink 2s steps(2, end) infinite;
}

.raid-deck h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 12px;
  margin: 0;
  color: var(--parchment);
  font-family: var(--pixel);
  font-size: clamp(45px, 7.3vw, 100px);
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.08em;
  text-shadow:
    5px 5px 0 var(--flag),
    10px 10px 0 rgba(0, 0, 0, 0.22);
}

.raid-deck h1 span {
  display: inline-block;
}

.title-small {
  color: var(--gold-bright);
  font-size: 0.63em;
}

.title-big {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.12em;
}

.masthead-chinese {
  margin: 14px 0 0;
  color: var(--sea-glass);
  font-family: var(--pixel);
  font-size: clamp(11px, 1.3vw, 17px);
  letter-spacing: 0.36em;
  text-shadow: 3px 3px 0 var(--flag);
}

.rpg-dialog {
  position: relative;
  width: min(760px, 100%);
  padding: 42px clamp(20px, 4vw, 44px) 28px;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(87, 55, 24, 0.035) 6px 7px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.46), transparent 30%),
    var(--parchment);
  border: 5px solid var(--flag);
  box-shadow:
    inset 0 0 0 4px var(--parchment-deep),
    inset 0 0 0 7px var(--flag),
    12px 12px 0 rgba(0, 0, 0, 0.55);
  animation: dialog-rise 720ms 180ms steps(7, end) both;
}

.rpg-dialog::before,
.rpg-dialog::after {
  position: absolute;
  z-index: 2;
  width: 10px;
  height: 10px;
  content: "";
  background: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold-deep);
}

.rpg-dialog::before {
  top: 12px;
  left: 12px;
}

.rpg-dialog::after {
  right: 12px;
  bottom: 12px;
}

.rpg-dialog__speaker {
  position: absolute;
  top: -25px;
  left: 24px;
  display: flex;
  min-height: 47px;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 7px;
  color: var(--gold-bright);
  background: var(--flag);
  border: 3px solid var(--gold);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.32);
  font-family: var(--pixel);
  font-size: clamp(8px, 0.9vw, 10px);
  line-height: 1.5;
}

.speaker-portrait {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--flag);
  background: var(--gold);
}

.speaker-portrait svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.rpg-dialog__line {
  max-width: 660px;
  margin: 0;
  font-size: clamp(22px, 2.3vw, 30px);
  line-height: 1.34;
}

.rpg-dialog__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 23px;
}

.dialogue-choice {
  display: inline-flex;
  min-height: 47px;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.3);
  border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 rgba(16, 36, 37, 0.23);
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.55;
  text-decoration: none;
}

.dialogue-choice:hover {
  color: var(--parchment);
  background: var(--deep-sea);
}

.dialogue-choice--gold {
  color: var(--flag);
  background: var(--gold);
  border-color: var(--flag);
}

.dialogue-choice--gold:hover {
  background: var(--gold-bright);
  color: var(--flag);
}

.choice-arrow {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.hero-stamp {
  position: absolute;
  right: clamp(20px, 5vw, 70px);
  bottom: clamp(70px, 10vw, 130px);
  display: grid;
  width: 118px;
  height: 118px;
  place-content: center;
  place-items: center;
  color: var(--gold-bright);
  background: rgba(7, 19, 21, 0.7);
  border: 4px double var(--gold);
  outline: 2px solid var(--flag);
  outline-offset: 5px;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.7;
  text-align: center;
  transform: rotate(7deg);
}

.hero-stamp strong {
  display: block;
  color: var(--parchment);
  font-size: 14px;
}

/* Main voyage: sticky boarding pass + editorial chronicle */
.voyage-layout {
  display: grid;
  width: min(1330px, calc(100% - 32px));
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(20px, 3vw, 42px);
  align-items: start;
  margin: clamp(28px, 5vw, 62px) auto 90px;
}

.boarding-berth {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.chronicle-column {
  display: grid;
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
  gap: clamp(24px, 4vw, 52px);
}

.boarding-pass {
  position: relative;
  overflow: hidden;
  color: var(--parchment);
  background:
    radial-gradient(circle at 100% 0, rgba(82, 185, 168, 0.16), transparent 42%),
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.018) 5px 6px),
    #092d32;
  border: 5px solid var(--flag);
  box-shadow:
    0 0 0 3px var(--gold-deep),
    10px 10px 0 rgba(0, 0, 0, 0.48);
  animation: pass-slide 700ms 420ms steps(6, end) both;
}

.boarding-pass__head {
  position: relative;
  padding: 25px 22px 20px;
  color: var(--flag);
  background:
    repeating-linear-gradient(90deg, transparent 0 6px, rgba(84, 51, 6, 0.06) 6px 7px),
    var(--gold);
  border-bottom: 4px dashed var(--flag);
}

.boarding-pass__head::after {
  content: "7777";
  position: absolute;
  top: 18px;
  right: 20px;
  color: rgba(7, 19, 21, 0.18);
  font-family: var(--pixel);
  font-size: 28px;
  letter-spacing: -6px;
}

.ticket-eyebrow,
.micro-label,
.tier-index {
  margin: 0;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.65;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ticket-eyebrow {
  opacity: 0.68;
}

.boarding-pass__head h2 {
  position: relative;
  margin: 11px 0 7px;
  font-family: var(--pixel);
  font-size: clamp(19px, 2.2vw, 27px);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: -0.05em;
}

.ticket-subtitle {
  max-width: 310px;
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.boarding-pass__notch {
  position: relative;
  z-index: 3;
  height: 12px;
  margin-top: -8px;
  background:
    radial-gradient(circle at 0 50%, var(--deep-sea) 0 9px, transparent 9.5px) left center / 50% 18px no-repeat,
    radial-gradient(circle at 100% 50%, var(--deep-sea) 0 9px, transparent 9.5px) right center / 50% 18px no-repeat,
    var(--gold);
}

.mint-instrument {
  padding: 21px 22px 22px;
}

.instrument-status {
  display: flex;
  min-height: 32px;
  align-items: center;
  gap: 9px;
  margin-bottom: 17px;
  padding: 7px 10px;
  color: #b8d4c9;
  background: #061d20;
  border: 2px solid #1b4c4d;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.6;
}

.status-lamp {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  background: #617574;
}

.status-lamp.is-live {
  background: var(--sea-glass);
  box-shadow: 0 0 8px var(--sea-glass);
}

.status-lamp.is-closed {
  background: var(--danger-bright);
  box-shadow: 0 0 8px var(--danger);
}

.agent-papers {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
  padding: 11px 12px;
  background: rgba(255, 255, 255, 0.045);
  border-left: 4px solid var(--sea-glass);
}

.agent-papers > div {
  display: grid;
  gap: 4px;
}

.agent-papers strong {
  color: var(--parchment);
  font-size: 18px;
  font-weight: 400;
}

.text-link {
  color: var(--gold-bright);
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.7;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.quantity-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #cae0d7;
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.6;
}

.quantity-label > span:last-child {
  color: var(--gold);
  text-align: right;
}

.quantity-stepper {
  display: grid;
  height: 52px;
  grid-template-columns: 52px 1fr 52px;
  margin-bottom: 17px;
  background: var(--flag);
  border: 3px solid #25575a;
}

.quantity-stepper button {
  display: grid;
  padding: 0;
  place-items: center;
  color: var(--gold-bright);
  background: #123c3f;
  border: 0;
  font-family: var(--pixel);
  font-size: 18px;
}

.quantity-stepper button:first-child {
  border-right: 2px solid #25575a;
}

.quantity-stepper button:last-child {
  border-left: 2px solid #25575a;
}

.quantity-stepper button:hover {
  color: var(--flag);
  background: var(--gold);
}

.quantity-stepper input {
  width: 100%;
  min-width: 0;
  color: var(--parchment);
  background: transparent;
  border: 0;
  font-family: var(--pixel);
  font-size: 15px;
  text-align: center;
  appearance: textfield;
}

.quantity-stepper input::-webkit-outer-spin-button,
.quantity-stepper input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.quote-scroll {
  margin: 0 0 16px;
  padding: 0;
  border-top: 2px dashed #2a5f5f;
}

.quote-scroll > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 2px dashed #2a5f5f;
}

.quote-scroll dt {
  color: #a9c7bc;
  font-size: 18px;
}

.quote-scroll dd {
  margin: 0;
  color: var(--gold-bright);
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.65;
  text-align: right;
}

.mint-button {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 57px;
  align-items: center;
  justify-content: center;
  gap: 11px;
  padding: 12px 14px;
  color: var(--flag);
  background:
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(87, 54, 4, 0.08) 6px 7px),
    var(--gold);
  border: 3px solid var(--gold-bright);
  box-shadow: 5px 5px 0 #020909;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.65;
  text-transform: uppercase;
}

.mint-button:hover:not(:disabled) {
  background: var(--gold-bright);
  transform: translate(-1px, -1px);
  box-shadow: 7px 7px 0 #020909;
}

.mint-button:active:not(:disabled) {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 #020909;
}

.mint-button:disabled {
  color: #788a84;
  background: #173334;
  border-color: #315456;
  box-shadow: 5px 5px 0 #020909;
}

.mint-button__flag {
  width: 18px;
  height: 16px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 36% 62%, 36% 100%, 0 100%);
}

.action-status {
  min-height: 20px;
  margin: 11px 0 0;
  color: #b9d4c9;
  font-size: 17px;
  line-height: 1.25;
  text-align: center;
}

.action-status.is-error {
  color: #ffad94;
}

.action-status.is-success {
  color: #8ff0cc;
}

.action-status a {
  color: var(--gold-bright);
}

.pass-stub {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  margin: 0 22px;
  background: #265254;
  border: 2px solid #265254;
}

.pass-stub > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 10px 8px;
  background: #071f22;
  text-align: center;
}

.pass-stub .micro-label {
  color: #789e95;
  font-size: 6px;
}

.pass-stub strong {
  overflow: hidden;
  color: var(--parchment);
  font-family: var(--pixel);
  font-size: 7px;
  font-weight: 400;
  line-height: 1.6;
  text-overflow: ellipsis;
}

.pass-tear {
  height: 11px;
  margin: 24px 0 0;
  border-top: 3px dashed #285557;
  border-bottom: 3px dashed #285557;
  background: #061c1f;
}

.sealed-cargo {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 20px 19px;
  background: #06191c;
}

.sealed-cargo img {
  width: 68px;
  height: 68px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(246, 189, 47, 0.35));
}

.sealed-cargo p {
  margin: 0;
  color: #b5d3c8;
  font-size: 17px;
  line-height: 1.2;
}

/* Shared parchment section language */
.captains-log,
.plunder-scale,
.crew-roster,
.parley-rules {
  position: relative;
  padding: clamp(24px, 4.5vw, 50px);
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.55), transparent 16rem),
    radial-gradient(circle at 88% 85%, rgba(110, 76, 27, 0.16), transparent 21rem),
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(93, 58, 21, 0.035) 6px 7px),
    var(--parchment);
  border: 4px solid var(--flag);
  box-shadow:
    inset 0 0 0 3px var(--parchment-deep),
    9px 9px 0 rgba(0, 0, 0, 0.38);
}

.captains-log::before,
.plunder-scale::before,
.crew-roster::before,
.parley-rules::before {
  position: absolute;
  top: 11px;
  right: 11px;
  bottom: 11px;
  left: 11px;
  border: 1px solid rgba(52, 72, 56, 0.22);
  content: "";
  pointer-events: none;
}

.captains-log::after,
.plunder-scale::after,
.crew-roster::after,
.parley-rules::after {
  position: absolute;
  width: 13px;
  height: 13px;
  top: 15px;
  right: 15px;
  content: "";
  background: var(--gold-deep);
  box-shadow: inset 3px 3px 0 var(--gold);
}

.section-flag {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 22px;
}

.section-flag__number {
  display: inline-grid;
  width: 34px;
  height: 29px;
  place-items: center;
  color: var(--parchment);
  background: var(--deep-sea);
  box-shadow: 3px 3px 0 var(--gold-deep);
  font-family: var(--pixel);
  font-size: 8px;
}

.section-flag p {
  margin: 0;
  color: var(--hull);
  font-family: var(--pixel);
  font-size: 8px;
  line-height: 1.6;
  text-transform: uppercase;
}

.captains-log h2,
.plunder-scale h2,
.hold-vault h2,
.crew-roster h2,
.parley-rules h2 {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 0 20px;
  color: var(--flag);
  font-family: var(--pixel);
  font-size: clamp(20px, 3vw, 36px);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: -0.06em;
}

/* Captain's log */
.captains-log {
  padding-left: clamp(27px, 5vw, 62px);
}

.captains-log::before {
  background:
    repeating-linear-gradient(90deg, transparent 0 26px, rgba(50, 91, 89, 0.13) 26px 27px),
    linear-gradient(90deg, transparent calc(100% - 1px), rgba(50, 91, 89, 0.13));
}

.log-copy {
  position: relative;
  z-index: 1;
  max-width: 760px;
  color: #1b3534;
  font-size: clamp(21px, 2vw, 25px);
  line-height: 1.4;
}

.log-copy p {
  margin: 0 0 1em;
}

.log-copy strong {
  color: var(--deep-sea);
}

.log-copy blockquote {
  position: relative;
  margin: 29px 0 30px;
  padding: 19px 23px 17px 54px;
  color: var(--parchment);
  background: var(--deep-sea);
  border-left: 7px solid var(--gold);
  box-shadow: 5px 5px 0 rgba(16, 36, 37, 0.18);
}

.log-copy blockquote p {
  margin: 0 0 8px;
  font-size: 1.2em;
  line-height: 1.15;
}

.log-copy cite {
  color: var(--gold-bright);
  font-family: var(--pixel);
  font-size: 7px;
  font-style: normal;
  line-height: 1.6;
}

.quote-glyph {
  position: absolute;
  top: 9px;
  left: 14px;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 58px;
  line-height: 1;
}

.captains-note {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin-top: 26px;
  padding: 19px 21px 17px;
  background:
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(67, 43, 5, 0.055) 5px 6px),
    #f5ce67;
  border: 2px solid var(--gold-deep);
  box-shadow: 4px 4px 0 rgba(90, 59, 12, 0.18);
  transform: rotate(-0.5deg);
}

.captains-note p {
  margin: 0;
  color: #2c2918;
  font-size: 18px;
  line-height: 1.3;
}

.note-pin {
  position: absolute;
  top: -10px;
  left: 50%;
  width: 17px;
  height: 17px;
  background: var(--danger);
  border: 3px solid #7b2b20;
  border-radius: 50%;
  box-shadow: 1px 2px 0 rgba(0, 0, 0, 0.2);
}

/* Plunder scale */
.scale-heading,
.hold-heading,
.roster-heading,
.parley-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.scale-heading > div:first-child,
.hold-heading > div,
.parley-heading {
  max-width: 750px;
}

.scale-heading p,
.roster-heading p,
.parley-heading p,
.hold-heading p {
  margin: -7px 0 24px;
  color: var(--ink-soft);
  font-size: 21px;
  line-height: 1.3;
}

.compass-rose {
  position: relative;
  display: grid;
  width: 104px;
  height: 104px;
  flex: 0 0 104px;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  align-content: center;
  justify-content: center;
  padding: 10px;
  color: var(--hull);
  border: 3px solid var(--hull);
  border-radius: 50%;
  font-family: var(--pixel);
  font-size: 6px;
  transform: rotate(4deg);
}

.compass-rose span {
  display: grid;
  place-items: center;
}

.compass-rose i {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 62px;
  background: linear-gradient(180deg, var(--gold) 0 50%, var(--hull) 50%);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transform: translate(-50%, -50%) rotate(26deg);
}

.fare-ladder {
  position: relative;
  z-index: 1;
  display: grid;
  margin: 0 0 25px;
  border: 3px solid var(--flag);
  box-shadow: 5px 5px 0 rgba(16, 36, 37, 0.18);
}

.fare-ladder__head,
.fare-row {
  display: grid;
  grid-template-columns: 0.8fr 1.25fr 0.7fr;
  align-items: center;
}

.fare-ladder__head {
  color: var(--gold-bright);
  background: var(--deep-sea);
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.6;
}

.fare-ladder__head span,
.fare-row span {
  padding: 10px 12px;
}

.fare-ladder__head span + span,
.fare-row span + span {
  border-left: 2px solid rgba(49, 81, 73, 0.38);
}

.fare-row {
  min-height: 51px;
  background: rgba(255, 255, 255, 0.22);
  border-top: 2px solid rgba(49, 81, 73, 0.38);
  font-size: 21px;
}

.fare-row:nth-child(odd) {
  background: rgba(152, 121, 64, 0.08);
}

.fare-row b {
  font-family: var(--pixel);
  font-size: 9px;
  font-weight: 400;
}

.fare-free {
  color: #a0281b;
  font-family: var(--pixel);
  font-size: 7px;
  font-weight: 700;
}

.rarity-ledger {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 26px;
}

.rarity-slip {
  position: relative;
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 12px;
  padding: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.27);
  border: 2px solid var(--flag);
}

.rarity-slip::after {
  position: absolute;
  top: -22px;
  right: -22px;
  width: 44px;
  height: 44px;
  content: "";
  background: var(--rarity-color);
  transform: rotate(45deg);
}

.rarity-code {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--flag);
  background: var(--rarity-color);
  font-family: var(--pixel);
  font-size: 7px;
}

.rarity-slip div {
  min-width: 0;
}

.rarity-slip h3 {
  margin: 0;
  font-family: var(--pixel);
  font-size: 7px;
  font-weight: 400;
  line-height: 1.55;
}

.rarity-slip p {
  margin: 4px 0 0;
  font-family: var(--pixel);
  font-size: 9px;
  line-height: 1.6;
}

.burn-tag {
  align-self: end;
  padding-top: 8px;
  border-top: 1px dashed rgba(16, 36, 37, 0.35);
  color: #70401e;
  font-family: var(--pixel);
  font-size: 6px;
  line-height: 1.55;
}

.rarity-slip--common {
  --rarity-color: var(--common);
}

.rarity-slip--rare {
  --rarity-color: var(--rare);
}

.rarity-slip--epic {
  --rarity-color: var(--epic);
}

.rarity-slip--legendary {
  --rarity-color: var(--legendary);
}

.rarity-slip--divine {
  --rarity-color: var(--divine);
}

.live-ledger {
  position: relative;
  z-index: 1;
  margin: 0 0 27px;
  color: var(--parchment);
  background:
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.018) 5px 6px),
    var(--flag);
  border: 3px solid var(--teal);
  box-shadow: 5px 5px 0 rgba(16, 36, 37, 0.22);
}

.live-ledger__title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  border-bottom: 2px solid #285458;
}

.live-ledger__title h3 {
  margin: 0;
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.6;
}

.live-ledger__title .signal-pip {
  background: var(--sea-glass);
  box-shadow: 7px 0 0 var(--sea-glass), 0 7px 0 var(--sea-glass), 7px 7px 0 var(--sea-glass);
}

.ledger-live {
  margin-left: auto;
  color: #78a89e;
  font-family: var(--pixel);
  font-size: 6px;
  line-height: 1.5;
}

.ledger-grid {
  display: grid;
  grid-template-columns: 1.45fr repeat(4, minmax(0, 1fr));
}

.ledger-cell {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 15px 12px;
  border-right: 2px solid #285458;
}

.ledger-cell:last-child {
  border-right: 0;
}

.ledger-cell .micro-label {
  color: #7ea99f;
  font-size: 6px;
}

.ledger-cell strong {
  color: var(--gold-bright);
  font-family: var(--pixel);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.6;
}

.deck-gauge {
  height: 8px;
  margin-top: 6px;
  background: #233f40;
  border: 1px solid #42696a;
}

.deck-gauge i {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--gold) 0 8px, var(--gold-deep) 8px 10px);
  transition: width 700ms steps(12, end);
}

.loot-uses {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.loot-uses article {
  position: relative;
  min-width: 0;
  padding: 16px 15px 15px;
  background: rgba(255, 255, 255, 0.3);
  border-top: 5px solid var(--deep-sea);
  border-right: 1px solid rgba(16, 36, 37, 0.2);
  border-bottom: 1px solid rgba(16, 36, 37, 0.2);
  border-left: 1px solid rgba(16, 36, 37, 0.2);
}

.loot-uses article > span {
  display: grid;
  width: 31px;
  height: 31px;
  margin-bottom: 12px;
  place-items: center;
  color: var(--gold-bright);
  background: var(--deep-sea);
  font-family: var(--pixel);
  font-size: 8px;
  box-shadow: 3px 3px 0 var(--gold-deep);
}

.loot-uses h3 {
  margin: 0 0 7px;
  font-family: var(--pixel);
  font-size: 8px;
  font-weight: 400;
  line-height: 1.6;
}

.loot-uses p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  line-height: 1.25;
}

/* My hold */
.hold-vault {
  position: relative;
  padding: clamp(24px, 4.5vw, 50px);
  color: var(--parchment);
  background:
    radial-gradient(circle at 92% 10%, rgba(246, 189, 47, 0.12), transparent 20rem),
    repeating-linear-gradient(90deg, transparent 0 39px, rgba(255, 255, 255, 0.025) 39px 40px),
    #09292e;
  border: 4px solid var(--gold-deep);
  box-shadow:
    inset 0 0 0 3px #123d41,
    9px 9px 0 rgba(0, 0, 0, 0.4);
}

.hold-vault::before {
  position: absolute;
  top: 10px;
  right: 10px;
  bottom: 10px;
  left: 10px;
  border: 1px dashed #2d5557;
  content: "";
  pointer-events: none;
}

.hold-vault .section-flag p {
  color: var(--sea-glass);
}

.hold-vault h2 {
  color: var(--parchment);
}

.hold-heading {
  align-items: flex-end;
}

.hold-heading p {
  color: #b7d2c7;
}

.paper-button {
  display: inline-flex;
  min-height: 41px;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  color: var(--ink);
  background: var(--parchment);
  border: 2px solid var(--flag);
  box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.38);
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.6;
  text-align: center;
  text-decoration: none;
}

.paper-button:hover:not(:disabled) {
  background: var(--gold-bright);
}

.paper-button:disabled {
  color: #758580;
  background: #1a393b;
  border-color: #3c5b5b;
}

.paper-button--gold {
  color: var(--flag);
  background: var(--gold);
  border-color: var(--gold-bright);
}

.wallet-chart {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.6fr repeat(3, minmax(0, 1fr));
  margin: 4px 0 16px;
  background: #061d20;
  border: 2px solid #315759;
}

.wallet-chart > div {
  display: grid;
  min-width: 0;
  gap: 5px;
  padding: 10px 12px;
  border-right: 2px solid #315759;
}

.wallet-chart > div:last-child {
  border-right: 0;
}

.wallet-chart .micro-label {
  color: #71988e;
  font-size: 6px;
}

.wallet-chart strong {
  overflow: hidden;
  color: var(--gold-bright);
  font-family: var(--pixel);
  font-size: 7px;
  font-weight: 400;
  line-height: 1.6;
  text-overflow: ellipsis;
}

.hold-console {
  position: relative;
  z-index: 1;
  padding: 12px;
  background: #061a1c;
  border: 3px solid #244b4e;
}

.hold-console__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 7px 9px;
  background: #0d2e31;
  border-left: 4px solid var(--sea-glass);
}

.hold-console__bar p {
  margin: 0;
  color: #b6d1c6;
  font-size: 17px;
}

.selection-count {
  color: var(--gold);
  font-family: var(--pixel);
  font-size: 7px;
  white-space: nowrap;
}

.hold-tokens {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  min-height: 150px;
}

.empty-hold {
  display: grid;
  grid-column: 1 / -1;
  min-height: 170px;
  place-content: center;
  place-items: center;
  padding: 20px;
  color: #9fc0b6;
  border: 2px dashed #31575a;
  text-align: center;
}

.empty-hold p {
  max-width: 390px;
  margin: 12px 0 0;
  font-size: 19px;
  line-height: 1.2;
}

.empty-hold__chest {
  display: block;
  width: 48px;
  height: 36px;
  background:
    linear-gradient(90deg, transparent 8px, var(--gold-deep) 8px 13px, transparent 13px 35px, var(--gold-deep) 35px 40px, transparent 40px),
    linear-gradient(0deg, #5b3b18 0 23px, #926327 23px 27px, #5b3b18 27px 33px, #d49a34 33px 36px);
  border: 3px solid #3b2813;
  box-shadow: 0 0 15px rgba(246, 189, 47, 0.18);
}

.salvage-token {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 8px;
  padding: 7px;
  color: var(--ink);
  background: var(--parchment);
  border: 2px solid #1a3433;
  text-align: left;
}

.salvage-token.is-selected {
  background: var(--gold-bright);
  outline: 4px solid var(--gold);
  outline-offset: -4px;
}

.salvage-token__select {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  text-align: left;
}

.salvage-token__art {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background:
    repeating-conic-gradient(#17474a 0 25%, #0e3437 0 50%) 50% / 12px 12px;
  border: 2px solid var(--flag);
}

.salvage-token__art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.salvage-token__rarity {
  position: absolute;
  right: 3px;
  bottom: 3px;
  padding: 3px 4px;
  color: var(--flag);
  background: var(--rarity-color, var(--common));
  font-family: var(--pixel);
  font-size: 5px;
  line-height: 1.5;
}

.salvage-token__id {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.5;
}

.salvage-token__name {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.salvage-token[data-rarity="0"] {
  --rarity-color: var(--common);
}

.salvage-token[data-rarity="1"] {
  --rarity-color: var(--rare);
}

.salvage-token[data-rarity="2"] {
  --rarity-color: var(--epic);
}

.salvage-token[data-rarity="3"] {
  --rarity-color: var(--legendary);
}

.salvage-token[data-rarity="4"] {
  --rarity-color: var(--divine);
}

.forge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.forge-button {
  min-height: 43px;
  flex: 1 1 155px;
  padding: 9px 11px;
  color: var(--parchment);
  background: #123b3e;
  border: 2px solid #3b6565;
  box-shadow: 3px 3px 0 #020c0d;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.6;
}

.forge-button:hover:not(:disabled) {
  color: var(--flag);
  background: var(--gold);
  border-color: var(--gold-bright);
}

.forge-button:disabled {
  color: #607d78;
  background: #102b2d;
  border-color: #2f4a4b;
}

.forge-button--danger:hover:not(:disabled) {
  color: #fff1e8;
  background: var(--danger);
  border-color: var(--danger-bright);
}

.hold-console .action-status {
  margin-bottom: 0;
}

.loot-exchanger {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 20px;
  align-items: center;
  margin-top: 18px;
  padding: 18px;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg, transparent 0 6px, rgba(92, 58, 18, 0.04) 6px 7px),
    var(--parchment-deep);
  border: 3px solid var(--gold);
}

.loot-exchanger__copy h3 {
  margin: 7px 0 5px;
  color: var(--flag);
  font-family: var(--pixel);
  font-size: 11px;
  font-weight: 400;
  line-height: 1.55;
}

.loot-exchanger__copy > p:last-child {
  margin: 0;
  color: #3c493d;
  font-size: 17px;
  line-height: 1.25;
}

.loot-exchange-controls .quantity-label {
  color: var(--ink);
}

.quantity-stepper--compact {
  height: 43px;
  grid-template-columns: 42px 1fr 42px;
  margin-bottom: 10px;
  border-color: var(--flag);
}

.quantity-stepper--compact input {
  color: var(--ink);
  background: var(--gold-bright);
  font-size: 11px;
}

.loot-exchange-controls .paper-button {
  width: 100%;
}

/* Crew roster */
.roster-heading {
  display: block;
}

.roster-heading p {
  max-width: 820px;
}

.tier-parade {
  position: relative;
  z-index: 1;
  margin-top: 28px;
  padding-top: 4px;
  border-top: 5px solid var(--tier-color);
}

.tier-parade--common {
  --tier-color: var(--common);
}

.tier-parade--rare {
  --tier-color: var(--rare);
}

.tier-parade--epic {
  --tier-color: var(--epic);
}

.tier-parade--legendary {
  --tier-color: var(--gold);
}

.tier-parade--divine {
  --tier-color: #5c807c;
}

.tier-banner {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 0 11px;
}

.tier-index {
  color: var(--tier-color);
  font-size: 6px;
}

.tier-banner h3 {
  margin: 5px 0 0;
  color: var(--flag);
  font-family: var(--pixel);
  font-size: clamp(14px, 2vw, 21px);
  font-weight: 400;
  line-height: 1.4;
}

.tier-banner p {
  max-width: 48%;
  margin: 0;
  color: var(--ink-soft);
  font-size: 17px;
  text-align: right;
}

.tier-banner p strong {
  color: var(--flag);
  font-family: var(--pixel);
  font-size: 9px;
  font-weight: 400;
}

.tier-deck-note {
  max-width: 810px;
  margin: 0 0 14px;
  padding: 10px 12px;
  color: #344743;
  background: rgba(255, 255, 255, 0.3);
  border-left: 4px solid var(--tier-color);
  font-size: 17px;
  line-height: 1.25;
}

.crew-mosaic {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.crew-mosaic--five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.crew-mosaic--seven {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.pirate-portrait {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
}

.portrait-frame {
  position: relative;
  aspect-ratio: 1;
  padding: 5px;
  overflow: hidden;
  background:
    linear-gradient(135deg, var(--tier-color), #173332 50%, var(--tier-color));
  border: 2px solid var(--flag);
  box-shadow: 4px 4px 0 rgba(16, 36, 37, 0.22);
}

.portrait-frame::before,
.portrait-frame::after {
  position: absolute;
  z-index: 2;
  width: 8px;
  height: 8px;
  content: "";
  background: var(--gold);
}

.portrait-frame::before {
  top: 2px;
  left: 2px;
}

.portrait-frame::after {
  right: 2px;
  bottom: 2px;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  background: #102c2e;
  object-fit: cover;
  transition: transform 180ms steps(4, end);
}

.pirate-portrait:hover .portrait-frame img {
  transform: scale(1.035);
}

.pirate-portrait figcaption {
  display: grid;
  gap: 3px;
  padding: 8px 2px 0;
  min-width: 0;
  max-width: 100%;
}

.pirate-portrait figcaption span {
  overflow: hidden;
  max-width: 100%;
  min-width: 0;
  color: var(--flag);
  font-size: 17px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pirate-portrait figcaption small {
  color: #62716a;
  font-family: var(--pixel);
  font-size: 5px;
  line-height: 1.5;
}

.pirate-portrait .portrait-bio {
  margin: 7px 0 0;
  color: #344743;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.18;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* FAQ / parley */
.parley-heading {
  display: block;
}

.parley-group {
  position: relative;
  z-index: 1;
}

.parley-group + .parley-group {
  margin-top: 30px;
}

.parley-group__head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.parley-group__head .ticket-eyebrow {
  margin: 0;
  color: var(--gold-deep);
}

.parley-group__head h3 {
  margin: 0;
  color: var(--flag);
  font-family: var(--pixel);
  font-size: clamp(11px, 1.5vw, 15px);
  font-weight: 400;
  line-height: 1.5;
  text-align: right;
}

.rules-ledger {
  position: relative;
  z-index: 1;
  border-top: 3px solid var(--flag);
}

.rules-ledger details {
  border-bottom: 2px solid rgba(16, 36, 37, 0.35);
}

.rules-ledger summary {
  display: grid;
  grid-template-columns: 35px minmax(0, 1fr) 24px;
  gap: 13px;
  align-items: center;
  min-height: 65px;
  padding: 12px 4px;
  color: var(--flag);
  font-family: var(--pixel);
  font-size: clamp(8px, 1.45vw, 11px);
  line-height: 1.7;
  cursor: pointer;
  list-style: none;
}

.rules-ledger summary::-webkit-details-marker {
  display: none;
}

.rules-ledger summary:hover {
  color: var(--hull);
  background: rgba(255, 255, 255, 0.22);
}

.rule-number {
  color: var(--gold-deep);
  font-size: 7px;
}

.rule-plus {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: var(--parchment);
  background: var(--deep-sea);
  font-family: var(--body);
  font-size: 24px;
  line-height: 1;
}

.rules-ledger details[open] .rule-plus {
  background: var(--gold-deep);
  transform: rotate(45deg);
}

.rule-answer {
  padding: 0 45px 20px 48px;
}

.rule-answer p {
  max-width: 780px;
  margin: 0;
  color: #30443f;
  font-size: 20px;
  line-height: 1.35;
}

.x-claim {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 20px;
  margin-top: 31px;
  padding: 20px;
  color: var(--parchment);
  background:
    repeating-linear-gradient(0deg, transparent 0 5px, rgba(255, 255, 255, 0.018) 5px 6px),
    var(--flag);
  border: 3px solid var(--teal);
  box-shadow: 5px 5px 0 rgba(16, 36, 37, 0.24);
}

.x-claim__crest {
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  color: var(--flag);
  background: var(--parchment);
  border: 4px solid var(--gold);
  font-family: var(--pixel);
  font-size: 24px;
  box-shadow: 4px 4px 0 #000;
}

.x-claim__copy h3 {
  margin: 7px 0 5px;
  color: var(--gold-bright);
  font-family: var(--pixel);
  font-size: clamp(12px, 1.8vw, 17px);
  font-weight: 400;
  line-height: 1.5;
}

.x-claim__copy > p {
  max-width: 700px;
  margin: 0;
  color: #bcd8ce;
  font-size: 18px;
  line-height: 1.25;
}

.claim-state {
  margin: 13px 0 10px;
  padding: 8px 10px;
  color: #a6c4ba;
  background: #0c2a2d;
  border-left: 3px solid var(--gold);
  font-size: 17px;
  line-height: 1.25;
}

.claim-state a {
  color: var(--gold-bright);
}

.claim-state.is-error {
  color: #ffad94;
  border-left-color: var(--danger-bright);
}

.claim-state.is-success {
  color: #8ff0cc;
  border-left-color: var(--sea-glass);
}

.claim-actions {
  display: grid;
  grid-template-columns: auto minmax(150px, 1fr) auto;
  gap: 9px;
  align-items: end;
}

.claim-url-wrap {
  display: grid;
  gap: 4px;
}

.claim-url-wrap label {
  color: #8fb4a9;
  font-family: var(--pixel);
  font-size: 6px;
  line-height: 1.6;
}

.claim-url-wrap input {
  width: 100%;
  min-height: 41px;
  padding: 7px 9px;
  color: var(--parchment);
  background: #06181a;
  border: 2px solid #376264;
  font-size: 17px;
}

.claim-url-wrap input::placeholder {
  color: #68837d;
}

/* Footer */
.black-flag-footer {
  display: grid;
  width: min(1330px, calc(100% - 32px));
  grid-template-columns: auto auto 1fr;
  gap: 20px 30px;
  align-items: center;
  margin: 0 auto;
  padding: 30px clamp(15px, 3vw, 34px) 38px;
  color: #b7d3c9;
  background:
    repeating-linear-gradient(90deg, transparent 0 31px, rgba(255, 255, 255, 0.02) 31px 32px),
    var(--flag);
  border-top: 8px solid var(--gold-deep);
  border-right: 3px solid #1e4b4d;
  border-bottom: 3px solid #1e4b4d;
  border-left: 3px solid #1e4b4d;
}

.footer-flag {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-flag__icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--flag);
  background: var(--gold);
}

.footer-flag__icon svg {
  width: 26px;
  height: 26px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.footer-flag > div {
  display: grid;
  gap: 4px;
}

.footer-flag strong {
  color: var(--parchment);
  font-family: var(--pixel);
  font-size: 9px;
  font-weight: 400;
  line-height: 1.5;
}

.footer-flag span {
  font-size: 16px;
}

.footer-crate {
  width: 52px;
  height: 52px;
  object-fit: contain;
}

.footer-contracts {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.footer-contracts a {
  padding: 8px 10px;
  color: var(--gold-bright);
  border: 2px solid #396466;
  font-family: var(--pixel);
  font-size: 7px;
  line-height: 1.7;
  text-decoration: none;
}

.footer-contracts a:hover {
  color: var(--flag);
  background: var(--gold);
}

.footer-disclaimer {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 16px;
  color: #7fa49a;
  border-top: 1px dashed #33595b;
  font-size: 16px;
  line-height: 1.25;
}

@keyframes banner-drop {
  from {
    opacity: 0;
    transform: translateY(-34px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dialog-rise {
  from {
    opacity: 0;
    transform: translateY(35px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pass-slide {
  from {
    opacity: 0;
    transform: translateX(34px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes signal-blink {
  0%,
  48% {
    opacity: 1;
  }
  49%,
  100% {
    opacity: 0.42;
  }
}

@media (max-width: 1180px) {
  :root {
    --nav-height: 142px;
  }

  .quarterdeck {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .game-menu {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    scrollbar-color: var(--gold-deep) var(--flag);
  }

  .game-menu__tab {
    flex: 1 0 auto;
  }

  .wallet-rig {
    justify-self: end;
  }

  .voyage-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 355px);
  }

  .crew-mosaic--seven {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .ledger-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .ledger-cell--wide {
    grid-column: 1 / -1;
    border-right: 0;
    border-bottom: 2px solid #285458;
  }

  .ledger-cell:nth-child(5) {
    border-right: 0;
  }
}

@media (max-width: 960px) {
  :root {
    --nav-height: 142px;
  }

  .voyage-layout {
    width: min(760px, calc(100% - 24px));
    grid-template-columns: 1fr;
  }

  .boarding-berth,
  .chronicle-column {
    position: static;
    grid-column: 1;
    grid-row: auto;
  }

  .boarding-berth {
    width: min(520px, 100%);
    margin: 0 auto;
  }

  .chronicle-column {
    gap: 28px;
  }

  .raid-deck {
    min-height: 720px;
  }

  .hero-stamp {
    right: 18px;
    bottom: 82px;
    width: 96px;
    height: 96px;
  }

  .rarity-ledger {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rarity-slip:last-child {
    grid-column: span 2;
  }

  .loot-uses {
    grid-template-columns: 1fr;
  }

  .hold-tokens {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .crew-mosaic--five {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  :root {
    --nav-height: 128px;
  }

  body {
    font-size: 19px;
  }

  .quarterdeck {
    gap: 9px;
    padding: 9px 10px;
  }

  .ship-mark__word {
    display: none;
  }

  .ship-mark__flag {
    width: 38px;
    height: 38px;
  }

  .game-menu {
    margin: 0 -2px;
  }

  .game-menu__tab {
    min-height: 39px;
    padding: 0 10px;
    font-size: 7px;
  }

  .connect-cutlass {
    min-height: 38px;
    padding: 0 9px;
    font-size: 7px;
  }

  .language-switch {
    min-width: 50px;
    min-height: 38px;
  }

  .raid-deck {
    min-height: 740px;
    padding: 26px 14px 74px;
  }

  .raid-deck__masthead {
    top: 25px;
    left: 14px;
  }

  .raid-deck h1 {
    gap: 7px 9px;
    font-size: clamp(37px, 12vw, 68px);
  }

  .rpg-dialog {
    padding: 39px 19px 23px;
  }

  .rpg-dialog__line {
    font-size: 22px;
  }

  .rpg-dialog__choices {
    display: grid;
  }

  .dialogue-choice {
    justify-content: flex-start;
  }

  .hero-stamp {
    display: none;
  }

  .captains-log,
  .plunder-scale,
  .crew-roster,
  .parley-rules,
  .hold-vault {
    padding: 24px 18px 25px;
  }

  .captains-log {
    padding-left: 30px;
  }

  .scale-heading,
  .hold-heading,
  .tier-banner {
    display: block;
  }

  .compass-rose {
    display: none;
  }

  .fare-ladder__head,
  .fare-row {
    grid-template-columns: 0.75fr 1.2fr 0.7fr;
  }

  .fare-ladder__head span,
  .fare-row span {
    padding: 9px 6px;
  }

  .fare-row {
    font-size: 18px;
  }

  .ledger-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ledger-cell:nth-child(3) {
    border-right: 0;
  }

  .ledger-cell:nth-child(4) {
    border-top: 2px solid #285458;
  }

  .ledger-cell:nth-child(5) {
    border-top: 2px solid #285458;
  }

  .wallet-chart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .wallet-chart > div:nth-child(2) {
    border-right: 0;
  }

  .wallet-chart > div:nth-child(3),
  .wallet-chart > div:nth-child(4) {
    border-top: 2px solid #315759;
  }

  .hold-tokens {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .loot-exchanger {
    grid-template-columns: 1fr;
  }

  .crew-mosaic--five,
  .crew-mosaic--seven {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tier-banner p {
    max-width: none;
    margin-top: 8px;
    text-align: left;
  }

  .rules-ledger summary {
    grid-template-columns: 25px minmax(0, 1fr) 22px;
    gap: 9px;
    font-size: 8px;
  }

  .parley-group__head {
    display: block;
  }

  .parley-group__head h3 {
    margin-top: 5px;
    text-align: left;
  }

  .rule-answer {
    padding: 0 12px 18px 34px;
  }

  .x-claim {
    grid-template-columns: 1fr;
  }

  .x-claim__crest {
    width: 54px;
    height: 54px;
    font-size: 17px;
  }

  .claim-actions {
    grid-template-columns: 1fr;
  }

  .claim-actions .paper-button {
    width: 100%;
  }

  .black-flag-footer {
    grid-template-columns: 1fr auto;
  }

  .footer-crate {
    grid-column: 2;
  }

  .footer-contracts {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 430px) {
  :root {
    --nav-height: 126px;
  }

  .wallet-rig {
    gap: 6px;
  }

  .connect-cutlass__lamp {
    display: none;
  }

  .game-menu__tab {
    padding: 0 8px;
  }

  .overrun-tag {
    font-size: 6px;
  }

  .raid-deck h1 {
    font-size: 36px;
  }

  .masthead-chinese {
    font-size: 10px;
  }

  .rpg-dialog__speaker {
    left: 14px;
    font-size: 7px;
  }

  .rpg-dialog__line {
    font-size: 21px;
  }

  .captains-log h2,
  .plunder-scale h2,
  .hold-vault h2,
  .crew-roster h2,
  .parley-rules h2 {
    font-size: 18px;
  }

  .rarity-ledger {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rarity-slip:last-child {
    grid-column: 1 / -1;
  }

  .crew-mosaic--five,
  .crew-mosaic--seven {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hold-tokens {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pass-stub {
    margin: 0 14px;
  }

  .mint-instrument {
    padding-right: 15px;
    padding-left: 15px;
  }

  .fare-ladder__head,
  .fare-row {
    grid-template-columns: 0.75fr 1.1fr 0.65fr;
  }

  .fare-ladder__head {
    font-size: 6px;
  }

  .fare-row b {
    font-size: 8px;
  }

  .fare-free {
    font-size: 6px;
  }

  .ledger-live {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* overflow-390: keep the page from scrolling sideways at phone widths */
@media (max-width: 420px) {
  .quarterdeck,
  .game-menu,
  .crew-roster,
  .crew-mosaic,
  .pirate-portrait,
  .parley-rules {
    max-width: 100%;
    min-width: 0;
  }
  .game-menu {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    overflow-x: auto;
  }
  .game-menu__tab {
    flex: 1 1 auto;
  }
  .crew-mosaic--five,
  .crew-mosaic--seven {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pirate-portrait figcaption span,
  .pirate-portrait figcaption small,
  .pirate-portrait .portrait-bio {
    max-width: 100%;
    min-width: 0;
  }
}
