/* ============================================================
   Captain's Ledger — The Ketterel Sea
   Night-sea chrome, brass fittings, parchment pages.
   ============================================================ */
:root {
  --ink: #060c11; --night: #0a1620; --deep: #0e2230; --sea: #123446; --teal: #1d5260; --foam: #bfe3df;
  --brass: #c79a43; --brass-d: #8b6a28; --gold: #f1d17c; --gold-d: #d6a94a;
  --parch: #ecddb7; --parch-2: #dcc795; --parch-3: #c8b078; --paper-ink: #2b1d0f; --paper-mute: #6d5a3a;
  --text: #e9e0c9; --mute: #9fb0b2; --blood: #a8362b; --blood-h: #d4584a;
  --good: #79bd86; --warn: #e3b64c; --bad: #e0624f; --violet: #a98be8;
  --f-title: "Pirata One", "IM Fell English", serif; --f-body: "IM Fell English", Georgia, "Times New Roman", serif; --f-ui: "Cinzel", Georgia, serif;
  --r: 14px; --shadow: 0 10px 30px rgba(0, 0, 0, .45);
  --paper: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .25  0 0 0 0 .1  0 0 0 .22 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
* { box-sizing: border-box; }
html { background: #07121a; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--text); font: 18px/1.5 var(--f-body); min-height: 100vh;
  background:
    radial-gradient(1200px 600px at 78% -8%, rgba(120, 170, 190, .18), transparent 60%),
    radial-gradient(900px 500px at 8% 110%, rgba(199, 154, 67, .08), transparent 60%),
    linear-gradient(180deg, #08131c 0%, #0a1a26 40%, #07121a 100%);
  background-attachment: fixed;
}
body::before { content: ""; position: fixed; inset: 0; background: var(--paper); opacity: .35; mix-blend-mode: soft-light; pointer-events: none; z-index: 0; }
#app, #layer, #toasts { position: relative; z-index: 1; }
a { color: var(--gold); text-decoration: none; }
a:hover { color: #fff3c9; }
h1, h2, h3, h4 { font-family: var(--f-title); font-weight: 400; letter-spacing: .02em; margin: 0; line-height: 1.1; }
p { margin: 0 0 .6em; }
small, .muted { color: var(--mute); }
.cx-card .muted, .member .muted, .log-entry .muted, .adv .muted, .parchment .muted, .parchment small, .modal-card .muted, .modal-card small, .cx-card small { color: var(--paper-mute); }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ico { flex: none; vertical-align: middle; }
.pre { white-space: pre-wrap; }
::selection { background: var(--brass); color: #000; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; } }

/* ---------- buttons & form controls ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .45em; padding: .55em 1.05em; border-radius: 999px; border: 1px solid var(--brass-d);
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(0, 0, 0, .2)), #14242e; color: var(--gold); font-family: var(--f-ui); font-weight: 600; font-size: .78rem;
  letter-spacing: .08em; text-transform: uppercase; transition: transform .12s, box-shadow .2s, background .2s; white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .4), 0 0 0 1px var(--brass) inset; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(180deg, #f6dd92, #c99a3e 60%, #a67a28); color: #261806; border-color: #f6dd92; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary:hover { box-shadow: 0 6px 18px rgba(214, 169, 74, .45); }
.btn.ghost { background: transparent; }
.btn.danger { background: linear-gradient(180deg, #c4493c, #8c241b); color: #ffe9e2; border-color: #e0786b; }
.btn.sm { padding: .35em .8em; font-size: .68rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.field { display: grid; gap: .3em; font-size: .95rem; }
.field > span { font-family: var(--f-ui); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-d); }
.field small { font-size: .8rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--text); background: rgba(3, 10, 15, .6); border: 1px solid rgba(199, 154, 67, .35); border-radius: 10px; padding: .55em .75em;
}
input[type=color] { padding: 2px; height: 2.4em; }
input[type=checkbox] { width: auto; accent-color: var(--brass); }
input:focus, select:focus, textarea:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(241, 209, 124, .18); }
textarea { resize: vertical; }
.modal-card input, .modal-card select, .modal-card textarea { background: rgba(255, 250, 235, .7); color: var(--paper-ink); border-color: rgba(90, 64, 24, .4); }
.modal-card .field > span { color: #7a5a1c; }
.form { display: grid; gap: .85rem; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.row { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.check { display: inline-flex; gap: .4em; align-items: center; font-size: .95rem; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .9rem 1rem; }
.grid-form .cell.wide { grid-column: 1 / -1; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
.actions.sticky { position: sticky; bottom: 0; padding: .8rem; background: linear-gradient(0deg, var(--ink) 40%, transparent); z-index: 5; }
.search { max-width: 460px; margin-bottom: 1rem; }
.hint, .dm-banner { color: var(--mute); font-size: .95rem; display: flex; gap: .4em; align-items: center; margin: 1rem 0; }
.dm-banner { background: linear-gradient(90deg, rgba(199, 154, 67, .18), transparent); border-left: 3px solid var(--brass); padding: .7em 1em; border-radius: 0 10px 10px 0; color: var(--text); margin-top: 0; }

/* ---------- top bar ---------- */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .6rem clamp(.8rem, 3vw, 2rem); background: linear-gradient(180deg, rgba(4, 9, 13, .95), rgba(4, 9, 13, .6)); border-bottom: 1px solid rgba(199, 154, 67, .35); position: sticky; top: 0; z-index: 30; backdrop-filter: blur(8px); }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: repeating-linear-gradient(90deg, var(--brass-d) 0 10px, transparent 10px 14px); opacity: .55; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--gold); }
.brand span { display: grid; line-height: 1.05; }
.brand b { font-family: var(--f-title); font-weight: 400; font-size: 1.5rem; letter-spacing: .03em; }
.brand small { font-family: var(--f-ui); font-size: .6rem; letter-spacing: .3em; text-transform: uppercase; color: var(--mute); }
.who { display: flex; align-items: center; gap: .7rem; }
.who-text { display: grid; line-height: 1.15; text-align: right; }
.who-text b { font-weight: 400; }
.who-text small { font-size: .78rem; }
.avatar { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--brass); object-fit: cover; display: inline-grid; place-items: center; font-family: var(--f-title); background: hsl(var(--h, 200) 40% 26%); color: var(--gold); }
@media (max-width: 640px) { .who-text { display: none; } .brand small { display: none; } }

/* ---------- hero (home) ---------- */
.hero { position: relative; height: clamp(500px, 76vh, 700px); overflow: hidden; background: linear-gradient(180deg, #02060b 0%, #0a1a29 38%, #1d3f4c 70%, #3e6b70 100%); border-bottom: 3px solid var(--brass-d); }
.stars { position: absolute; inset: 0 0 35% 0; opacity: .9; background-image:
  radial-gradient(1.4px 1.4px at 12% 18%, #fff, transparent), radial-gradient(1px 1px at 22% 40%, #cfe, transparent), radial-gradient(1.6px 1.6px at 33% 12%, #fff, transparent), radial-gradient(1px 1px at 41% 30%, #fff, transparent),
  radial-gradient(1.3px 1.3px at 55% 22%, #fff, transparent), radial-gradient(1px 1px at 63% 8%, #cfe, transparent), radial-gradient(1.5px 1.5px at 71% 35%, #fff, transparent), radial-gradient(1px 1px at 84% 16%, #fff, transparent),
  radial-gradient(1.2px 1.2px at 92% 33%, #fff, transparent), radial-gradient(1px 1px at 5% 46%, #fff, transparent), radial-gradient(1.2px 1.2px at 47% 46%, #cfe, transparent), radial-gradient(1px 1px at 77% 52%, #fff, transparent);
  animation: twinkle 5s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .55 } to { opacity: 1 } }
.moon { position: absolute; top: 9%; right: 14%; width: clamp(70px, 9vw, 120px); aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fffbe8, #efe3b9 55%, #c9bb8f 100%); box-shadow: 0 0 60px 20px rgba(255, 245, 200, .25), 0 0 160px 60px rgba(160, 200, 230, .15); }
.moon::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: radial-gradient(circle at 60% 60%, rgba(120, 100, 60, .25) 0 12%, transparent 13%), radial-gradient(circle at 30% 65%, rgba(120, 100, 60, .2) 0 8%, transparent 9%); }
.hero-ship { position: absolute; left: 50%; bottom: 9%; width: clamp(240px, 30vw, 440px); transform: translateX(-50%); animation: drift 24s ease-in-out infinite alternate; filter: drop-shadow(0 18px 24px rgba(0, 0, 0, .6)); }
@keyframes drift { from { transform: translateX(-56%) } to { transform: translateX(-44%) } }
.sea { position: absolute; left: 0; bottom: 0; width: 200%; display: flex; }
.sea svg { width: 50%; height: 100%; display: block; }
.sea.s1 { height: 36%; bottom: 8%; opacity: .55; animation: slide 38s linear infinite; } .sea.s1 path { fill: #1c5260; }
.sea.s2 { height: 30%; bottom: 3%; opacity: .8; animation: slide 26s linear infinite reverse; } .sea.s2 path { fill: #0f3441; }
.sea.s3 { height: 24%; bottom: -2%; animation: slide 18s linear infinite; } .sea.s3 path { fill: #08202b; }
@keyframes slide { to { transform: translateX(-50%) } }
.hero-title { position: absolute; left: 0; right: 0; top: 7%; text-align: center; padding: 0 1rem; pointer-events: none; }
.hero-title .kicker { font-family: var(--f-ui); letter-spacing: .4em; text-transform: uppercase; font-size: clamp(.6rem, 1.4vw, .8rem); color: var(--foam); opacity: .85; }
.hero-title h1 { font-size: clamp(3rem, 10vw, 7rem); line-height: .95; background: linear-gradient(180deg, #fff3c4, #f1d17c 45%, #b6862f); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0, 0, 0, .55)) drop-shadow(0 0 30px rgba(241, 209, 124, .25)); }
.hero-title .sub { font-style: italic; font-size: clamp(1rem, 2.2vw, 1.4rem); color: var(--text); text-shadow: 0 2px 8px #000; margin-top: .4rem; }
.hero-title .rule { display: inline-flex; align-items: center; gap: .8rem; color: var(--brass); margin-top: .5rem; }
.hero-title .rule::before, .hero-title .rule::after { content: ""; width: clamp(40px, 12vw, 140px); height: 2px; background: linear-gradient(90deg, transparent, var(--brass)); }
.hero-title .rule::after { transform: scaleX(-1); }
.boot { display: grid; place-items: center; min-height: 60vh; color: var(--brass); }
.boot .compass-rose, .chart-loading .compass-rose { animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg) } }

/* ---------- parchment ---------- */
.parchment {
  color: var(--paper-ink); background: var(--paper), linear-gradient(135deg, var(--parch) 0%, var(--parch-2) 55%, #cfb982 100%); border-radius: 6px 14px 6px 14px; position: relative;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .25), inset 0 0 60px rgba(120, 80, 20, .28);
}
.parchment h1, .parchment h2, .parchment h3 { color: #3a2410; }
.parchment::before { content: ""; position: absolute; inset: 6px; border: 1.5px solid rgba(110, 80, 30, .45); border-radius: 4px 10px 4px 10px; pointer-events: none; }

/* ---------- doors (login) ---------- */
.doors { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; max-width: 1000px; margin: -90px auto 3rem; padding: 0 1rem; position: relative; z-index: 3; }
.door { padding: 2.6rem 2rem 2rem; text-align: center; display: grid; gap: .8rem; justify-items: center; }
.door h2 { font-size: 2.2rem; }
.door p { max-width: 36ch; }
.door .seal { margin-top: -4.6rem; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5)); }
.google-btn { display: inline-flex; align-items: center; gap: .7rem; padding: .6rem 1.4rem .6rem .7rem; border-radius: 999px; background: #fff; color: #1f1f1f; font-family: "Roboto", system-ui, sans-serif; font-weight: 500; font-size: .95rem; box-shadow: 0 2px 6px rgba(0, 0, 0, .35), 0 0 0 1px rgba(0, 0, 0, .1); transition: transform .12s, box-shadow .2s; }
.google-btn:hover { color: #000; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .4), 0 0 0 2px #4285F4; }
.g-logo { display: grid; place-items: center; width: 34px; height: 34px; background: #fff; border-radius: 50%; }
.warn { color: #7a3a10; font-size: .9rem; }
.guest-form { display: grid; gap: .6rem; width: min(320px, 100%); }
.guest-form input { background: rgba(255, 250, 235, .7); color: var(--paper-ink); border-color: rgba(90, 64, 24, .45); text-align: center; }

/* ---------- registry ---------- */
.registry { max-width: 1200px; margin: 0 auto; padding: 2rem 1rem 4rem; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { font-size: 2.4rem; color: var(--gold); }
.reg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.6rem; }
.reg-card { display: grid; color: var(--paper-ink); overflow: hidden; transition: transform .2s, box-shadow .2s; }
.reg-card:hover { transform: translateY(-4px) rotate(-.4deg); color: var(--paper-ink); box-shadow: 0 18px 40px rgba(0, 0, 0, .55), 0 0 0 2px var(--brass); }
.reg-art { background: linear-gradient(180deg, #17384a, #0b2230); border-radius: 4px 12px 0 0; margin: 6px 6px 0; height: 170px; overflow: hidden; display: grid; place-items: center; }
.reg-art svg { height: 100%; width: auto; }
.reg-body { padding: .9rem 1.2rem 1.1rem; display: grid; gap: .35rem; }
.reg-body h3 { font-size: 1.8rem; }
.tag { font-style: italic; color: var(--paper-mute); margin: 0; }
.reg-meta { display: flex; align-items: center; gap: .5rem; }
.reg-foot { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .9rem; align-items: center; }
.reg-foot span { display: inline-flex; align-items: center; gap: .25em; }
.reg-grid .empty { padding: 2.5rem; text-align: center; grid-column: 1 / -1; display: grid; gap: .4rem; justify-items: center; color: var(--brass-d); }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3em; padding: .12em .65em; border-radius: 999px; font-family: var(--f-ui); font-size: .66rem; letter-spacing: .08em; text-transform: uppercase; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); color: var(--text); }
.badge.gold { background: linear-gradient(180deg, #f1d17c, #b98a30); color: #2a1a06; border-color: #f6dd92; }
.badge.quirk { background: rgba(169, 139, 232, .15); border-color: rgba(169, 139, 232, .5); color: #d8c9ff; }
.badge.dim { opacity: .75; }
.parchment .badge, .cx-card .badge, .member .badge, .log-entry .badge { color: var(--paper-ink); background: rgba(90, 60, 20, .1); border-color: rgba(90, 60, 20, .3); }
.state { font-family: var(--f-ui); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; padding: .2em .7em; border-radius: 999px; white-space: nowrap; border: 1px solid; }
.state.heard { color: #6b5322; border-color: rgba(107, 83, 34, .55); background: rgba(107, 83, 34, .1); }
.state.known { color: #0f4c5a; border-color: #1f7a8c; background: rgba(31, 122, 140, .14); }
.state.visited { color: #1c5a2c; border-color: #2f8f46; background: rgba(47, 143, 70, .16); }
.state.dead { color: #7a1f16; border-color: #a8362b; background: rgba(168, 54, 43, .14); }

/* ---------- campaign shell ---------- */
.camp-head { max-width: 1280px; margin: 0 auto; padding: 1.4rem 1rem 0; }
.camp-title { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.camp-title h1 { font-size: clamp(2rem, 5vw, 3.4rem); color: var(--gold); text-shadow: 0 3px 0 rgba(0, 0, 0, .5); }
.camp-title p { color: var(--mute); font-style: italic; margin: 0; }
.camp-title .role { margin-left: auto; }
.back { font-family: var(--f-ui); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); width: 100%; }
.flag-wrap svg { filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); animation: flap 3s ease-in-out infinite; transform-origin: left center; }
@keyframes flap { 0%, 100% { transform: skewY(0) } 50% { transform: skewY(-3deg) scaleX(.97) } }
.tabs { display: flex; gap: .3rem; margin-top: 1.1rem; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; border-bottom: 3px solid var(--brass-d); position: relative; }
.tab { display: inline-flex; align-items: center; gap: .5em; padding: .75em 1.1em; border-radius: 12px 12px 0 0; background: linear-gradient(180deg, #1a2b36, #101d26); border: 1px solid rgba(199, 154, 67, .3); border-bottom: 0; color: var(--mute); font-family: var(--f-ui); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; white-space: nowrap; transition: color .2s, transform .15s; }
.tab:hover { color: var(--gold); transform: translateY(-2px); }
.tab.on { background: linear-gradient(180deg, #f1d17c, #bb8d35); color: #2b1b06; border-color: #f6dd92; transform: translateY(2px); padding-bottom: calc(.75em + 2px); }
.tab.dm:not(.on) { color: var(--gold); border-style: dashed; }
.camp-main { max-width: 1280px; margin: 0 auto; padding: 1.6rem 1rem 3rem; min-height: 55vh; }
.foot { text-align: center; color: var(--mute); padding: 2rem 1rem 3rem; display: grid; justify-items: center; gap: .3rem; color: var(--brass-d); }

/* ---------- panels ---------- */
.panel { background: linear-gradient(180deg, rgba(17, 36, 48, .92), rgba(8, 20, 28, .94)); border: 1px solid rgba(199, 154, 67, .38); border-radius: var(--r); box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06); margin-bottom: 1.2rem; position: relative; overflow: hidden; }
.panel-head { display: flex; align-items: center; gap: .6rem; padding: .75rem 1.1rem; background: linear-gradient(90deg, rgba(199, 154, 67, .22), rgba(199, 154, 67, .04)); border-bottom: 1px solid rgba(199, 154, 67, .35); color: var(--gold); }
.panel-head h2 { font-size: 1.55rem; flex: 1; }
.panel-head .more { font-family: var(--f-ui); font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; }
.panel-body { padding: 1.1rem 1.2rem 1.3rem; }
.panel.danger { border-color: rgba(224, 98, 79, .5); }
.empty-note { text-align: center; padding: 2rem 1rem; color: var(--mute); display: grid; justify-items: center; gap: .4rem; }

/* ---------- helm ---------- */
.ship-hero { position: relative; border-radius: 18px; overflow: hidden; border: 2px solid var(--brass); box-shadow: var(--shadow); min-height: 0; padding-top: 4.5rem; display: grid; align-items: end; background: linear-gradient(180deg, #050b12 0%, #123a4c 62%, #0a2a38 100%); margin-bottom: 1.2rem; }
.ship-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(600px 240px at 70% 10%, rgba(255, 240, 190, .16), transparent 70%), var(--paper); opacity: .8; }
.ship-pic { position: relative; z-index: 1; width: min(640px, 92%); margin: 0 auto; }
.ship-pic svg, .ship-pic img { width: 100%; height: auto; display: block; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .55)); }
.ship-pic.custom img { object-fit: contain; max-height: 380px; }
.bob { animation: bob 5.5s ease-in-out infinite; transform-origin: 200px 245px; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-.6deg) } 50% { transform: translateY(-4px) rotate(.8deg) } }
.swell { animation: swell 7s ease-in-out infinite; }
@keyframes swell { 0%, 100% { transform: translateX(0) } 50% { transform: translateX(-25px) } }
.flag-wave { transform-box: fill-box; transform-origin: left center; animation: flap 2.4s ease-in-out infinite; }
.nameplate { position: absolute; left: 1.2rem; top: 1.1rem; z-index: 2; max-width: min(420px, 70%); display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; align-items: center; background: linear-gradient(180deg, rgba(8, 16, 22, .82), rgba(8, 16, 22, .6)); border: 1px solid var(--brass); border-radius: 10px; padding: .7rem 1rem; backdrop-filter: blur(4px); }
.nameplate h2 { font-size: 2rem; color: var(--gold); }
.nameplate p { margin: 0; color: var(--mute); font-size: .95rem; }
.nameplate blockquote { grid-column: 1 / -1; margin: .2rem 0 0; font-style: italic; color: var(--foam); border-top: 1px solid rgba(199, 154, 67, .3); padding-top: .4rem; }
.ship-hero .quirks { position: absolute; right: 1rem; top: 1rem; z-index: 2; display: flex; gap: .4rem; flex-wrap: wrap; justify-content: flex-end; max-width: 40%; }
.ribbon { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: .8rem; margin-bottom: 1.2rem; }
.rib { display: grid; justify-items: center; text-align: center; padding: .9rem .4rem; border-radius: 12px; background: linear-gradient(180deg, rgba(199, 154, 67, .14), rgba(199, 154, 67, .03)); border: 1px solid rgba(199, 154, 67, .35); color: var(--gold); }
.rib b { font-family: var(--f-title); font-weight: 400; font-size: 2.2rem; line-height: 1; color: var(--text); }
.rib small { font-family: var(--f-ui); font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; }
.rib.blood { color: var(--blood-h); border-color: rgba(212, 88, 74, .45); background: linear-gradient(180deg, rgba(168, 54, 43, .2), rgba(168, 54, 43, .04)); }
.helm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 1.2rem; align-items: start; }
.helm-grid .panel { margin: 0; }
.meter { margin-bottom: .9rem; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--f-ui); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.meter-num { font-family: var(--f-title); font-size: 1.3rem; letter-spacing: 0; } .meter-num small { font-family: var(--f-body); font-size: .85rem; }
.meter-track { position: relative; height: 16px; border-radius: 99px; background: #05090d; border: 1px solid rgba(199, 154, 67, .5); overflow: hidden; box-shadow: inset 0 2px 5px #000; }
.meter-fill { height: 100%; border-radius: 99px; transition: width .6s cubic-bezier(.2, .8, .2, 1); background: linear-gradient(180deg, rgba(255, 255, 255, .35), transparent 50%), var(--c, var(--good)); }
.meter-fill.good { --c: #3f9a59; } .meter-fill.warn { --c: #cf9a2c; } .meter-fill.bad { --c: #c4402e; animation: danger 1.4s ease-in-out infinite; }
@keyframes danger { 50% { filter: brightness(1.4) } }
.meter-ticks { position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(0, 0, 0, .45) calc(10% - 1px) 10%); }
.meter.cargo .meter-fill { --c: #6a8fb5 !important; } .meter.rigging .meter-fill { --c: #b79a5c !important; } .meter.crew .meter-fill { --c: #8e6fc4 !important; } .meter.stores .meter-fill { --c: #9aa84a; }
.meter-adjust, .stepper { display: flex; gap: .3rem; margin-top: .35rem; align-items: center; }
.meter-adjust button, .stepper button { border: 1px solid var(--brass-d); background: #101d26; color: var(--gold); border-radius: 6px; padding: 0 .55em; font-size: .78rem; min-width: 2.2em; height: 1.7em; }
.meter-adjust button:hover, .stepper button:hover { background: var(--brass); color: #1b1204; }
.stepper span { font-family: var(--f-ui); font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); width: 8em; }
.vitals { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .6rem; margin: 1rem 0 0; }
.vitals div { border-left: 2px solid var(--brass); padding-left: .6rem; }
.vitals dt { font-family: var(--f-ui); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.vitals dd { margin: 0; font-size: 1.2rem; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.tile { display: grid; grid-template-columns: auto 1fr; column-gap: .5rem; padding: .6rem .8rem; background: rgba(0, 0, 0, .25); border: 1px solid rgba(199, 154, 67, .25); border-radius: 10px; color: var(--gold); align-items: center; }
.tile small { grid-column: 2; font-family: var(--f-ui); font-size: .56rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.tile b { grid-column: 2; font-weight: 400; color: var(--text); font-size: 1.05rem; line-height: 1.2; }
.tile .ico { grid-row: 1 / 3; }
.wealth { display: grid; grid-template-columns: auto 1fr; gap: 1.2rem; align-items: center; margin: 1.2rem 0 .6rem; }
.chest { display: flex; align-items: center; gap: .7rem; color: var(--gold); padding: .7rem 1.1rem; border: 1px solid var(--brass); border-radius: 12px; background: radial-gradient(circle at 20% 20%, rgba(241, 209, 124, .25), transparent 70%), rgba(0, 0, 0, .3); }
.chest b { font-family: var(--f-title); font-weight: 400; font-size: 2.4rem; line-height: 1; background: linear-gradient(180deg, #fff3c4, #d6a94a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.chest small { display: block; font-family: var(--f-ui); font-size: .58rem; letter-spacing: .15em; text-transform: uppercase; }
.reps { display: grid; gap: .8rem; }
.rep-top { display: flex; justify-content: space-between; font-family: var(--f-ui); font-size: .62rem; letter-spacing: .1em; text-transform: uppercase; }
.rep-top b { font-family: var(--f-title); font-weight: 400; font-size: 1rem; }
.rep-track { position: relative; height: 10px; border-radius: 99px; background: linear-gradient(90deg, #2b6b8a, #1a2a33 50%, #a8362b); border: 1px solid rgba(199, 154, 67, .4); margin: .3rem 0; }
.rep-zero { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; background: var(--gold); opacity: .6; }
.rep-marker { position: absolute; top: -5px; width: 16px; height: 20px; margin-left: -8px; border-radius: 3px 3px 8px 8px; background: linear-gradient(180deg, #fff3c4, #c99a3e); box-shadow: 0 2px 6px #000; transition: left .5s; }
.rep-label { font-style: italic; }
.heat { display: flex; gap: 2px; color: #3c3027; } .heat span.on { color: #ff9a3c; filter: drop-shadow(0 0 5px #ff7a1a); animation: flicker 1.6s infinite alternate; }
@keyframes flicker { to { filter: drop-shadow(0 0 9px #ff5a1a); opacity: .85 } }
.quick { display: grid; gap: .4rem; margin: .5rem 0 1rem; padding-top: .8rem; border-top: 1px dashed rgba(199, 154, 67, .35); }
.objective { display: flex; gap: .7rem; padding: .8rem 1rem; border-left: 3px solid var(--gold); background: rgba(241, 209, 124, .07); border-radius: 0 10px 10px 0; color: var(--gold); margin-top: 1rem; }
.objective p { color: var(--text); margin: 0; } .objective small { font-family: var(--f-ui); font-size: .58rem; letter-spacing: .14em; text-transform: uppercase; }
.crew-glance { display: flex; flex-wrap: wrap; gap: .8rem; }
.mini-crew { display: grid; justify-items: center; gap: .15rem; width: 64px; color: var(--text); } .mini-crew.dead, .mini-crew.lost { opacity: .45; filter: grayscale(1); } .mini-crew.ashore { opacity: .75; }
.sigil { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; font-family: var(--f-title); font-size: 1.5rem; color: #fff3d2; background: radial-gradient(circle at 30% 25%, hsl(var(--h) 45% 42%), hsl(var(--h) 50% 18%)); border: 2px solid var(--brass); box-shadow: 0 3px 8px rgba(0, 0, 0, .5); }
.sigil.big { width: 72px; height: 72px; font-size: 2.2rem; }
.mini-log { display: grid; gap: .8rem; }

/* ---------- log ---------- */
.log-view { display: grid; gap: 1rem; }
.timeline { display: grid; gap: 1rem; position: relative; padding-left: 1.2rem; }
.timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 3px; background: repeating-linear-gradient(180deg, var(--brass) 0 8px, transparent 8px 14px); opacity: .6; }
.log-entry { display: grid; grid-template-columns: auto 1fr; gap: .9rem; padding: .95rem 1.2rem 1rem; color: var(--paper-ink); background: var(--paper), linear-gradient(135deg, var(--parch), var(--parch-2)); border-radius: 4px 12px 4px 12px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4), inset 0 0 40px rgba(120, 80, 20, .22); position: relative; }
.timeline .log-entry::before { content: ""; position: absolute; left: -1.42rem; top: 1.2rem; width: 14px; height: 14px; border-radius: 50%; background: var(--gold); border: 3px solid #1b1204; box-shadow: 0 0 0 2px var(--brass); }
.log-ico { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(90, 60, 20, .12); border: 1.5px solid rgba(90, 60, 20, .5); color: #6b4a14; }
.log-entry.battle .log-ico { color: var(--blood); border-color: var(--blood); } .log-entry.treasure .log-ico { color: #8a6500; } .log-entry.omen .log-ico { color: #4b3a8c; }
.log-entry header { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; flex-wrap: wrap; }
.log-entry h3 { font-size: 1.5rem; color: #3a2410; }
.log-entry p { margin: .3rem 0 0; white-space: pre-wrap; }
.meta { display: flex; gap: .5rem; align-items: center; color: var(--paper-mute); font-size: .85rem; }
.hidden-entry { opacity: .72; outline: 2px dashed rgba(168, 54, 43, .55); outline-offset: -3px; }
.card-actions { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }
.parchment .btn.ghost, .log-entry .btn.ghost, .member .btn.ghost, .cx-card .btn.ghost, .adv .btn.ghost { color: #5a3b10; border-color: rgba(90, 60, 20, .5); }
.btn.ghost.danger { color: var(--blood); }
.log-new { justify-self: start; }
.mini-log .log-entry { padding: .7rem .9rem; } .mini-log .log-entry h3 { font-size: 1.2rem; } .mini-log .log-ico { width: 34px; height: 34px; }

/* ---------- ship & fittings ---------- */
.shipyard { display: grid; grid-template-columns: minmax(300px, 5fr) 7fr; gap: 1.4rem; align-items: start; }
@media (max-width: 960px) { .shipyard { grid-template-columns: 1fr; } }
.ship-stage { position: sticky; top: 90px; border: 2px solid var(--brass); border-radius: 18px; overflow: hidden; background: linear-gradient(180deg, #050b12, #124058 70%, #0b2b3a); box-shadow: var(--shadow); padding: 1.2rem 1rem 1rem; }
.ship-stage::before { content: ""; position: absolute; inset: 0; background: radial-gradient(400px 200px at 50% 0, rgba(255, 240, 190, .15), transparent 70%), var(--paper); opacity: .8; pointer-events: none; }
.stage-plate { position: relative; text-align: center; margin-bottom: .2rem; } .stage-plate h2 { color: var(--gold); font-size: 2.2rem; } .stage-plate p { color: var(--mute); margin: 0; }
.ship-stage .ship-pic { width: 100%; }
.figurehead-slot { position: absolute; right: 1rem; top: 4.2rem; z-index: 3; width: 112px; }
.spec { position: relative; display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: .5rem; margin: 1rem 0 0; }
.spec div { text-align: center; background: rgba(0, 0, 0, .35); border: 1px solid rgba(199, 154, 67, .3); border-radius: 8px; padding: .35rem; }
.spec dt { font-family: var(--f-ui); font-size: .54rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); } .spec dd { margin: 0; font-size: 1.05rem; color: var(--gold); }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: .9rem; }
.slot { position: relative; display: grid; justify-items: center; gap: .25rem; padding: .8rem .4rem .7rem; text-align: center; border-radius: 14px; border: 1px solid rgba(199, 154, 67, .25); background: radial-gradient(circle at 50% 0, rgba(199, 154, 67, .12), transparent 70%), rgba(0, 0, 0, .28); transition: transform .15s, box-shadow .25s, border-color .2s; min-height: 142px; }
.slot:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 8px 20px rgba(0, 0, 0, .5), 0 0 22px rgba(241, 209, 124, .2); }
.slot-art { display: grid; place-items: center; width: 62px; height: 62px; border-radius: 50%; color: var(--brass-d); background: radial-gradient(circle at 35% 30%, #1b2c37, #05090d); border: 2px dashed rgba(199, 154, 67, .4); box-shadow: inset 0 3px 10px #000; }
.slot-img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; }
.slot.filled .slot-art { color: var(--gold); border: 2px solid var(--gold); background: radial-gradient(circle at 35% 30%, #2d4658, #08121a); box-shadow: inset 0 3px 10px #000, 0 0 16px rgba(241, 209, 124, .35); }
.slot.q-crude .slot-art { border-color: #9a6b3c; color: #c99d6c; box-shadow: inset 0 3px 10px #000, 0 0 10px rgba(154, 107, 60, .35); }
.slot.q-fine .slot-art { border-color: #d9e6ec; color: #eef6f9; box-shadow: inset 0 3px 10px #000, 0 0 18px rgba(217, 230, 236, .45); }
.slot.q-magic .slot-art { border-color: var(--violet); color: #dccfff; box-shadow: inset 0 3px 10px #000, 0 0 20px rgba(169, 139, 232, .7); animation: arcane 2.8s ease-in-out infinite alternate; }
@keyframes arcane { to { box-shadow: inset 0 3px 10px #000, 0 0 30px rgba(169, 139, 232, .95) } }
.slot.q-damaged .slot-art { border-color: var(--bad); color: #ff9a8a; filter: saturate(.6); }
.slot-type { font-family: var(--f-ui); font-size: .54rem; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); }
.slot-name { font-size: .95rem; line-height: 1.15; color: var(--text); } .slot.empty .slot-name { color: #5d6e72; font-style: italic; }
.q-tag { position: absolute; top: 6px; right: 6px; font-family: var(--f-ui); font-size: .5rem; letter-spacing: .08em; text-transform: uppercase; padding: .1em .5em; border-radius: 99px; background: rgba(0, 0, 0, .6); border: 1px solid currentColor; color: var(--mute); }
.slot.q-magic .q-tag { color: var(--violet); } .slot.q-damaged .q-tag { color: var(--bad); } .slot.q-fine .q-tag { color: #d9e6ec; }
.figurehead-slot .slot { min-height: 0; background: rgba(5, 11, 16, .75); backdrop-filter: blur(3px); border-color: var(--brass); }
.slot-detail { display: flex; gap: 1.2rem; align-items: center; } .slot-big { color: #7a5a1c; display: grid; place-items: center; width: 110px; height: 110px; border-radius: 50%; border: 3px double #8b6a28; background: rgba(255, 255, 255, .25); flex: none; }
.item-list { display: grid; gap: .4rem; max-height: 260px; overflow: auto; padding-right: .3rem; } .item-list.short { max-height: 190px; }
.item { display: flex; gap: .7rem; align-items: center; text-align: left; padding: .45rem .7rem; border-radius: 10px; border: 1px solid rgba(90, 60, 20, .3); background: rgba(255, 255, 255, .35); color: var(--paper-ink); }
.item:hover { background: rgba(255, 255, 255, .6); } .item.on { border-color: #8b6a28; background: rgba(241, 209, 124, .55); box-shadow: 0 0 0 2px #c79a43; }
.item-ico { color: #7a5a1c; flex: none; width: 30px; display: grid; place-items: center; } .item-main { display: grid; } .item-main small { color: var(--paper-mute); line-height: 1.2; }
.slot-counts { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .7rem; }
.slot-count { display: grid; grid-template-columns: auto 1fr 72px; gap: .5rem; align-items: center; color: var(--gold); }
.flag-designer { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; } .flag-prev svg { filter: drop-shadow(0 6px 8px #000); }

/* ---------- crew ---------- */
.crew-head { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; margin-bottom: 1.4rem; padding: 1rem 1.4rem; border-radius: var(--r); border: 1px solid rgba(199, 154, 67, .35); background: rgba(0, 0, 0, .25); }
.big-count { display: grid; justify-items: center; } .big-count b { font-family: var(--f-title); font-weight: 400; font-size: 3.4rem; line-height: 1; color: var(--gold); } .big-count small { font-family: var(--f-ui); font-size: .6rem; letter-spacing: .12em; text-transform: uppercase; }
.crew-head > div:nth-child(2) { flex: 1; min-width: 220px; }
.crew-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.2rem; margin-bottom: 1.6rem; }
.member { display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1rem 1.2rem; color: var(--paper-ink); background: var(--paper), linear-gradient(135deg, var(--parch), var(--parch-2)); border-radius: 4px 14px 4px 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .45), inset 0 0 40px rgba(120, 80, 20, .22); }
.member h3 { font-size: 1.6rem; color: #3a2410; } .member p { margin: .4rem 0 0; }
.member.dead, .member.lost { filter: grayscale(.85); } .member.dead h3 { text-decoration: line-through; text-decoration-color: var(--blood); }
.member-tags { display: flex; gap: .4rem; flex-wrap: wrap; margin: .2rem 0 .4rem; } .role { display: inline-flex; align-items: center; gap: .3em; font-family: var(--f-ui); font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: #6b4a14; }
.member .card-actions { grid-column: 1 / -1; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .9rem; } .type { display: flex; gap: .7rem; color: var(--gold); } .type div { display: grid; color: var(--text); } .type small { color: var(--mute); line-height: 1.3; }

/* ---------- chart ---------- */
.chart-tools { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: .6rem; }
.zoom { display: inline-flex; border: 1px solid var(--brass); border-radius: 99px; overflow: hidden; } .zoom button { background: #101d26; color: var(--gold); border: 0; width: 38px; height: 34px; font-size: 1.2rem; } .zoom button:hover { background: var(--brass); color: #1b1204; }
.chart-note { color: var(--mute); font-size: .95rem; margin: .2rem 0 .6rem; display: flex; gap: .4em; align-items: center; } .chart-note.hot { color: var(--gold); }
.chart-viewport { position: relative; height: min(76vh, 780px); min-height: 420px; overflow: hidden; border: 3px solid var(--brass); border-radius: 14px; background: #060d12; box-shadow: var(--shadow), 0 0 0 8px #1a1208, 0 0 0 10px var(--brass-d); cursor: grab; touch-action: none; user-select: none; }
.chart-viewport:active { cursor: grabbing; } .chart-viewport.placing { cursor: crosshair; outline: 3px solid var(--gold); outline-offset: -6px; }
.chart-inner { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.chart-img { display: block; pointer-events: none; image-rendering: auto; }
.chart-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.route-line { fill: none; stroke: #f1d17c; stroke-width: 2.4px; stroke-dasharray: 8 7; opacity: .9; animation: march 1.6s linear infinite; filter: drop-shadow(0 0 3px #000); }
@keyframes march { to { stroke-dashoffset: -30 } }
.trail-line { fill: none; stroke: #e9f6f4; stroke-width: 2.2px; stroke-dasharray: 2 6; stroke-linecap: round; opacity: .85; }
.vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 110px rgba(0, 0, 0, .65); }
.chart-rose { position: absolute; right: 14px; bottom: 10px; color: var(--gold); opacity: .55; pointer-events: none; }
.chart-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: .6rem; background: #060d12; color: var(--brass); z-index: 4; }
.pin { position: absolute; transform: translate(-50%, -50%) scale(var(--inv, 1)); background: none; border: 0; padding: 0; display: grid; justify-items: center; z-index: 2; color: inherit; }
.pin-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #2f4a5c, #0a141b); border: 2px solid var(--gold); color: var(--gold); box-shadow: 0 3px 8px rgba(0, 0, 0, .7), 0 0 12px rgba(241, 209, 124, .4); transition: transform .15s; }
.pin:hover { z-index: 6; } .pin:hover .pin-dot { transform: scale(1.25); }
.pin.visited .pin-dot { border-color: #7fe092; color: #bff5c9; box-shadow: 0 3px 8px #000, 0 0 14px rgba(127, 224, 146, .55); }
.pin.port .pin-dot { width: 34px; height: 34px; } .pin.site .pin-dot, .pin.treasure .pin-dot { width: 24px; height: 24px; border-radius: 6px; transform: rotate(45deg); } .pin.site .pin-dot svg, .pin.treasure .pin-dot svg { transform: rotate(-45deg) scale(.8); }
.pin.treasure .pin-dot { border-color: #f6dd92; color: #f6dd92; background: radial-gradient(circle at 35% 30%, #6a4a12, #1a1004); }
.pin.site .pin-dot { border-color: #e98d7e; color: #ffb7aa; }
.pin.ghost { opacity: .5; } .pin.ghost .pin-dot { border-style: dashed; border-color: #8fb0b8; color: #8fb0b8; box-shadow: none; } .pin.ghost:hover { opacity: 1; }
.pin-label { margin-top: 3px; white-space: nowrap; font-family: var(--f-title); font-size: 15px; color: #fff3d2; text-shadow: 0 0 3px #000, 0 0 6px #000, 1px 1px 0 #000; pointer-events: none; }
.nolabels .pin-label { display: none; } .nolabels .pin:hover .pin-label { display: block; }
.ship-marker { position: absolute; transform: translate(-50%, -50%) scale(var(--inv, 1)); z-index: 5; pointer-events: none; display: grid; place-items: center; }
.ship-marker .mark { color: #fff3d2; filter: drop-shadow(0 0 6px #ffcf5a) drop-shadow(0 2px 2px #000); animation: bob 3s ease-in-out infinite; position: relative; }
.ship-marker .pulse { position: absolute; width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--gold); animation: ping 2s ease-out infinite; }
@keyframes ping { from { transform: scale(.6); opacity: 1 } to { transform: scale(3.4); opacity: 0 } }
.ship-tag { position: absolute; top: 28px; white-space: nowrap; font-family: var(--f-title); font-size: 16px; color: var(--gold); text-shadow: 0 0 4px #000, 0 0 8px #000; }
.chart-legend { display: flex; gap: 1.2rem; flex-wrap: wrap; margin-top: 1rem; color: var(--mute); font-size: .9rem; } .chart-legend span { display: inline-flex; align-items: center; gap: .35em; } .lg-route::before { content: ""; width: 26px; border-top: 3px dashed var(--gold); }
.pin-detail .pd-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .5rem; }
.pick-wrap { position: relative; } .pick-wrap img { width: 100%; display: block; cursor: crosshair; border-radius: 8px; } .pick-dot { position: absolute; width: 18px; height: 18px; margin: -9px; border-radius: 50%; border: 3px solid #fff; background: var(--blood); box-shadow: 0 0 0 2px #000; pointer-events: none; }

/* ---------- codex ---------- */
.codex-nav, .chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.chip { display: inline-flex; align-items: center; gap: .45em; padding: .45em .95em; border-radius: 99px; border: 1px solid rgba(199, 154, 67, .4); background: rgba(0, 0, 0, .3); color: var(--text); font-family: var(--f-ui); font-size: .68rem; letter-spacing: .06em; text-transform: uppercase; }
.chip b { font-weight: 700; background: rgba(199, 154, 67, .25); border-radius: 99px; padding: 0 .55em; color: var(--gold); }
.chip:hover { border-color: var(--gold); } .chip.on { background: linear-gradient(180deg, #f1d17c, #bb8d35); color: #2b1b06; border-color: #f6dd92; } .chip.on b { background: rgba(0, 0, 0, .18); color: #2b1b06; }
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1.2rem; }
.cx-card { display: grid; gap: .5rem; align-content: start; padding: 1rem 1.2rem 1.1rem; color: var(--paper-ink); background: var(--paper), linear-gradient(135deg, var(--parch), var(--parch-2)); border-radius: 4px 14px 4px 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .45), inset 0 0 40px rgba(120, 80, 20, .22); cursor: pointer; transition: transform .18s, box-shadow .18s; }
.cx-card:hover { transform: translateY(-3px) rotate(-.3deg); box-shadow: 0 16px 30px rgba(0, 0, 0, .55), 0 0 0 2px var(--brass); }
.cx-top { display: grid; grid-template-columns: auto 1fr auto; gap: .7rem; align-items: center; } .cx-top h3 { font-size: 1.45rem; color: #3a2410; line-height: 1.05; }
.cx-ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: #6b4a14; border: 1.5px solid rgba(90, 60, 20, .5); background: rgba(90, 60, 20, .1); }
.cx-card.island .cx-ico, .cx-card.landmark .cx-ico { color: #1f6a52; } .cx-card.monster .cx-ico, .cx-card.site .cx-ico { color: var(--blood); } .cx-card.treasure .cx-ico { color: #94700a; }
.cx-meta { margin: 0; font-size: .85rem; color: var(--paper-mute); font-style: italic; }
.cx-sum { margin: 0; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.dm-peek { margin-top: .3rem; padding: .4em .7em; border-radius: 8px; background: rgba(168, 54, 43, .12); border: 1px dashed rgba(168, 54, 43, .5); font-size: .85rem; color: #6b2018; }
.cx-detail .lead { font-size: 1.15rem; } .cx-detail-head { display: flex; gap: .7rem; align-items: center; margin-bottom: .6rem; } .cx-detail .meta { margin: .1rem 0; font-style: italic; }
.dm-box { margin: 1rem 0; padding: .8rem 1rem; border-radius: 10px; background: rgba(168, 54, 43, .1); border: 1px dashed rgba(168, 54, 43, .6); } .dm-box h4 { color: var(--blood); display: flex; gap: .4em; align-items: center; font-size: 1.2rem; margin-bottom: .3rem; }
.quote { font-style: italic; border-left: 3px solid var(--brass); padding-left: .8rem; }
.md h3, .md h4, .md h5 { color: #3a2410; margin: 1rem 0 .3rem; } .md ul, .md ol { padding-left: 1.3rem; margin: .3rem 0 .6rem; } .md code { background: rgba(0, 0, 0, .08); padding: 0 .3em; border-radius: 4px; }
.tbl { overflow-x: auto; margin: .5rem 0; } .md table { border-collapse: collapse; font-size: .85rem; min-width: 100%; } .md th, .md td { border: 1px solid rgba(90, 60, 20, .35); padding: .25em .55em; text-align: left; vertical-align: top; } .md th { background: rgba(90, 60, 20, .15); }
.adv-head { display: flex; gap: 1.4rem; align-items: center; flex-wrap: wrap; margin-bottom: 1.2rem; }
.adv-stat { display: grid; grid-template-columns: auto auto; column-gap: .7rem; align-items: center; padding: .8rem 1.4rem; border-radius: 12px; border: 1px solid rgba(199, 154, 67, .4); background: rgba(0, 0, 0, .25); color: var(--gold); } .adv-stat b { font-family: var(--f-title); font-weight: 400; font-size: 2.8rem; line-height: 1; color: var(--text); } .adv-stat small { grid-column: 1 / -1; font-family: var(--f-ui); font-size: .58rem; letter-spacing: .12em; text-transform: uppercase; }
.adv-stat.blood { color: var(--blood-h); border-color: rgba(212, 88, 74, .5); }
.adv-list { display: grid; gap: .9rem; }
.adv { display: grid; grid-template-columns: auto 1fr auto; gap: .6rem 1rem; align-items: center; padding: .8rem 1.2rem; color: var(--paper-ink); background: var(--paper), linear-gradient(135deg, var(--parch), var(--parch-2)); border-radius: 4px 14px 4px 14px; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
.adv.slain { box-shadow: 0 6px 16px rgba(0, 0, 0, .4), inset 4px 0 0 var(--blood); }
.adv-ico { color: #6b4a14; } .adv-main h3 { font-size: 1.5rem; color: #3a2410; } .adv-counts { display: flex; gap: 1.1rem; }
.counter { display: flex; align-items: center; gap: .3rem; } .counter span { display: grid; justify-items: center; line-height: 1; } .counter b { font-family: var(--f-title); font-weight: 400; font-size: 1.8rem; } .counter small { font-family: var(--f-ui); font-size: .5rem; letter-spacing: .12em; text-transform: uppercase; } .counter.blood b { color: var(--blood); }
.counter button { width: 26px; height: 26px; border-radius: 50%; border: 1px solid rgba(90, 60, 20, .5); background: rgba(255, 255, 255, .4); color: #5a3b10; }
.skulls { grid-column: 2 / -1; display: flex; gap: 2px; flex-wrap: wrap; color: var(--blood); align-items: center; } .adv .card-actions { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) { .adv { grid-template-columns: auto 1fr; } .adv-counts { grid-column: 1 / -1; } }

/* ---------- cabin (DM) ---------- */
.bible-tools { display: flex; gap: .7rem; flex-wrap: wrap; align-items: flex-start; } .bible-tools .search { flex: 1; margin: 0; }
.bible-list { display: grid; gap: .4rem; max-height: 62vh; overflow: auto; padding-right: .4rem; }
.bible-row { display: grid; grid-template-columns: auto auto 1fr auto auto; gap: .7rem; align-items: center; padding: .45rem .8rem; border-radius: 10px; border: 1px solid rgba(199, 154, 67, .2); background: rgba(0, 0, 0, .22); }
.bible-row.revealed { border-color: rgba(127, 224, 146, .5); background: rgba(47, 143, 70, .1); } .b-ico { color: var(--gold); } .b-main { display: grid; line-height: 1.2; } .b-main small { font-size: .8rem; }
.state-btns { display: inline-flex; border: 1px solid var(--brass-d); border-radius: 99px; overflow: hidden; } .sb { width: 34px; height: 30px; border: 0; background: #101d26; color: var(--mute); font-family: var(--f-ui); font-weight: 700; } .sb:hover { background: #1c3140; color: var(--gold); }
.sb.on.heard { background: #8b6a28; color: #fff; } .sb.on.known { background: #1f7a8c; color: #fff; } .sb.on.visited { background: #2f8f46; color: #fff; }
.bulk-bar { display: flex; gap: .6rem; align-items: center; padding: .5rem .8rem; margin: .8rem 0; border-radius: 10px; background: rgba(241, 209, 124, .1); border: 1px dashed var(--brass); } .bulk-bar[hidden] { display: none; }
.chips { margin: 1rem 0; }
@media (max-width: 720px) { .bible-row { grid-template-columns: auto 1fr auto; } .bible-row > .b-ico, .bible-row > .btn { display: none; } }

/* ---------- modal & toasts ---------- */
#layer { position: relative; z-index: 100; }
.modal-back { position: fixed; inset: 0; background: rgba(2, 6, 9, .72); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 1rem; overflow: auto; animation: fade .18s; }
@keyframes fade { from { opacity: 0 } }
.modal-card { width: min(560px, 100%); max-height: calc(100vh - 2rem); display: grid; grid-template-rows: auto 1fr auto; color: var(--paper-ink); background: var(--paper), linear-gradient(135deg, var(--parch), var(--parch-2)); border-radius: 6px 18px 6px 18px; border: 3px solid #3b2812; box-shadow: 0 30px 80px rgba(0, 0, 0, .8), 0 0 0 2px var(--brass); animation: pop .22s cubic-bezier(.2, 1.2, .3, 1); }
.modal-card.wide { width: min(860px, 100%); }
@keyframes pop { from { transform: translateY(14px) scale(.96); opacity: 0 } }
.modal-card header { display: flex; justify-content: space-between; align-items: center; padding: .9rem 1.3rem .5rem; border-bottom: 2px solid rgba(90, 60, 20, .35); } .modal-card header h2 { font-size: 2rem; color: #3a2410; }
.modal-card .x { background: none; border: 0; font-size: 1.3rem; color: #6b4a14; width: 36px; height: 36px; border-radius: 50%; } .modal-card .x:hover { background: rgba(90, 60, 20, .15); }
.modal-body { padding: 1rem 1.3rem; overflow: auto; }
.modal-card footer { display: flex; gap: .6rem; justify-content: flex-end; flex-wrap: wrap; padding: .8rem 1.3rem 1.1rem; border-top: 2px solid rgba(90, 60, 20, .25); }
.modal-card .btn { background: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(0, 0, 0, .05)), #e6d4a4; color: #4a300c; border-color: #8b6a28; } .modal-card .btn.primary { background: linear-gradient(180deg, #f6dd92, #c99a3e 60%, #a67a28); color: #261806; } .modal-card .btn.danger { background: linear-gradient(180deg, #c4493c, #8c241b); color: #ffe9e2; } .modal-card .btn.ghost { background: transparent; }
.modal-card .state-btns .sb, .modal-card .chip { color: inherit; }
.confirm-text { font-size: 1.1rem; }
#toasts { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 200; max-width: min(360px, calc(100vw - 2rem)); }
.toast { padding: .7rem 1rem; border-radius: 10px; background: #0f1f29; border: 1px solid var(--brass); box-shadow: var(--shadow); animation: slidein .25s; border-left: 5px solid var(--brass); } .toast.bad { border-left-color: var(--bad); } .toast.good { border-left-color: var(--good); } .toast.out { opacity: 0; transform: translateX(20px); transition: .5s; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0 } }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .two { grid-template-columns: 1fr; }
  .nameplate { position: relative; left: 0; top: 0; margin: .8rem; max-width: none; } .ship-hero .quirks { position: relative; max-width: none; justify-content: flex-start; right: 0; top: 0; margin: 0 .8rem .6rem; }
  .ship-hero { min-height: 0; } .wealth { grid-template-columns: 1fr; } .figurehead-slot { position: relative; right: auto; top: auto; margin: .6rem auto 0; }
  .doors { margin-top: -50px; }
}

.panel .quirks { display: flex; gap: .5rem; flex-wrap: wrap; }
.pin.ghost .pin-label { display: none; } .pin.ghost:hover .pin-label { display: block; }

/* ---------- photographic art (optional; see public/assets/README.md) ---------- */
.ship-pic.plate { width: min(640px, 94%); aspect-ratio: 3 / 2; margin-bottom: 1.2rem; border-radius: 6px; overflow: hidden; border: 10px solid #3b2812; outline: 2px solid var(--brass); box-shadow: 0 16px 36px rgba(0, 0, 0, .7), inset 0 0 0 2px #0008; position: relative; background: #000; }
.ship-pic.plate img { width: 100%; height: 100%; max-height: none; object-fit: cover; filter: sepia(.12) contrast(1.05) saturate(1.05); transform-origin: 50% 60%; animation: kenburns 28s ease-in-out infinite alternate; }
.ship-pic.plate::after { content: ""; position: absolute; inset: 0; box-shadow: inset 0 0 90px rgba(0, 0, 0, .55); pointer-events: none; }
@keyframes kenburns { from { transform: scale(1.02) } to { transform: scale(1.12) translate(-1.5%, -1%) } }
.reg-art .ship-pic.plate { width: 100%; height: 100%; margin: 0; border: 0; outline: 0; border-radius: 0; aspect-ratio: auto; }
.ship-stage .ship-pic.plate { width: 100%; margin-bottom: .6rem; }
.has-photo-hero .hero { background: var(--bg-hero) center / cover, linear-gradient(180deg, #02060b, #1d3f4c); }
.has-photo-hero .hero .stars, .has-photo-hero .hero .moon, .has-photo-hero .hero-ship { display: none; }
.has-photo-hero .hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(2, 6, 11, .55), rgba(2, 6, 11, .05) 40%, rgba(2, 6, 11, .7)); pointer-events: none; }
.has-photo-hero .hero-title, .has-photo-hero .hero-ship { z-index: 2; }
.has-photo-page body { background: linear-gradient(rgba(5, 12, 18, .86), rgba(5, 12, 18, .94)), var(--bg-page) center / cover fixed; }
.has-photo-paper .parchment, .has-photo-paper .log-entry, .has-photo-paper .member, .has-photo-paper .cx-card, .has-photo-paper .adv, .has-photo-paper .modal-card {
  background-image: linear-gradient(rgba(236, 221, 183, .55), rgba(220, 199, 149, .62)), var(--bg-parchment); background-size: cover; background-blend-mode: multiply; }
.slot-img { box-shadow: 0 0 0 2px var(--brass-d), 0 3px 8px #000; object-fit: cover; }
