@import './town-games.css';
@import './charter-board.css';

.harbor-entry {
  position: absolute;
  z-index: 1;
  inset: auto auto max(55px, env(safe-area-inset-bottom) + 48px) 50%;
  translate: -50% 0;
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 11px;
  border: 1px solid rgba(230, 246, 240, .42);
  border-radius: 999px;
  color: #fafcfa;
  background: rgba(21, 33, 39, .83);
  backdrop-filter: blur(7px);
  white-space: nowrap;
  touch-action: manipulation;
  cursor: pointer;
  font: 650 12px/1.3 system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

.harbor-entry[hidden], .harbor-market [hidden] { display: none; }
.harbor-entry svg { color: #c8e3d7; flex: none; }

.harbor-entry kbd {
  margin-inline-start: 1px;
  border: 1px solid #f0f9f249;
  border-radius: 4px;
  color: #d8e4df;
  padding: 1px 4px;
  font: 600 10px/1.2 system-ui, sans-serif;
}

.harbor-market {
  width: min(440px, calc(100% - 28px));
  max-height: calc(100dvh - max(24px, env(safe-area-inset-top) + env(safe-area-inset-bottom) + 18px));
  padding: 20px;
  border: 1px solid #b2d7ca66;
  border-radius: 15px;
  color: #f6faf7;
  background: #202f33;
  box-shadow: 0 14px 50px #1024297e;
  font: 500 14px/1.42 system-ui, -apple-system, "PingFang SC", sans-serif;
  overflow: auto;
  overscroll-behavior: contain;
}

.harbor-market[open] {
  display: grid;
  gap: 11px;
}

.harbor-market::backdrop {
  background: #07151962;
  backdrop-filter: blur(3px);
}

.market-header, .market-checkout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.market-overline {
  margin: 0 0 3px;
  color: #c2dacd;
  font-size: 11px;
  letter-spacing: .08em;
}

.market-header h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 680;
  letter-spacing: .025em;
}

.market-close, .market-tabs button, .market-item, .market-stepper button,
.market-confirm, .market-load button {
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.market-close {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  place-items: center;
  border: 1px solid #e2f6ec38;
  border-radius: 999px;
  color: #d9eee4;
  background: #152625;
}

.market-account {
  display: grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 8px;
}

.market-account div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #e2f6ec20;
  border-radius: 8px;
  background: #182727;
}

.market-account span { color: #b7c9c1; font-size: 11px; }
.market-account strong { color: #f8eed2; font-size: 17px; font-weight: 690; font-variant-numeric: tabular-nums; }

.market-tabs {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  border-bottom: 1px solid #d1eadd30;
}

.market-tabs button {
  min-height: 36px;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 5px;
  color: #cadaD1;
  background: transparent;
}

.market-tabs button[aria-pressed="true"] {
  color: #f0f9f2;
  border-bottom-color: #c2dbc8;
  background: #abcdb010;
}

.market-goods {
  display: grid;
  align-content: start;
  gap: 6px;
  max-height: min(34dvh, 280px);
  min-height: 44px;
  overflow-y: auto;
  scrollbar-width: thin;
  overscroll-behavior: contain;
}

.market-goods h3 {
  margin: 2px 0 0;
  color: #bad3c5;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .055em;
}

.market-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 49px;
  padding: 6px 10px;
  border: 1px solid #dbead323;
  border-radius: 7px;
  background: #283a3a;
  text-align: start;
}

.market-item[aria-pressed="true"] { border-color: #b2d5bc99; background: #36504a; }
.market-item-details { display: grid; min-width: 0; gap: 1px; overflow-wrap: anywhere; }
.market-item-details strong { font-size: 14px; font-weight: 650; }
.market-item-details span { color: #c2d3ca; font-size: 11px; }
.market-item-price { flex: none; color: #f1e6c9; font-size: 12px; font-variant-numeric: tabular-nums; }
.market-empty, .market-load p { margin: 0; padding: 6px 0; color: #c8d8d0; font-size: 13px; }
.market-load button { padding: 5px 10px; border: 1px solid #c0dfcf66; border-radius: 6px; background: #36504a; }
.market-pending button { min-height: 42px; }

.market-checkout { display: grid; gap: 6px; margin: 0; }

.market-stepper {
  display: grid;
  grid-template-columns: 38px 44px 38px;
  min-height: 42px;
  overflow: hidden;
  border: 1px solid #d8ece345;
  border-radius: 7px;
  background: #162726;
}

.market-stepper button {
  border: 0;
  background: transparent;
  padding: 4px 0;
  font-size: 17px;
}

.market-stepper input {
  width: 100%;
  padding: 0 1px;
  border: 1px solid #d8ece325;
  border-block: 0;
  border-radius: 0;
  appearance: textfield;
  background: #20322f;
  color: #fafcf7;
  font: 600 16px/1.3 system-ui, sans-serif;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

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

.market-confirm {
  flex: 1 1 auto;
  min-height: 43px;
  padding: 6px 9px;
  border: 1px solid #def3e570;
  border-radius: 7px;
  background: #daeade;
  color: #192e29;
  font-weight: 720;
}

.harbor-market button:disabled { cursor: default; opacity: .49; }
.market-constraint, .market-feedback { margin: 0; font-size: 12px; overflow-wrap: anywhere; }
.market-constraint { color: #ffd1b5; }
.market-feedback { color: #e2eedf; }

.harbor-entry:focus-visible, .harbor-market :is(button,input):focus-visible {
  outline: 2px solid #d5edda;
  outline-offset: 2px;
}
.market-item:focus-visible, .market-stepper :focus-visible { outline-offset: -3px; }

@media (pointer: coarse) {
  .harbor-entry { min-height: 43px; }
  .harbor-entry kbd { display: none; }
}

@media (max-width: 480px), (max-height: 520px) {
  .harbor-market { padding: 14px; }
  .harbor-market[open] { gap: 8px; }
  .market-header h2 { font-size: 19px; }
  .market-account div { padding-block: 6px; }
}

.harbor-market {border:4px solid #1c3b3e;outline:1px solid #b49a6a;border-radius:2px;background:#e9dfc6;color:#26413b;color-scheme:light;box-shadow:inset 0 0 0 1px #aa9366,0 14px 50px #10242988}
.market-header {padding-bottom:8px;border-bottom:3px double #a18c66}
.market-overline {color:#705237}
.market-header h2 {font-family:"Songti SC","Noto Serif CJK SC",Georgia,serif;font-size:26px}
.market-close {border-radius:2px;border-color:#a39978;color:#2f4d43;background:transparent}
.market-account div {border-radius:2px;border-color:#ac9a7399;background:#223e40}
.market-account span {color:#d5cfb5}
.market-tabs {border-color:#a7946b}
.market-tabs button {color:#51594f}
.market-tabs button[aria-pressed=true] {background:transparent;color:#693f29;border-color:#8f5336}
.market-goods h3 {color:#695138}
.market-item {border-radius:1px;border-color:#b4a584;background:#f2e8d0}
.market-item[aria-pressed=true] {border-color:#776947;background:#d9cba8;box-shadow:inset 3px 0 #966640}
.market-item-details span,.market-empty,.market-load p,.market-feedback {color:#4a584e}
.market-item-price {color:#6b4e2b}
.market-stepper,.market-load button {border-radius:2px;background:#ded1b1;border-color:#a29470}
.market-stepper input {color:#284339;border-color:#b4a57e;background:#f2e8ce}
.market-confirm {border-radius:2px;border-color:#8b7954;background:#274847;color:#f4e5c5}
.market-constraint {color:#813c27}
.harbor-market :is(button,input):focus-visible {outline-color:#9f5833}
.fish-bulletin {border-block:1px solid #a98f63;color:#393d2d}
.fish-bulletin summary {padding:8px 2px;cursor:pointer;color:#664c2c}
.fish-bulletin summary strong {font-family:"Songti SC",Georgia,serif}
.fish-bulletin summary span {margin-inline-start:10px;font-size:12px}
.fish-bulletin-body {display:grid;grid-template-columns:minmax(68px,29%) 1fr;align-items:center;gap:12px;padding:6px 3px 12px}
.fish-bulletin-print {aspect-ratio:1.5;background-image:url('./assets/fish-specimens.jpg');background-size:1000% 1000%;mix-blend-mode:multiply}
.fish-bulletin-body b {font-size:13px}
.fish-bulletin-body p {margin:4px 0 7px;font-size:12px;color:#515747}
.fish-bulletin-body button {min-height:34px;background:#294b46;color:#fff1d2;border:1px solid #957d53;border-radius:2px;padding:5px 14px;cursor:pointer}
@media(pointer:coarse){.fish-bulletin summary,.fish-bulletin-body button{min-height:44px}}
