:root {
  color-scheme: dark;
  font-family:
    Avenir Next,
    Avenir,
    system-ui,
    sans-serif;
  --ink: #f6edda;
  --navy: #101d26;
  --navy-soft: #172a35;
  --gold: #d9a441;
  --rust: #a9482b;
  --panel: rgb(13 28 37 / 88%);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0b1720;
}

button {
  font: inherit;
}

.game-shell {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--navy);
}

.intro-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #101014;
  transition:
    opacity 600ms ease,
    visibility 600ms ease;
}

.intro-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.intro-screen iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.intro-screen button {
  position: absolute;
  top: 18px;
  right: 18px;
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid rgb(242 237 225 / 30%);
  border-radius: 999px;
  color: var(--ink);
  background: rgb(13 13 18 / 72%);
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.intro-screen button:hover {
  background: rgb(242 237 225 / 14%);
}

.auth-screen {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: none !important;
  grid-template-columns: minmax(280px, 0.8fr) minmax(560px, 1.2fr);
  min-height: 100dvh;
  overflow: auto;
  color: #f6edda;
  background: #0d1c25;
}

.auth-art {
  position: sticky;
  top: 0;
  min-height: 100dvh;
  background:
    linear-gradient(0deg, rgb(9 20 27 / 84%), rgb(9 20 27 / 10%) 70%),
    linear-gradient(90deg, transparent 55%, #0d1c25 100%),
    url("pirate-painting.png") 46% center / cover;
}

.auth-art-copy {
  position: absolute;
  right: 32px;
  bottom: 42px;
  left: 32px;
  max-width: 440px;
}

.auth-art-copy p,
.auth-kicker {
  margin: 0 0 8px;
  color: #e5b652;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.auth-art-copy h1 {
  max-width: 9ch;
  margin: 0 0 12px;
  font-family: Georgia, Times New Roman, serif;
  font-size: clamp(42px, 5.5vw, 76px);
  line-height: 0.94;
}

.auth-art-copy span {
  color: #d2dadd;
  font-weight: 650;
}

.auth-panel {
  align-self: center;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  width: min(880px, calc(100% - 48px));
  margin: 32px auto;
  overflow: hidden;
  border: 1px solid rgb(230 190 104 / 28%);
  border-radius: 14px;
  background: #142832;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 7%),
    0 28px 80px rgb(3 10 14 / 55%);
}

.auth-form-wrap {
  padding: clamp(24px, 4vw, 42px);
}

.auth-form-wrap h2 {
  margin: 0;
  font-family: Georgia, Times New Roman, serif;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
}

.auth-intro {
  max-width: 46ch;
  margin: 10px 0 22px;
  color: #bfd0d5;
  line-height: 1.5;
}

.auth-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.auth-login-form {
  grid-template-columns: 1fr;
}

.auth-field {
  display: grid;
  align-content: start;
  gap: 6px;
}

.auth-field-wide {
  grid-column: 1 / -1;
}

.auth-field label {
  color: #f6edda;
  font-size: 13px;
  font-weight: 800;
}

.auth-field input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #4b6670;
  border-radius: 8px;
  color: #f8f1e3;
  background: #0f212a;
  outline: none;
}

.auth-field input:hover {
  border-color: #78919a;
}

.auth-field input:focus {
  border-color: #e5b652;
  box-shadow: 0 0 0 3px rgb(229 182 82 / 20%);
}

.auth-field small {
  color: #aebfc4;
  font-size: 11px;
  line-height: 1.35;
}

.auth-submit,
.auth-side-action button,
.username-suggestions button,
.account-status button {
  border: 0;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.auth-submit {
  grid-column: 1 / -1;
  min-height: 46px;
  margin-top: 4px;
  color: #172027;
  background: #e5b652;
}

.auth-submit:hover {
  background: #f0c96f;
}

.auth-submit:disabled {
  cursor: wait;
  opacity: 0.7;
}

.auth-submit:active,
.auth-side-action button:active,
.username-suggestions button:active,
.account-status button:active {
  transform: translateY(1px) scale(0.98);
}

.auth-message {
  grid-column: 1 / -1;
  margin: 0;
  padding: 10px 12px;
  border-left: 4px solid #dc6b52;
  color: #ffe1d9;
  font-size: 13px;
  font-weight: 700;
  background: rgb(126 42 33 / 36%);
}

.username-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.username-suggestions::before {
  width: 100%;
  color: #d3dee1;
  font-size: 11px;
  content: "Available suggestions";
}

.username-suggestions button {
  padding: 6px 9px;
  color: #f7ead0;
  background: #314b56;
}

.auth-privacy {
  margin: 18px 0 0;
  color: #aebfc4;
  font-size: 11px;
  line-height: 1.5;
}

.auth-side-action {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 14px;
  padding: 28px 22px;
  color: #fff2d7;
  background:
    linear-gradient(160deg, rgb(255 255 255 / 7%), transparent 46%),
    #783825;
}

.auth-side-action p {
  margin: 0;
  font-family: Georgia, Times New Roman, serif;
  font-size: 21px;
  line-height: 1.2;
}

.auth-side-action button {
  min-height: 42px;
  padding: 0 16px;
  color: #4a2518;
  background: #f0d290;
}

.auth-side-action .credits-button {
  color: #fff2d7;
  border: 1px solid rgb(255 242 215 / 52%);
  background: transparent;
}

.auth-side-action .credits-button:hover {
  color: #3a2119;
  background: #fff2d7;
}

.credits-panel {
  position: absolute;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(5 13 18 / 82%);
  backdrop-filter: blur(7px);
}

.credits-sheet {
  position: relative;
  width: min(680px, 100%);
  max-height: calc(100dvh - 44px);
  overflow: auto;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid rgb(229 182 82 / 55%);
  border-radius: 14px;
  color: #f6edda;
  background:
    linear-gradient(145deg, rgb(255 255 255 / 5%), transparent 45%),
    #142832;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 8%),
    0 28px 90px rgb(2 8 12 / 68%);
}

.credits-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgb(246 237 218 / 32%);
  border-radius: 8px;
  color: #f6edda;
  font-size: 25px;
  line-height: 1;
  background: #263f49;
  cursor: pointer;
}

.credits-close:hover {
  color: #2f2115;
  background: #e5b652;
}

.credits-close:active {
  transform: translateY(1px) scale(0.98);
}

.credits-kicker {
  margin: 0 44px 8px 0;
  color: #e5b652;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.credits-sheet h2 {
  margin: 0 0 28px;
  font-family: Georgia, Times New Roman, serif;
  font-size: clamp(42px, 7vw, 70px);
  line-height: 0.95;
}

.credits-list {
  display: grid;
  gap: 0;
  margin: 0;
}

.credits-list > div {
  display: grid;
  grid-template-columns: minmax(150px, 0.7fr) minmax(220px, 1.3fr);
  gap: 24px;
  padding: 17px 0;
  border-top: 1px solid rgb(246 237 218 / 16%);
}

.credits-list dt {
  color: #f0bd5e;
  font-weight: 900;
}

.credits-list dd {
  margin: 0;
  color: #cfdbde;
  line-height: 1.45;
}

.account-status {
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.account-status strong {
  color: #f0bd5e;
}

.account-status button {
  min-height: 30px;
  padding: 4px 9px;
  color: #f6edda;
  background: #6b382b;
}

.account-status .game-credits-button {
  border: 1px solid rgb(246 237 218 / 22%);
  background: #28434d;
}

.account-status .game-credits-button:hover {
  color: #302317;
  background: #e5b652;
}

#game {
  display: block;
  width: 100%;
  height: 100dvh;
  touch-action: none;
}

.hud {
  position: absolute;
  inset: 18px 18px auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.player-status,
.quest {
  border: 1px solid rgb(246 237 218 / 18%);
  border-radius: 12px;
  background: var(--panel);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 8%),
    0 12px 32px rgb(2 10 14 / 26%);
  backdrop-filter: blur(10px);
}

.player-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 13px;
}

.inventory-button,
.quality-button,
.crew-button {
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid rgb(246 237 218 / 18%);
  border-radius: 7px;
  color: var(--ink);
  font-weight: 700;
  background: #263a43;
  cursor: pointer;
  pointer-events: auto;
}

.quality-button {
  white-space: nowrap;
  background: #314b56;
  touch-action: manipulation;
}

.quality-button:hover {
  background: #3b5d69;
}

.quality-button:active {
  transform: translateY(1px) scale(0.98);
}

.quality-button:focus-visible {
  outline: 2px solid #f0bd5e;
  outline-offset: 2px;
}

.crew-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding-left: 7px;
  background: #6d2d29;
}

.crew-button:hover {
  background: #843b34;
}

.crew-button:active {
  transform: translateY(1px) scale(0.98);
}

.crew-flag-mark {
  position: relative;
  display: grid;
  width: 27px;
  height: 20px;
  place-items: center;
  clip-path: polygon(0 0, 100% 0, 77% 50%, 100% 100%, 0 100%);
  color: #f2d18a;
  font-size: 12px;
  line-height: 1;
  background: #20282b;
}

.crew-flag-mark::before {
  position: absolute;
  top: -3px;
  bottom: -4px;
  left: 0;
  width: 2px;
  background: #d5a34d;
  content: "";
}

.crew-invite-badge {
  display: grid;
  min-width: 19px;
  height: 19px;
  padding: 0 5px;
  place-items: center;
  border-radius: 999px;
  color: #28160f;
  font-size: 11px;
  font-weight: 900;
  background: #f0bd5e;
}

.health-status {
  display: flex;
  align-items: center;
  gap: 7px;
}

.health-label {
  color: #f4d8d2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.health-bar {
  position: relative;
  width: 126px;
  height: 15px;
  overflow: hidden;
  border: 2px solid rgb(255 255 255 / 72%);
  border-radius: 999px;
  background: #391d24;
  box-shadow:
    inset 0 2px 5px rgb(0 0 0 / 55%),
    0 0 0 1px rgb(0 0 0 / 38%);
}

.health-bar-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c73535, #f06a4d);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 28%);
  transform-origin: left center;
  transition:
    transform 180ms ease,
    background 180ms ease;
}

.coin {
  width: 15px;
  height: 15px;
  margin-left: 6px;
  border: 2px solid #f5c663;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: inset 0 0 0 2px #b47725;
}

.quest {
  max-width: 280px;
  padding: 10px 14px;
  text-align: right;
}

.quest span {
  display: block;
  margin-bottom: 2px;
  color: #b7c6c9;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quest strong {
  color: var(--ink);
  font-size: 14px;
}

.interaction-prompt {
  position: absolute;
  bottom: 28px;
  left: 50%;
  padding: 10px 14px;
  transform: translateX(-50%);
  border: 1px solid rgb(246 237 218 / 18%);
  border-radius: 10px;
  color: var(--ink);
  background: var(--panel);
  box-shadow: 0 12px 30px rgb(2 10 14 / 30%);
}

.inventory-panel {
  position: absolute;
  top: 84px;
  left: 18px;
  z-index: 6;
  width: min(320px, calc(100% - 36px));
  padding: 16px;
  border: 1px solid rgb(246 237 218 / 20%);
  border-radius: 12px;
  color: var(--ink);
  background: rgb(13 28 37 / 96%);
  box-shadow: 0 20px 60px rgb(0 0 0 / 42%);
}

.inventory-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f0bd5e;
  font-size: 18px;
}

.inventory-heading button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  color: var(--ink);
  background: #263a43;
  cursor: pointer;
}

.inventory-panel ul {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.inventory-portrait {
  float: right;
  width: 78px;
  height: 112px;
  margin: 8px 0 4px 12px;
  object-fit: cover;
  object-position: 50% 28%;
}

.inventory-panel li {
  padding: 9px 10px;
  border-radius: 8px;
  background: rgb(255 255 255 / 7%);
}

.inventory-crew-status {
  clear: both;
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid rgb(255 255 255 / 12%);
  color: #b7c6c9;
  font-size: 13px;
}

.crew-panel {
  position: absolute;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgb(5 13 18 / 84%);
  backdrop-filter: blur(8px);
}

.crew-ledger {
  position: relative;
  width: min(820px, 100%);
  max-height: calc(100dvh - 44px);
  overflow: auto;
  padding: clamp(26px, 4.5vw, 48px);
  border: 1px solid rgb(229 182 82 / 48%);
  border-radius: 14px;
  color: #f6edda;
  background:
    linear-gradient(140deg, rgb(255 255 255 / 5%), transparent 42%),
    #142832;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 8%),
    0 28px 90px rgb(2 8 12 / 70%);
}

.crew-panel-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgb(246 237 218 / 32%);
  border-radius: 8px;
  color: #f6edda;
  font-size: 25px;
  line-height: 1;
  background: #263f49;
  cursor: pointer;
}

.crew-panel-close:hover {
  color: #2f2115;
  background: #e5b652;
}

.crew-panel-kicker {
  margin: 0 46px 8px 0;
  color: #e5b652;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.crew-ledger > h2 {
  margin: 0;
  font-family: Georgia, Times New Roman, serif;
  font-size: clamp(40px, 6vw, 68px);
  line-height: 0.96;
}

.crew-panel-message {
  min-height: 1.4em;
  margin: 10px 0 20px;
  color: #c7d4d7;
  line-height: 1.45;
}

.crew-panel-message.is-error {
  color: #ffb2a0;
}

.crew-ledger-section {
  padding: 20px 0;
  border-top: 1px solid rgb(246 237 218 / 16%);
}

.crew-ledger-section h3 {
  margin: 0 0 10px;
  color: #f1cf88;
  font-size: 18px;
}

.crew-ledger-section p {
  margin: 0 0 12px;
  color: #b9c9cd;
}

.crew-ledger-form,
.crew-invite-form {
  display: grid;
  gap: 8px;
}

.crew-ledger-form label,
.crew-invite-form label {
  color: #eef2ed;
  font-size: 13px;
  font-weight: 800;
}

.crew-ledger-form > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.crew-ledger-form input,
.crew-invite-form textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid #4b6670;
  border-radius: 8px;
  color: #f8f1e3;
  background: #0f212a;
  outline: none;
}

.crew-invite-form textarea {
  min-height: 82px;
  resize: vertical;
}

.crew-ledger-form input:focus,
.crew-invite-form textarea:focus {
  border-color: #e5b652;
  box-shadow: 0 0 0 3px rgb(229 182 82 / 20%);
}

.crew-ledger-form button,
.crew-invite-form button,
.crew-invitation-actions button,
.crew-member-actions button,
.crew-notification button {
  min-height: 40px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  color: #272015;
  font-weight: 850;
  background: #e5b652;
  cursor: pointer;
}

.crew-ledger-form button:disabled {
  color: #9fa9aa;
  background: #334851;
  cursor: not-allowed;
}

.crew-ledger-form button:active,
.crew-invite-form button:active,
.crew-invitation-actions button:active,
.crew-member-actions button:active,
.crew-notification button:active,
.crew-panel-close:active {
  transform: translateY(1px) scale(0.98);
}

.crew-invitations,
.crew-roster {
  display: grid;
  gap: 8px;
}

.crew-invitation,
.crew-roster-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 13px 14px;
  border-radius: 10px;
  background: rgb(255 255 255 / 6%);
}

.crew-invitation strong,
.crew-roster-row strong {
  display: block;
  color: #f6edda;
}

.crew-invitation small,
.crew-roster-row small,
.crew-captain-tools > small {
  color: #aebfc4;
}

.crew-invitation-actions,
.crew-member-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.crew-invitation-actions .crew-decline,
.crew-member-actions .crew-demote {
  color: #e5ecee;
  border: 1px solid #58707a;
  background: #263f49;
}

.crew-roster-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.crew-roster-heading h3,
.crew-roster-heading p {
  margin-bottom: 3px;
}

.crew-rank {
  color: #f0bd5e !important;
  font-weight: 800;
}

.crew-captain-tools {
  display: grid;
  gap: 11px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgb(246 237 218 / 14%);
}

.crew-notification {
  position: absolute;
  top: 88px;
  right: 18px;
  z-index: 9;
  display: flex;
  width: min(390px, calc(100% - 36px));
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 14px;
  border: 1px solid rgb(229 182 82 / 52%);
  border-radius: 12px;
  color: #f6edda;
  background: rgb(32 50 58 / 96%);
  box-shadow: 0 18px 45px rgb(2 8 12 / 48%);
}

.crew-notification strong,
.crew-notification span {
  display: block;
}

.crew-notification span {
  margin-top: 2px;
  color: #bdcdd1;
  font-size: 13px;
}

kbd {
  display: inline-grid;
  min-width: 26px;
  min-height: 26px;
  margin: 0 4px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 22%);
  border-radius: 6px;
  background: #263a43;
  box-shadow: inset 0 -2px 0 rgb(0 0 0 / 28%);
}

.dialogue {
  position: absolute;
  bottom: 28px;
  left: 50%;
  width: min(560px, calc(100% - 32px));
  padding: 20px;
  transform: translateX(-50%);
  border: 1px solid rgb(246 237 218 / 20%);
  border-radius: 14px;
  color: var(--ink);
  background: rgb(13 28 37 / 96%);
  box-shadow: 0 20px 70px rgb(0 0 0 / 45%);
}

.dialogue strong {
  color: #f0bd5e;
}

.dialogue p {
  margin: 8px 0 18px;
  line-height: 1.55;
}

.dialogue button,
.start-copy button {
  min-height: 44px;
  border: 0;
  border-radius: 9px;
  color: #15140e;
  font-weight: 750;
  background: #e4ad43;
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 35%),
    0 8px 20px rgb(0 0 0 / 22%);
  cursor: pointer;
}

.dialogue button {
  padding: 0 18px;
}

.dialogue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.dialogue-actions #dialogue-close {
  background: #d0b98b;
}

.dialogue button:active,
.start-copy button:active,
.touch-controls button:active {
  transform: translateY(1px) scale(0.98);
}

.weapon-shop {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: grid;
  padding: clamp(72px, 9vh, 92px) 18px 22px;
  place-items: center;
  background: rgb(5 15 46 / 72%);
  backdrop-filter: blur(6px);
}

.weapon-shop-sheet {
  position: relative;
  width: min(1180px, 100%);
  max-height: 100%;
  padding: clamp(20px, 3vw, 34px);
  overflow: auto;
  border: 7px solid #f0b34c;
  border-radius: 20px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 0%, rgb(122 171 255 / 38%), transparent 28%),
    linear-gradient(145deg, #4c6ff0, #2f50cf 62%, #2745bd);
  box-shadow:
    inset 0 0 0 3px rgb(255 255 255 / 82%),
    0 28px 90px rgb(0 0 0 / 62%);
}

/* The Starter Island shop intentionally uses the creator-supplied board as
   the complete interface artwork so it appears exactly as designed. */
.weapon-shop-sheet.weapon-shop-sheet-exact {
  width: min(96vw, 120vh, 1240px);
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 14px;
  background: transparent;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

.weapon-shop-exact-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 14px;
}

.weapon-shop.weapon-shop-exact-overlay {
  padding: 10px;
}

.weapon-shop-hotspots {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.shop-hotspot {
  position: absolute;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.shop-hotspot:focus-visible {
  outline: 4px solid #fff4a6;
  outline-offset: 2px;
}

.shop-hotspot-flintlock-stats { left: 4.6%; top: 47.1%; width: 11.6%; height: 5.2%; }
.shop-hotspot-flintlock-buy { left: 16.8%; top: 47.1%; width: 8.4%; height: 5.2%; }
.shop-hotspot-cutlass-stats { left: 36.4%; top: 45.5%; width: 11.8%; height: 5.4%; }
.shop-hotspot-cutlass-buy { left: 49%; top: 45.5%; width: 8.7%; height: 5.4%; }
.shop-hotspot-katana-stats { left: 67.9%; top: 48%; width: 11.8%; height: 5.4%; }
.shop-hotspot-katana-price { left: 80.2%; top: 48%; width: 10.9%; height: 5.4%; }
.shop-hotspot-samurai-bundle { left: 4.5%; top: 87%; width: 23.2%; height: 9%; }

.weapon-shop-stats-scroll {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  width: min(58%, 620px);
  min-height: 52%;
  padding: clamp(28px, 4vw, 54px) clamp(30px, 5vw, 70px);
  transform: translate(-50%, -50%) rotate(-0.5deg);
  border: 8px solid #8e542c;
  border-radius: 30px 12px 28px 14px;
  color: #3b2316;
  background:
    radial-gradient(circle at 18% 22%, rgb(255 255 255 / 42%), transparent 19%),
    repeating-linear-gradient(3deg, rgb(116 66 29 / 7%) 0 2px, transparent 2px 8px),
    #edcb89;
  box-shadow:
    inset 0 0 0 5px #f7e1af,
    inset 0 0 38px rgb(99 49 18 / 28%),
    0 18px 48px rgb(0 0 0 / 58%);
  text-align: center;
}

.weapon-shop-stats-scroll::before,
.weapon-shop-stats-scroll::after {
  content: "";
  position: absolute;
  left: -4%;
  width: 108%;
  height: 13%;
  border: 5px solid #8e542c;
  border-radius: 50%;
  background: linear-gradient(#f7dda7, #c88c4f);
  box-shadow: 0 5px 9px rgb(56 28 12 / 35%);
}

.weapon-shop-stats-scroll::before { top: -7%; }
.weapon-shop-stats-scroll::after { bottom: -7%; }

.weapon-shop-stats-scroll > * {
  position: relative;
  z-index: 1;
}

.weapon-shop-scroll-kicker {
  margin: 0 0 6px;
  color: #9b3429;
  font-size: clamp(14px, 1.8vw, 22px);
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.weapon-shop-stats-scroll h3 {
  margin: 0 0 18px;
  color: #302014;
  font-size: clamp(28px, 4vw, 54px);
  line-height: 1;
}

.weapon-shop-stats-scroll #weapon-shop-stats-copy {
  margin: 0;
  font-size: clamp(17px, 2.1vw, 27px);
  font-weight: 850;
  line-height: 1.5;
  white-space: pre-line;
}

.weapon-shop-stats-close {
  position: absolute;
  top: 9px;
  right: 12px;
  width: 42px;
  height: 42px;
  border: 3px solid #6f3c21;
  border-radius: 50%;
  color: #fff4dc;
  font-size: 27px;
  font-weight: 950;
  line-height: 1;
  background: #a54232;
  cursor: pointer;
}

@media (max-width: 650px) {
  .weapon-shop-stats-scroll {
    width: 78%;
    min-height: 58%;
    padding: 28px 24px;
  }
}

.weapon-shop-sheet-exact .weapon-shop-header,
.weapon-shop-sheet-exact .weapon-shop-grid,
.weapon-shop-sheet-exact .weapon-shop-message {
  display: none;
}

.weapon-shop-sheet-exact .weapon-shop-close {
  top: 1.4%;
  right: 1.4%;
  z-index: 2;
  border: 3px solid #fff;
  background: #e3262e;
  color: #fff;
  box-shadow: 0 3px 0 #8d151b;
}

.weapon-shop-close {
  position: absolute;
  top: 14px;
  right: 16px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 3px solid rgb(255 255 255 / 88%);
  border-radius: 999px;
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  background: #e93434;
  cursor: pointer;
}

.weapon-shop-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0 54px 18px 0;
}

.weapon-shop-kicker {
  margin: 0 0 -5px;
  color: #fff;
  font-size: clamp(17px, 2.2vw, 27px);
  font-weight: 950;
  letter-spacing: 0.04em;
  text-shadow:
    -2px -2px 0 #14204e,
    2px -2px 0 #14204e,
    -2px 2px 0 #14204e,
    2px 2px 0 #14204e;
}

.weapon-shop-header h2 {
  margin: 0;
  color: #e73535;
  font-size: clamp(42px, 7vw, 78px);
  font-weight: 1000;
  letter-spacing: -0.045em;
  line-height: 0.95;
  text-shadow:
    -4px -4px 0 #fff,
    4px -4px 0 #fff,
    -4px 4px 0 #fff,
    4px 4px 0 #fff,
    0 8px 0 rgb(33 50 125 / 32%);
}

.weapon-shop-wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  padding: 10px 15px;
  border: 3px solid rgb(255 255 255 / 84%);
  border-radius: 14px;
  color: #182252;
  background: #f7b84b;
  box-shadow: 0 6px 0 rgb(29 43 108 / 28%);
}

.weapon-shop-wallet span {
  color: #ffd763;
  font-size: 23px;
  text-shadow: 0 2px 0 #9a6519;
}

.weapon-shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 20px);
}

.weapon-shop-card {
  display: grid;
  grid-template-rows: auto minmax(150px, 1fr) auto auto;
  min-width: 0;
  padding: 15px;
  border: 3px solid rgb(255 255 255 / 92%);
  border-radius: 15px;
  color: #111b45;
  background: #8fb9ff;
  box-shadow:
    inset 0 0 0 3px rgb(39 76 185 / 24%),
    0 10px 0 rgb(26 45 123 / 28%);
}

.weapon-shop-card h3 {
  min-height: 2.2em;
  margin: 0 0 6px;
  color: #fff;
  font-size: clamp(20px, 2.2vw, 29px);
  font-weight: 950;
  line-height: 1.05;
  text-align: center;
  text-shadow:
    -2px -2px 0 #15245a,
    2px -2px 0 #15245a,
    -2px 2px 0 #15245a,
    2px 2px 0 #15245a;
}

.weapon-shop-art {
  display: grid;
  min-height: 150px;
  place-items: center;
  border: 3px solid rgb(255 255 255 / 80%);
  border-radius: 12px;
  background:
    radial-gradient(circle at 50% 42%, rgb(255 255 255 / 56%), transparent 58%),
    linear-gradient(160deg, #6d9bea, #3e70ce);
  overflow: hidden;
}

.weapon-shop-art svg {
  width: 100%;
  height: 100%;
  max-height: 175px;
  filter: drop-shadow(0 8px 5px rgb(14 26 73 / 34%));
}

.weapon-svg-blade,
.weapon-svg-steel {
  fill: #dce8ed;
  stroke: #536c7b;
  stroke-width: 5;
  stroke-linejoin: round;
}

.weapon-svg-edge {
  fill: none;
  stroke: #fff;
  stroke-width: 4;
  stroke-linecap: round;
}

.weapon-svg-gold {
  fill: #e7ac38;
  stroke: #76501d;
  stroke-width: 5;
  stroke-linejoin: round;
}

.weapon-svg-handle {
  fill: #39271e;
  stroke: #171219;
  stroke-width: 5;
  stroke-linejoin: round;
}

.weapon-svg-wood {
  fill: #864624;
  stroke: #351d17;
  stroke-width: 6;
  stroke-linejoin: round;
}

.weapon-shop-card > p {
  min-height: 2.8em;
  margin: 10px 0;
  color: #172452;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.3;
  text-align: center;
}

.weapon-shop-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.weapon-shop-card-actions button {
  min-height: 42px;
  border: 3px solid #fff;
  border-radius: 10px;
  color: #fff;
  font-weight: 950;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 5px 0 rgb(24 36 94 / 30%);
}

.weapon-stats-button {
  background: #e93131;
}

.weapon-buy-button {
  background: #f2aa3c;
}

.weapon-buy-button.is-equipped,
.weapon-buy-button:disabled {
  color: #e8efff;
  background: #526c9c;
  cursor: default;
  opacity: 0.78;
}

.weapon-shop-card-actions button:not(:disabled):active,
.weapon-shop-close:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgb(24 36 94 / 30%);
}

.weapon-shop-message {
  min-height: 46px;
  margin: 18px 0 0;
  padding: 11px 16px;
  border: 3px solid rgb(255 255 255 / 82%);
  border-radius: 12px;
  color: #fff;
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
  text-align: center;
  background: rgb(25 47 132 / 78%);
}

@media (max-width: 900px) {
  .weapon-shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .weapon-shop-sheet {
    max-height: calc(100dvh - 88px);
  }
}

@media (max-width: 540px) {
  .weapon-shop {
    padding: 64px 8px 84px;
  }

  .weapon-shop-sheet {
    padding: 18px 12px;
    border-width: 5px;
  }

  .weapon-shop-header {
    display: block;
    padding-right: 48px;
  }

  .weapon-shop-wallet {
    width: max-content;
    margin-bottom: 14px;
  }

  .weapon-shop-grid {
    grid-template-columns: 1fr;
  }
}

.bounty-scroll {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  padding: clamp(76px, 11vh, 110px) 20px 24px;
  place-items: center;
  background: rgb(8 5 4 / 68%);
  backdrop-filter: blur(4px);
}

.bounty-scroll-sheet {
  position: relative;
  width: min(920px, 100%);
  max-height: 100%;
  padding: clamp(28px, 4vw, 48px);
  overflow: auto;
  border: 7px double #6c3b20;
  color: #2b180d;
  background:
    radial-gradient(circle at 18% 20%, rgb(255 249 202 / 50%), transparent 26%),
    repeating-linear-gradient(2deg, transparent 0 18px, rgb(95 51 25 / 5%) 19px 20px),
    #d6b36d;
  box-shadow:
    inset 0 0 55px rgb(74 34 15 / 38%),
    0 30px 90px rgb(0 0 0 / 60%);
  transform-origin: 50% 12%;
  animation: bounty-scroll-unfurl 520ms cubic-bezier(0.2, 0.85, 0.25, 1);
}

.bounty-scroll-sheet::before,
.bounty-scroll-sheet::after {
  position: absolute;
  right: 12px;
  left: 12px;
  height: 13px;
  border: 3px solid #3a2013;
  border-radius: 999px;
  content: "";
  background: #7a492b;
  box-shadow: inset 0 2px 0 rgb(255 222 150 / 22%);
}

.bounty-scroll-sheet::before {
  top: 8px;
}

.bounty-scroll-sheet::after {
  bottom: 8px;
}

.bounty-scroll-kicker {
  margin: 0 0 4px;
  color: #6b351e;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-align: center;
  text-transform: uppercase;
}

.bounty-scroll h2 {
  margin: 0;
  font-family: Georgia, Times New Roman, serif;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.bounty-scroll-message {
  max-width: 58ch;
  margin: 12px auto 22px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}

.bounty-scroll-close {
  position: absolute;
  top: 20px;
  right: 22px;
  z-index: 1;
  width: 40px;
  height: 40px;
  border: 2px solid #3a2013;
  border-radius: 50%;
  color: #f1d28f;
  font-size: 25px;
  line-height: 1;
  background: #63331d;
  cursor: pointer;
}

.bounty-posters {
  display: grid;
  grid-template-columns: repeat(4, minmax(145px, 1fr));
  gap: 18px;
}

.wanted-poster {
  position: relative;
  min-height: 215px;
  padding: 18px 14px 15px;
  border: 2px solid #6a3a22;
  color: #30180d;
  background:
    radial-gradient(circle at 50% 38%, rgb(90 46 24 / 9%) 0 38%, transparent 39%),
    #e4c680;
  box-shadow:
    inset 0 0 22px rgb(93 45 21 / 22%),
    0 9px 15px rgb(67 33 17 / 24%);
  cursor: pointer;
  transform: rotate(-1.4deg);
}

.wanted-poster:nth-child(even) {
  transform: rotate(1.2deg);
}

.wanted-poster:hover:not(:disabled) {
  z-index: 1;
  transform: translateY(-5px) rotate(0);
}

.wanted-poster:disabled {
  filter: grayscale(0.7);
  cursor: not-allowed;
  opacity: 0.62;
}

.wanted-poster strong,
.wanted-poster span,
.wanted-poster small {
  display: block;
}

.wanted-poster strong {
  font-family: Georgia, Times New Roman, serif;
  font-size: 22px;
  text-transform: uppercase;
}

.wanted-poster .wanted-skull {
  margin: 14px 0 10px;
  font-size: 46px;
  line-height: 1;
}

.wanted-poster .wanted-poster-art {
  display: block;
  width: 100%;
  height: 155px;
  margin: 10px auto;
  object-fit: contain;
}

.wanted-poster span {
  font-weight: 800;
}

.wanted-poster small {
  margin-top: 10px;
  color: #60351f;
  font-weight: 750;
}

.wanted-poster.is-reward {
  grid-column: 2 / span 2;
  min-height: 190px;
  border-width: 4px;
}

@keyframes bounty-scroll-unfurl {
  0% {
    opacity: 0;
    transform: scaleX(0.28) scaleY(0.04);
  }

  58% {
    opacity: 1;
    transform: scaleX(0.96) scaleY(1.04);
  }

  100% {
    transform: scale(1);
  }
}

.start-screen {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  background: #0c1921;
  transition:
    opacity 400ms ease,
    visibility 400ms ease;
}

.start-screen.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.start-art {
  min-height: 100dvh;
  background:
    linear-gradient(90deg, transparent 58%, #0c1921 100%),
    url("pirate-painting.png") center / cover;
}

.start-copy {
  align-self: center;
  max-width: 510px;
  padding: 48px clamp(28px, 6vw, 88px) 48px 30px;
}

.kicker {
  margin: 0 0 12px;
  color: #e4ad43;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.start-copy h1 {
  max-width: 10ch;
  margin: 0;
  color: var(--ink);
  font-family: Georgia, Times New Roman, serif;
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 700;
  line-height: 0.94;
  letter-spacing: -0.045em;
}

.start-copy > p:not(.kicker) {
  max-width: 38ch;
  margin: 22px 0;
  color: #c2ced0;
  font-size: 17px;
  line-height: 1.55;
}

.start-copy button {
  display: block;
  width: min(100%, 250px);
  padding: 0 22px;
}

.start-copy small {
  display: block;
  margin-top: 14px;
  color: #8ea2a7;
}

.touch-controls {
  display: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .auth-screen {
    display: block;
  }

  .auth-art {
    position: relative;
    min-height: 190px;
    background:
      linear-gradient(0deg, #0d1c25 0%, transparent 78%),
      url("pirate-painting.png") 44% 30% / cover;
  }

  .auth-art-copy {
    right: 18px;
    bottom: 10px;
    left: 18px;
  }

  .auth-art-copy p,
  .auth-art-copy span {
    display: none;
  }

  .auth-art-copy h1 {
    max-width: none;
    margin: 0;
    font-size: 38px;
  }

  .auth-panel {
    grid-template-columns: 1fr;
    width: calc(100% - 20px);
    margin: 0 auto 20px;
  }

  .auth-form-wrap {
    padding: 22px 16px;
  }

  .auth-form {
    grid-template-columns: 1fr;
  }

  .auth-field,
  .auth-field-wide {
    grid-column: 1;
  }

  .auth-side-action {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 18px 16px;
  }

  .auth-side-action p {
    font-size: 18px;
  }

  .auth-side-action .credits-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .credits-panel {
    padding: 10px;
  }

  .credits-sheet {
    max-height: calc(100dvh - 20px);
    padding: 28px 18px;
  }

  .credits-sheet h2 {
    margin-bottom: 20px;
  }

  .credits-list > div {
    grid-template-columns: 1fr;
    gap: 5px;
    padding: 14px 0;
  }

  .crew-panel {
    padding: 10px;
  }

  .crew-ledger {
    max-height: calc(100dvh - 20px);
    padding: 28px 16px;
  }

  .crew-ledger-form > div,
  .crew-invitation,
  .crew-roster-row {
    grid-template-columns: 1fr;
  }

  .crew-ledger-form button,
  .crew-invite-form button {
    width: 100%;
  }

  .crew-invitation-actions,
  .crew-member-actions {
    justify-content: flex-start;
  }

  .crew-notification {
    top: 146px;
    right: 10px;
  }

  .bounty-scroll {
    padding: 76px 10px 92px;
  }

  .bounty-scroll-sheet {
    padding: 34px 16px 28px;
  }

  .bounty-posters {
    grid-template-columns: repeat(2, minmax(130px, 1fr));
  }

  .wanted-poster.is-reward {
    grid-column: 1 / -1;
  }

  .start-screen {
    display: block;
  }

  .start-art {
    position: absolute;
    inset: 0;
    min-height: 0;
    background:
      linear-gradient(0deg, #0c1921 5%, rgb(12 25 33 / 44%) 65%, rgb(12 25 33 / 12%)),
      url("pirate-painting.png") 42% center / cover;
  }

  .start-copy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    padding: 20px 18px 24px;
    background: linear-gradient(0deg, rgb(12 25 33 / 94%), rgb(12 25 33 / 8%));
  }

  .start-copy h1 {
    font-size: clamp(44px, 13vw, 54px);
    line-height: 0.9;
  }

  .start-copy > p:not(.kicker) {
    max-width: 32ch;
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.4;
  }

  .start-copy small {
    display: none;
  }

  .hud {
    inset: 10px 10px auto;
  }

  .quality-button {
    padding-inline: 7px;
    font-size: 12px;
  }

  .quest {
    max-width: 190px;
  }

  .quest span {
    display: none;
  }

  .touch-controls {
    position: absolute;
    right: 14px;
    bottom: 16px;
    left: 14px;
    display: grid;
    grid-template-columns: repeat(3, 52px) 1fr 62px;
    grid-template-rows: repeat(2, 52px);
    gap: 7px;
    pointer-events: none;
  }

  .touch-controls button {
    border: 1px solid rgb(246 237 218 / 20%);
    border-radius: 12px;
    color: var(--ink);
    background: rgb(13 28 37 / 78%);
    backdrop-filter: blur(8px);
    pointer-events: auto;
    touch-action: none;
  }

  .touch-up {
    grid-column: 2;
  }

  .touch-left {
    grid-column: 1;
    grid-row: 2;
  }

  .touch-down {
    grid-column: 2;
    grid-row: 2;
  }

  .touch-right {
    grid-column: 3;
    grid-row: 2;
  }

  .touch-action {
    grid-column: 5;
    grid-row: 2;
    color: #16140e !important;
    font-weight: 800;
    background: #e4ad43 !important;
  }

  .touch-sail {
    grid-column: 4;
    grid-row: 2;
    color: #16140e !important;
    font-weight: 800;
    background: #64b5c5 !important;
  }

  .interaction-prompt {
    display: none;
  }

  .dialogue {
    bottom: 90px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-panel {
    animation: auth-panel-enter 420ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .credits-sheet {
    animation: credits-sheet-enter 260ms cubic-bezier(0.16, 1, 0.3, 1);
  }

  .crew-ledger {
    animation: crew-ledger-enter 260ms cubic-bezier(0.16, 1, 0.3, 1);
  }
}

@keyframes auth-panel-enter {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes credits-sheet-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes crew-ledger-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .start-screen {
    transition: none;
  }
}
