/* ==========================================================================
   PIRATE: a hand-inked sea chart come alive. See brand/STYLE.md.
   Parchment, sea-green water, ink-brown lines, cream sails, one brick accent.
   ========================================================================== */
:root {
  --page: #efd29c;
  --panel: #f6dcab;
  --edge: #d9b77f;
  --rule: #ad8a5c;
  --ink: #3a2a1c;
  --deep: #2d1607;
  --sea: #3e6f5c;
  --sea-d: #2f5d50;
  --shoal: #658367;
  --cream: #ede6d6;
  --brick: #9e3e24;
  --brick-d: #7e2f1a;
  --head: "Alfa Slab One", "Rockwell", "Roboto Slab", Georgia, serif;
  --body: "Zilla Slab", "Rockwell", Georgia, serif;
  --sh: 3px 3px 0 var(--ink);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); background: var(--page);
  font: 500 16px/1.45 var(--body); font-variant-numeric: tabular-nums;
  background-image:
    radial-gradient(circle at 18% 12%, rgba(255, 240, 200, .45), transparent 40%),
    radial-gradient(circle at 85% 80%, rgba(173, 138, 92, .18), transparent 45%);
  background-attachment: fixed;
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 400; margin: 0; letter-spacing: .01em; color: var(--deep); line-height: 1.05; }
.label { font: 700 12px/1 var(--body); letter-spacing: .2em; text-transform: uppercase; color: var(--ink); }
.fine { font-size: 13px; color: #6a5238; }
.num { font-variant-numeric: tabular-nums; }
.brick { color: var(--brick); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- the chart frame: double ink border with compass corners ---------- */
.sheet { max-width: 1380px; margin: 14px auto; padding: 10px; border: 2px solid var(--ink); position: relative; background: transparent; }
.sheet::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--ink); pointer-events: none; }
.sheet > .corner { position: absolute; width: 34px; height: 34px; color: var(--ink); z-index: 2; background: var(--page); }
.corner.tl { top: -8px; left: -8px; } .corner.tr { top: -8px; right: -8px; }
.corner.bl { bottom: -8px; left: -8px; } .corner.br { bottom: -8px; right: -8px; }
.sheet-in { padding: 6px 22px 18px; }

/* ---------- header ---------- */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; padding: 10px 0 14px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 66px; height: 66px; display: block; }
.brand b { display: block; font: 400 40px/0.95 var(--head); color: var(--deep); letter-spacing: .02em; }
.brand small { display: block; font: 600 14px/1.2 var(--body); color: var(--ink); margin-top: 4px; }
.nav { display: flex; flex-direction: column; align-items: center; }
.nav-links { display: flex; gap: clamp(14px, 3vw, 44px); }
.nav-links a { font: 700 16px/1 var(--body); text-decoration: none; padding: 8px 2px 10px; position: relative; color: var(--deep); }
.nav-links a.on { color: var(--brick); }
.nav-links a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 3px; background: var(--brick); }
.nav-rule { width: min(560px, 100%); height: 10px; position: relative; }
.nav-rule::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; border-top: 1.5px solid var(--ink); }
.nav-rule i { position: absolute; top: 0; width: 9px; height: 9px; background: var(--ink); transform: rotate(45deg); }
.nav-rule i:nth-child(1) { left: -4px; } .nav-rule i:nth-child(2) { left: calc(50% - 4px); } .nav-rule i:nth-child(3) { right: -4px; }
.acts { display: flex; align-items: center; gap: 10px; }
.ico { width: 40px; height: 40px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 4px; background: var(--panel); color: var(--deep); text-decoration: none; box-shadow: 2px 2px 0 var(--ink); }
.ico svg { width: 16px; height: 16px; }
.ico img { width: 20px; height: 20px; }
.ca { font: 700 13px/1 var(--body); padding: 10px 12px; border: 1.5px dashed var(--ink); border-radius: 4px; text-decoration: none; white-space: nowrap; }

/* ---------- buttons ---------- */
.btn, .seal { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 20px; border: 2px solid var(--ink); border-radius: 4px;
  background: var(--brick); color: var(--cream); font: 400 17px/1 var(--head); letter-spacing: .02em; text-decoration: none; cursor: pointer; box-shadow: var(--sh); transition: transform .08s, box-shadow .08s; }
.btn:hover, .seal:hover { background: var(--brick-d); }
.btn:active, .seal:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.ghost, .btn2 { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 12px 20px; border: 2px solid var(--ink); border-radius: 4px; background: var(--panel); color: var(--deep);
  font: 400 17px/1 var(--head); text-decoration: none; cursor: pointer; box-shadow: var(--sh); }
.btn.ghost:hover, .btn2:hover { background: #fbe6bd; }
.btn.sm, .seal.sm, .btn2.sm { padding: 9px 14px; font-size: 14px; }
.seal.wide, .btn.wide { width: 100%; }
.btn svg, .btn2 svg { width: 20px; height: 20px; }
.btn[disabled], .seal[disabled], .btn2[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.connect.on { background: var(--sea-d); }

/* ---------- panels (logbook pages) ---------- */
.panel, .frame { background: var(--panel); border: 2px solid var(--ink); border-radius: 4px; box-shadow: var(--sh); position: relative; }
.panel::before, .frame::before { content: ""; position: absolute; inset: 4px; border: 1px solid var(--rule); border-radius: 2px; pointer-events: none; }
.panel > .in, .frame > .in { position: relative; padding: 18px 20px; }
.ph { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ph h2, .ph h3 { font-size: 24px; }
.ph .rose { width: 26px; height: 26px; flex: none; }
.ph .more { margin-left: auto; font: 700 13px var(--body); text-decoration: underline; }

.demo-note { margin: 0 0 12px; padding: 8px 14px; border: 1.5px dashed var(--brick); border-radius: 4px; color: var(--brick); font-weight: 700; text-align: center; background: rgba(158, 62, 36, .06); }
.view { animation: rise .25s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- home: hero ---------- */
.hero { display: grid; grid-template-columns: minmax(300px, 4fr) 7fr; gap: 0; padding: 0; overflow: hidden; }
.hero-l { padding: 30px 30px 26px; position: relative; z-index: 1; }
.hero-l h1 { font-size: clamp(40px, 4.6vw, 64px); margin: 12px 0 12px; }
.hero-l .sub { font: 600 20px/1.3 var(--body); margin: 0 0 22px; color: var(--deep); }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.logbook { border: 2px solid var(--ink); border-radius: 4px; background: #f9e5bd; padding: 12px 16px 6px; position: relative; }
.logbook h3 { font-size: 20px; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.logbook h3 svg { width: 22px; height: 22px; }
.logbook .row { display: flex; align-items: baseline; gap: 10px; padding: 8px 0; border-top: 1px solid var(--rule); font-weight: 600; }
.logbook .row svg { width: 18px; height: 18px; flex: none; align-self: center; }
.logbook .row b { margin-left: auto; font: 400 22px/1 var(--head); color: var(--deep); }
.hero-sea { position: relative; min-height: 440px; background: var(--sea-d); border-left: 2px solid var(--ink); }
.hero-sea canvas, .hero-sea svg.chart2d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero-sea .rose-big { position: absolute; top: 14px; right: 16px; width: 92px; height: 92px; color: var(--cream); pointer-events: none; z-index: 2; }
.hero-sea .hint { position: absolute; left: 12px; bottom: 10px; z-index: 2; font: 700 12px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--cream); background: rgba(45, 22, 7, .55); padding: 6px 10px; border-radius: 3px; text-decoration: none; }

/* ---------- home: chart + log row ---------- */
.row2 { display: grid; grid-template-columns: 7fr 5fr; gap: 22px; margin-top: 22px; }
.chart-wrap { border: 2px solid var(--ink); border-radius: 3px; overflow: hidden; background: var(--sea); }
.chart-wrap svg { display: block; width: 100%; height: auto; }
.chart-legend { display: flex; gap: 18px; margin-top: 10px; font: 600 13px var(--body); flex-wrap: wrap; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 12px; height: 12px; border: 1.5px solid var(--ink); display: inline-block; }
.shiplog { list-style: none; margin: 0; padding: 0; }
.shiplog li { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 9px 2px; border-top: 1px solid var(--rule); font-weight: 600; }
.shiplog li:first-child { border-top: 2px solid var(--ink); }
.shiplog li svg { width: 22px; height: 22px; color: var(--deep); }
.shiplog li b { color: var(--deep); }
.shiplog li a { text-decoration: none; }
.shiplog li .t { font: 600 13px var(--body); color: #6a5238; white-space: nowrap; }
.shiplog li.empty { display: block; }
.shiplog .new { animation: inked 1.6s ease-out; }
@keyframes inked { from { background: rgba(158, 62, 36, .18); } to { background: transparent; } }
.empty { text-align: center; padding: 28px 16px; color: #6a5238; font-weight: 600; }
.empty b { display: block; font: 400 22px var(--head); color: var(--deep); margin-bottom: 6px; }

/* ---------- home: wanted wall ---------- */
.wall { display: grid; grid-template-columns: minmax(300px, min-content) minmax(0, 1fr); gap: 34px; margin-top: 22px; align-items: start; }
.wall-l h2 { font-size: clamp(44px, 4vw, 58px); line-height: .9; letter-spacing: .01em; text-transform: uppercase; white-space: nowrap; }
.wall-l p { font-weight: 600; margin: 10px 0 16px; }
.search { display: flex; align-items: center; gap: 8px; border: 2px solid var(--ink); border-radius: 4px; background: #f9e5bd; padding: 0 12px; box-shadow: 2px 2px 0 var(--ink); }
.search svg { width: 18px; height: 18px; flex: none; }
.search input { border: 0; background: transparent; padding: 12px 0; width: 100%; outline: none; font-weight: 600; }
.search input::placeholder { color: #8a6e4c; }
.tabs { display: flex; gap: 0; margin-top: 16px; border-bottom: 1.5px solid var(--ink); }
.tabs button { flex: 1; background: none; border: 0; padding: 10px 4px; font: 700 15px var(--body); cursor: pointer; color: var(--deep); position: relative; }
.tabs button.on { color: var(--brick); }
.tabs button.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -2px; height: 4px; background: var(--brick); }
.posters { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 26px 20px; padding: 8px 6px 10px; }
.poster { display: block; text-decoration: none; background: #f7e1b4; border: 2px solid var(--ink); padding: 12px 12px 14px; text-align: center; box-shadow: 3px 4px 0 rgba(58, 42, 28, .85); position: relative; transition: transform .15s; }
.poster::before { content: ""; position: absolute; inset: 5px; border: 1px solid var(--rule); pointer-events: none; }
.poster::after { content: ""; position: absolute; top: -7px; left: calc(50% - 6px); width: 12px; height: 12px; border-radius: 50%; background: var(--brick); border: 2px solid var(--ink); }
.poster:nth-child(5n+1) { transform: rotate(-2.2deg); } .poster:nth-child(5n+2) { transform: rotate(1.6deg); }
.poster:nth-child(5n+3) { transform: rotate(-.8deg); } .poster:nth-child(5n+4) { transform: rotate(2.4deg); } .poster:nth-child(5n) { transform: rotate(-1.5deg); }
.poster:hover { transform: rotate(0) translateY(-3px); }
.poster .w { font: 400 30px/1 var(--head); letter-spacing: .06em; color: var(--deep); }
.poster .sk { height: 104px; margin: 8px 0 6px; border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); display: grid; place-items: center; }
.poster .sk svg { width: 100%; height: 96px; }
.poster .tk { font: 400 24px/1.1 var(--head); color: var(--brick); word-break: break-all; }
.poster .rg { font: 700 14px var(--body); letter-spacing: .18em; text-transform: uppercase; }
.poster .pl { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--rule); font: 700 12px var(--body); letter-spacing: .16em; }
.poster .pl b { display: block; font: 400 22px/1.1 var(--head); letter-spacing: 0; color: var(--deep); }
.poster .ex { position: absolute; top: 8px; right: 8px; font: 700 9px var(--body); letter-spacing: .14em; color: var(--brick); border: 1px solid var(--brick); padding: 2px 4px; }
.poster .pre { font: 700 11px var(--body); letter-spacing: .14em; color: var(--brick); }
.more-row { text-align: center; margin-top: 12px; }

/* ---------- foot ---------- */
.foot { display: flex; justify-content: space-between; gap: 18px; flex-wrap: wrap; margin-top: 26px; padding-top: 14px; border-top: 1.5px solid var(--ink); font: 600 13px var(--body); color: #6a5238; }
.foot a { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; color: var(--deep); }
.foot a svg, .foot a img { width: 14px; height: 14px; }

/* ---------- shipyard (a crew's page) ---------- */
.yard-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; margin-bottom: 18px; }
.yard-head .flag { width: 74px; height: 50px; border: 2px solid var(--ink); display: block; }
.yard-head h1 { font-size: clamp(32px, 4vw, 52px); }
.yard-head h1 .tk { color: var(--brick); }
.yard-head .meta { font-weight: 600; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.yard-head .links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.yard { display: grid; grid-template-columns: 7fr 5fr; gap: 22px; align-items: start; }
.berth { position: relative; height: 520px; background: var(--sea-d); border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; box-shadow: var(--sh); }
.berth canvas, .berth svg.chart2d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.berth .tag { position: absolute; left: 12px; top: 12px; z-index: 2; background: var(--panel); border: 2px solid var(--ink); border-radius: 4px; padding: 8px 12px; }
.berth .tag b { font: 400 20px var(--head); color: var(--deep); display: block; }
.berth .tag span { font: 700 12px var(--body); letter-spacing: .16em; text-transform: uppercase; }
.berth .rose-big { position: absolute; right: 14px; top: 14px; width: 74px; height: 74px; color: var(--cream); pointer-events: none; z-index: 2; }
.ladder { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; margin-top: 14px; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--panel); }
.ladder div { padding: 10px 8px; text-align: center; border-left: 1px solid var(--rule); font-weight: 600; font-size: 13px; }
.ladder div:first-child { border-left: 0; }
.ladder div b { display: block; font: 400 16px var(--head); color: var(--deep); }
.ladder div.on { background: var(--brick); color: var(--cream); }
.ladder div.on b { color: var(--cream); }
.ladder div.done { background: #ecd09a; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; }
.stats div { padding: 10px; text-align: center; border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); }
.stats div:nth-child(3n+1) { border-left: 0; }
.stats div:nth-child(-n+3) { border-top: 0; }
.stats div b { display: block; font: 400 24px/1.1 var(--head); color: var(--deep); }
.stats div span { font: 700 11px var(--body); letter-spacing: .16em; text-transform: uppercase; }
.parts { display: grid; gap: 12px; }
.slot h4 { font: 700 12px var(--body); letter-spacing: .2em; text-transform: uppercase; margin-bottom: 6px; display: flex; gap: 8px; }
.slot h4 em { font-style: normal; color: var(--brick); margin-left: auto; letter-spacing: .06em; text-transform: none; font-size: 13px; }
.slot .opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.opt { border: 1.5px solid var(--ink); border-radius: 4px; background: #f9e5bd; padding: 8px 6px; font: 700 13px/1.15 var(--body); cursor: pointer; text-align: center; min-height: 52px; }
.opt small { display: block; font: 600 11px var(--body); color: #6a5238; margin-top: 3px; }
.opt.on { background: var(--brick); color: var(--cream); border-color: var(--ink); }
.opt.on small { color: var(--cream); }
.opt.sel { outline: 3px solid var(--brick); outline-offset: 1px; }
.opt.locked { opacity: .5; cursor: not-allowed; }
.fit-bar { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.fit-bar .status { flex: 1; min-width: 160px; }
.status { font-weight: 700; font-size: 14px; min-height: 20px; }
.status.err { color: var(--brick); }
.status.ok { color: var(--sea-d); }
.note { font: 600 13px var(--body); padding: 8px 12px; border-left: 4px solid var(--brick); background: rgba(158, 62, 36, .06); margin: 10px 0 0; }
.foes { display: grid; gap: 8px; }
.foe { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1.5px solid var(--ink); border-radius: 4px; background: #f9e5bd; }
.foe svg { width: 34px; height: 24px; border: 1px solid var(--ink); }
.foe b { font: 400 17px var(--head); color: var(--deep); }
.foe span { font: 600 12px var(--body); display: block; }
.battle-log { margin: 12px 0 0; padding: 12px 14px 12px 34px; border: 2px solid var(--ink); border-radius: 4px; background: #fbe9c6; font: 600 14px/1.5 var(--body); counter-reset: l; list-style: none; }
.battle-log li { counter-increment: l; position: relative; padding: 2px 0; border-bottom: 1px dotted var(--rule); }
.battle-log li::before { content: counter(l) "."; position: absolute; left: -22px; font: 400 13px var(--head); color: var(--brick); }
.battle-log li.end { font: 400 17px var(--head); color: var(--brick); border-bottom: 0; }
.isles { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.isle { display: flex; justify-content: space-between; gap: 6px; padding: 7px 10px; border: 1.5px solid var(--ink); border-radius: 4px; background: #f9e5bd; font: 700 13px var(--body); }
.isle.held { background: var(--brick); color: var(--cream); }
.isle.taken { opacity: .72; }
.stack { display: grid; gap: 22px; }

/* ---------- open sea (full screen) ---------- */
.view-sea .foot { display: none; }
.seaview { position: relative; height: calc(100vh - 150px); min-height: 520px; background: var(--sea-d); border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; box-shadow: var(--sh); }
.seaview canvas, .seaview svg.chart2d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; outline: none; }
.hud { position: absolute; z-index: 3; background: var(--panel); border: 2px solid var(--ink); border-radius: 4px; box-shadow: var(--sh); }
.hud::before { content: ""; position: absolute; inset: 3px; border: 1px solid var(--rule); pointer-events: none; border-radius: 2px; }
.hud.helm { left: 14px; top: 14px; width: 290px; padding: 14px 16px; }
.hud.helm h3 { font-size: 20px; margin-bottom: 6px; }
.hud.helm select { width: 100%; padding: 8px; border: 1.5px solid var(--ink); border-radius: 4px; background: #f9e5bd; font-weight: 700; margin: 6px 0 8px; }
.hud.helm .keys { font: 600 12px var(--body); color: #6a5238; margin-top: 8px; }
.hud.helm kbd { font: 700 11px var(--body); border: 1.5px solid var(--ink); border-radius: 3px; padding: 1px 5px; background: #f9e5bd; }
.hud.near { left: 50%; bottom: 18px; transform: translateX(-50%); padding: 12px 16px; display: flex; gap: 12px; align-items: center; max-width: calc(100% - 28px); }
.hud.near[hidden] { display: none; }
.hud.near b { font: 400 18px var(--head); color: var(--deep); }
.hud.log { right: 14px; top: 14px; width: 290px; padding: 12px 14px; max-height: calc(100% - 28px); overflow: auto; }
.hud.log h3 { font-size: 18px; margin-bottom: 6px; }
.hud.log .shiplog li { grid-template-columns: 20px 1fr auto; font-size: 13px; padding: 6px 0; }
.hud.log .shiplog li svg { width: 18px; height: 18px; }
.hud.chartmini { right: 14px; bottom: 14px; width: 190px; padding: 6px; }
.hud.chartmini svg { display: block; width: 100%; height: auto; }
.sea-label { position: absolute; z-index: 2; pointer-events: none; transform: translate(-50%, -100%); font: 700 11px var(--body); letter-spacing: .08em; color: var(--deep); background: var(--cream); border: 1.5px solid var(--ink); padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.sea-label.isle { background: var(--panel); }
.sea-label.held { background: var(--brick); color: var(--cream); }
.sea-label.me { background: var(--brick); color: var(--cream); }

/* ---------- found a crew (launch) ---------- */
.page { max-width: 1180px; margin: 0 auto; }
.found-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; margin-bottom: 18px; }
.found-head h1 { font-size: clamp(36px, 4.4vw, 58px); }
.lede, .lead { font: 600 18px/1.45 var(--body); margin: 8px 0 0; max-width: 760px; }
.two-col { display: grid; grid-template-columns: 7fr 5fr; gap: 22px; align-items: start; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field > span, .field > label { font: 700 12px var(--body); letter-spacing: .2em; text-transform: uppercase; }
.field input, .field textarea, .field select { width: 100%; padding: 11px 12px; border: 2px solid var(--ink); border-radius: 4px; background: #f9e5bd; font-weight: 600; outline: none; }
.field input:focus, .field textarea:focus { border-color: var(--brick); box-shadow: 0 0 0 2px rgba(158, 62, 36, .25); }
.field textarea { min-height: 90px; resize: vertical; }
.field.narrow { max-width: 240px; }
.drop { display: grid; grid-template-columns: 74px 1fr; gap: 12px; align-items: center; border: 2px dashed var(--ink); border-radius: 4px; padding: 10px; background: #f9e5bd; cursor: pointer; }
.drop .th { width: 74px; height: 74px; border: 1.5px solid var(--ink); border-radius: 4px; display: grid; place-items: center; overflow: hidden; background: var(--panel); }
.drop .th img { width: 100%; height: 100%; object-fit: cover; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1.5px solid var(--ink); border-radius: 4px; background: #f9e5bd; padding: 7px 12px; font: 700 13px var(--body); cursor: pointer; }
.chip.on { background: var(--brick); color: var(--cream); }
.deed { position: sticky; top: 14px; }
.deed-art { background: var(--sea-d); border: 2px solid var(--ink); border-radius: 4px; padding: 10px; margin-bottom: 12px; text-align: center; }
.deed-art svg { width: 100%; height: 190px; display: block; }
.deed .sh { font: 400 26px var(--head); color: var(--deep); text-align: center; }
.deed .tk { font: 400 20px var(--head); color: var(--brick); text-align: center; margin-bottom: 8px; }
.deed .cost { text-align: center; margin: 10px 0; }
.step { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; padding: 8px 0; border-top: 1px solid var(--rule); font-weight: 600; }
.num-r { width: 26px; height: 26px; border: 2px solid var(--ink); border-radius: 50%; display: grid; place-items: center; font: 400 13px var(--head); background: var(--panel); }
.lnk { font-weight: 700; color: var(--brick); }

/* ---------- articles ---------- */
.charter { max-width: 900px; margin: 0 auto; }
.charter .in { padding: 30px 38px; }
.charter h1 { font-size: clamp(36px, 4.4vw, 54px); margin-bottom: 10px; }
.charter h2 { font-size: 24px; margin: 22px 0 8px; }
.dropcap { float: left; font: 400 64px/.8 var(--head); color: var(--brick); margin: 6px 10px 0 0; }
.roll, .rules { padding-left: 22px; font-weight: 600; }
.roll li, .rules li { margin: 6px 0; }
.charter table { width: 100%; border-collapse: collapse; margin: 10px 0; font-weight: 600; }
.charter th, .charter td { border: 1.5px solid var(--ink); padding: 8px 10px; text-align: left; }
.charter th { background: #ecd09a; font: 700 12px var(--body); letter-spacing: .16em; text-transform: uppercase; }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: grid; gap: 8px; }
.toast { background: var(--deep); color: var(--cream); padding: 11px 16px; border-radius: 4px; border: 2px solid var(--ink); box-shadow: var(--sh); font-weight: 700; max-width: 360px; transition: opacity .4s, transform .4s; }
.toast.err { background: var(--brick); }
.toast.ok { background: var(--sea-d); }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- coin tiles ---------- */
.coin { width: 40px; height: 40px; border-radius: 50%; border: 2px solid var(--ink); object-fit: cover; }
.coin.tile { display: inline-grid; place-items: center; background: var(--brick); color: var(--cream); font: 400 12px var(--head); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .hero { grid-template-columns: 1fr; }
  .hero-sea { border-left: 0; border-top: 2px solid var(--ink); min-height: 360px; }
  .row2, .yard, .two-col { grid-template-columns: 1fr; }
  .wall { grid-template-columns: 1fr; }
  .deed { position: static; }
}
@media (max-width: 760px) {
  .sheet { margin: 6px; padding: 6px; }
  .sheet-in { padding: 4px 8px 12px; }
  .sheet > .corner { display: none; }
  .top { grid-template-columns: 1fr auto; gap: 10px; }
  .brand { min-width: 0; gap: 8px; }
  .brand img { width: 40px; height: 40px; }
  .brand b { font-size: 26px; }
  .brand small { font-size: 11px; }
  .acts .btn { padding: 8px 12px; font-size: 15px; white-space: nowrap; }
  .nav { grid-column: 1 / -1; grid-row: 2; }
  .nav-links { gap: 14px; flex-wrap: wrap; justify-content: center; }
  .nav-links a { font-size: 14px; }
  .acts .ico { display: none; }
  .acts .ca { display: none; }
  .hero-l { padding: 22px 18px; }
  .hero-sea { min-height: 300px; }
  .posters { grid-template-columns: repeat(2, 1fr); gap: 18px 12px; }
  .slot .opts { grid-template-columns: repeat(2, 1fr); }
  .yard-head { grid-template-columns: auto 1fr; }
  .yard-head .links { grid-column: 1 / -1; justify-content: flex-start; }
  .berth { height: 360px; }
  .two { grid-template-columns: 1fr; }
  .found-head { grid-template-columns: 1fr; }
  .seaview { height: calc(100vh - 170px); }
  .hud.helm { width: auto; right: 14px; padding: 10px 12px; }
  .hud.log, .hud.chartmini { display: none; }
  .isles { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
