/* SeaTrader — a counting-house ledger for players, a lacquered chart room for the board. */
:root {
  --paper: #f6eedb;
  --card: #fbf6e9;
  --ink: #2a2118;
  --muted: #75664f;
  --rule: #d9c9a3;
  --teak: #45291a;
  --teak-2: #5d3a24;
  --vermilion: #b3261e;
  --jade: #2f6b5a;
  --gold: #b08a2e;
  --sea: #cfdcd3;
  --land: #e9dcb8;
  --on-dark: #f6e7c4;
  --highlight: #e8b84a;
  --btn: #efe2c2;
  --btn-border: #c9b383;
  --tabs: #ead9b1;
  --input: #fffdf6;
  --board-bg: #1f1410;
  --board-panel: #2c1d15;
  --board-ink: #f1e4c3;
  --base-size: 16px;
  --radius: 8px;
  --title: "Uncial Antiqua", "Palatino Linotype", Palatino, Georgia, serif;
  --serif: "MedievalSharp", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: "Alegreya", "Palatino Linotype", Palatino, Georgia, serif;
  --special: "Almendra SC", "Palatino Linotype", Palatino, Georgia, serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; font-size: var(--base-size); font-synthesis: none; }
body { margin: 0; background: var(--paper); color: var(--ink); font: var(--base-size)/1.45 var(--sans); }
h1, h2 { font-family: var(--serif); font-weight: 700; margin: 0; letter-spacing: .01em; }
h2 { font-size: 1.25rem; margin-bottom: .5rem; }
p { margin: .4rem 0; }
.muted { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }
.loading { padding: 3rem; text-align: center; font-family: var(--special); }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chip { display: inline-block; width: .8rem; height: .8rem; border-radius: 2px; margin-right: .45rem; vertical-align: -1px; flex: none; }
.tag { font: 600 .68rem/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--gold);
       border: 1px solid currentColor; border-radius: 3px; padding: 2px 4px; margin-left: .3rem; white-space: nowrap; }
.tag.bad, .bad { color: var(--vermilion); }
.note { background: #f1e3bd; border-left: 4px solid var(--gold); padding: .5rem .75rem; border-radius: 0 4px 4px 0; }
.note.bad { border-color: var(--vermilion); color: var(--ink); }

/* buttons and inputs */
button { font: 600 .95rem/1.2 var(--sans); color: var(--teak); background: var(--btn); border: 1px solid var(--btn-border);
         border-radius: calc(var(--radius) * .75); padding: .6rem .9rem; min-height: 44px; cursor: pointer; }
button:hover:not(:disabled) { background: #e7d6ab; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--jade); outline-offset: 2px; }
button:disabled { opacity: .42; cursor: default; }
button.primary { background: var(--vermilion); border-color: #8c1c16; color: #fff7ea; }
button.primary:hover:not(:disabled) { background: #9c2019; }
button.ghost { background: transparent; }
button.wide { width: 100%; }
button.link { background: none; border: 0; min-height: 0; padding: 2px 4px; color: var(--jade); font-weight: 600;
              font-size: .82rem; text-decoration: underline; }
button.on { background: var(--teak); border-color: var(--teak); color: #fbf1d8; }
button.on:hover:not(:disabled) { background: var(--teak-2); }
input { font: 1rem var(--sans); width: 100%; min-height: 44px; padding: .5rem .65rem; color: var(--ink);
        background: var(--input); border: 1px solid var(--btn-border); border-radius: calc(var(--radius) * .75); }
label { display: block; font-weight: 600; margin: .7rem 0; }
label input { margin-top: .3rem; font-weight: 400; }
.row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.row input { flex: 1 1 8rem; width: auto; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.seg button { flex: 1 1 auto; }

/* masthead (join, lobby, end) */
.masthead { background: var(--teak); color: var(--on-dark); text-align: center; padding: 2.2rem 1rem 1.8rem;
            border-bottom: 4px double var(--gold); }
.masthead h1 { font-family: var(--title); font-weight: 400; font-size: 2.6rem; letter-spacing: .02em; }
.masthead h1 span { color: var(--highlight); font-style: normal; }
.masthead p { color: #d8c49a; font-family: var(--special); font-size: 1.1rem; margin: .2rem 0 0; }
main { max-width: 1040px; margin: 0 auto; padding: .9rem; }
main.narrow { max-width: 560px; }
.card { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; margin-bottom: .9rem;
        box-shadow: 0 1px 0 #fff inset, 0 1px 3px rgba(69, 41, 26, .08); }
.roster { list-style: none; margin: 0; padding: 0; }
.roster li { padding: .45rem 0; border-bottom: 1px dotted var(--rule); }
.roster li:last-child { border: 0; }

/* in-game header */
.bar { background: var(--teak); color: var(--on-dark); padding: .7rem .9rem .6rem; border-bottom: 3px double var(--gold); }
.where { display: flex; align-items: center; max-width: 1040px; margin: 0 auto .5rem; }
.where b { font: 700 1.2rem var(--serif); display: block; }
.where span { color: #d8c49a; font-size: .88rem; }
.where .chip { width: 1.1rem; height: 1.1rem; border: 1px solid var(--on-dark); }
.stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: .4rem; max-width: 1040px; margin: 0 auto; }
.stat { background: var(--teak-2); border-radius: 5px; padding: .3rem .5rem; min-width: 0; }
.stat span { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .07em; color: #cdb88c; }
.stat b { font-variant-numeric: tabular-nums; font-size: 1rem; white-space: nowrap; }
.stat.bad b { color: #ffb0a3; }
.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: .3rem; padding: .5rem .9rem; background: var(--tabs);
        border-bottom: 1px solid var(--btn-border); overflow-x: auto; justify-content: center; }
.tabs button { flex: 0 1 9rem; white-space: nowrap; }
.banner { display: flex; gap: .8rem; align-items: center; justify-content: space-between; background: var(--jade);
          color: #f1f7f2; padding: .7rem .9rem; }
.banner span { font-size: .9rem; opacity: .9; }
.banner button { color: #f1f7f2; border-color: #cfe3da; flex: none; }
.banner button:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
main.locked .card { opacity: .78; }
.offline { background: var(--vermilion); color: #fff; text-align: center; padding: .4rem; font-weight: 600; }

/* tables */
.grid { width: 100%; border-collapse: collapse; }
.grid th { font: 600 .7rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
           text-align: left; padding: .35rem .4rem; border-bottom: 2px solid var(--rule); }
.grid th.n { text-align: right; }
.grid td { padding: .5rem .4rem; border-bottom: 1px solid #eadfc2; vertical-align: middle; }
.grid tr.me td { background: #f3e7c6; }
.grid td.qty { width: 7.5rem; }
.grid td.do { white-space: nowrap; text-align: right; }
.grid td.do button { margin-left: .3rem; }
.mini { display: flex; gap: .4rem; justify-content: flex-end; margin-top: 2px; }
.est { font-size: .8rem; color: var(--jade); font-weight: 600; margin-top: 2px; }
.scroll { overflow-x: auto; }
.book td, .book th { font-size: .88rem; }
.log { margin: 0; padding-left: 1.1rem; }
.log li { margin: .35rem 0; }

/* fleet */
.ships { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .7rem; margin: .7rem 0; }
.ship { border: 1px solid var(--rule); border-radius: calc(var(--radius) * .75); padding: .7rem; background: #fffbf0; }
.shiphead { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.shiphead b { font-family: var(--serif); font-size: 1.1rem; }
.hull { height: 8px; background: #e4d6b2; border-radius: 4px; overflow: hidden; margin: .45rem 0 .2rem; }
.hull i { display: block; height: 100%; background: var(--jade); }
.hull i.low { background: var(--vermilion); }

/* destinations */
.dests { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .5rem; margin-top: .7rem; }
button.dest { text-align: left; display: flex; flex-direction: column; gap: 2px; font-weight: 400; }
button.dest b { font: 700 1.05rem var(--serif); }
button.dest.on .muted { color: #e2cfa2; }
.wx { font-weight: 700; }
.wx0, .wx1 { color: var(--jade); }
.wx2 { color: #a5670d; }
.wx3 { color: var(--vermilion); }
button.on .wx0, button.on .wx1 { color: #a9dcc8; }
button.on .wx2 { color: #f2c46b; }
button.on .wx3 { color: #ffa497; }

/* chart */
.chart { width: 100%; height: auto; display: block; border: 1px solid #b9a777; border-radius: calc(var(--radius) * .75); background: var(--sea); }
.chart .sea { fill: var(--sea); }
.chart .grat { stroke: #b4c7bd; stroke-width: 1; stroke-dasharray: 2 6; }
.chart .land { fill: var(--land); stroke: #a8956a; stroke-width: 1.5; stroke-linejoin: round; }
.chart .rose circle { fill: none; stroke: #9db3a8; stroke-width: 1.5; }
.chart .rose path { fill: #9db3a8; }
.chart .rose text { font: 700 14px var(--serif); fill: #7c958a; }
.chart .region { --wx: var(--jade); --halo: rgba(255, 251, 240, .9); }
.chart .region.wxt2 { --wx: #a5670d; }
.chart .region.wxt3 { --wx: var(--vermilion); }
.chart .region text { paint-order: stroke; stroke: var(--halo); stroke-width: 4px; stroke-linejoin: round; }
.chart .rname { font: italic 14px var(--serif); fill: #3d5c51; letter-spacing: .06em; }
.chart .rwx { font: 800 17px var(--sans); }
.chart .region .rwx { fill: var(--wx); }
.chart .rwx-icon * { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart .rwx-icon .halo * { stroke: var(--halo); stroke-width: 4; }
.chart .rwx-icon .ink * { stroke: var(--wx); stroke-width: 1.8; }
.chart .wxt0, .chart .wxt1 { fill: var(--jade); }
.chart .wxt2 { fill: #a5670d; }
.chart .wxt3 { fill: var(--vermilion); }
.chart .planned-route .route-halo { stroke: rgba(25, 20, 14, .7); stroke-width: 11; stroke-linecap: round; }
.chart .planned-route .route { stroke: var(--gold); stroke-width: 5; stroke-dasharray: 2 13; stroke-linecap: round; }
.chart .planned-route marker path { fill: var(--gold); stroke: var(--ink); stroke-width: 1; }
.chart .planned-route.wx2 .route, .chart .planned-route.wx3 .route { stroke: #d47b26; }
.chart .planned-route.wx2 marker path, .chart .planned-route.wx3 marker path { fill: #d47b26; }
.chart .planned-route.wx3 .route { stroke: var(--vermilion); }
.chart .planned-route.wx3 marker path { fill: var(--vermilion); }
.chart .route-alert rect { fill: #3c2a1d; stroke: #e2a84d; stroke-width: 2; }
.chart .route-alert.wxt3 rect { fill: #4f1d1c; stroke: #ff9a8c; }
.chart .route-alert .alert-icon { fill: none; stroke: #f2c46b; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .route-alert.wxt3 .alert-icon { stroke: #ffb0a4; }
.chart .route-alert text { text-anchor: start; fill: #fff8e8; stroke: none; }
.chart .route-alert .alert-kicker { font: 800 10px var(--sans); letter-spacing: .12em; }
.chart .route-alert .alert-weather { font: 800 17px var(--serif); }
.chart .port .hit { fill: transparent; }
.chart .port .label-leader { stroke: #7b6848; stroke-width: 2; }
.chart .port .label-bg { fill: rgba(255, 251, 240, .9); stroke: #aa9567; stroke-width: 1.5; filter: url(#chart-shadow); }
.chart .port .pulse { fill: none; stroke: none; }
.chart .port .ring { fill: rgba(255, 251, 240, .82); stroke: #6f5b3e; stroke-width: 2.5; }
.chart .port .dot { fill: var(--teak); stroke: #fffaf0; stroke-width: 3; }
.chart .port .port-name { font: 800 18px var(--serif); fill: var(--ink); letter-spacing: .01em; }
.chart .port .port-status { font: 800 9px var(--sans); fill: #6b5b43; letter-spacing: .14em; }
.chart .port.here .label-bg { fill: rgba(245, 227, 187, .96); stroke: var(--gold); stroke-width: 2.5; }
.chart .port.here .pulse { stroke: var(--gold); stroke-width: 4; opacity: .45; }
.chart .port.here .ring { fill: var(--gold); stroke: #fff3c6; stroke-width: 3.5; }
.chart .port.here .dot { fill: #362417; stroke-width: 3; }
.chart .port.dest .label-bg { fill: rgba(255, 244, 226, .97); stroke: var(--vermilion); stroke-width: 2.5; }
.chart .port.dest .pulse { stroke: var(--vermilion); stroke-width: 5; opacity: .42; }
.chart .port.dest .ring { fill: var(--vermilion); stroke: #fff3e5; stroke-width: 3.5; }
.chart .port.dest .dot { fill: #fff4de; stroke: var(--vermilion); }
.chart .port.dest .port-status { fill: var(--vermilion); }
.chart .port.ban .port-name { fill: var(--vermilion); }
.chart .port .current-flag line { stroke: #362417; stroke-width: 3; }
.chart .port .current-flag path { fill: var(--gold); stroke: #362417; stroke-width: 2; }
.chart .port.click { cursor: pointer; }
.chart .port.click:hover .label-bg { stroke: var(--gold); stroke-width: 3; }
.chart .port.click:hover .pulse { stroke: var(--gold); stroke-width: 4; opacity: .5; }
.chart .flag { filter: url(#chart-shadow); }
.chart .flag line { stroke: var(--ink); stroke-width: 2.2; }
.chart .flag path { stroke: #2a2118; stroke-width: 1.2; }
.chart .flag.mine path { stroke: #fff4cf; stroke-width: 2; }

/* modal and toast */
.veil { position: fixed; inset: 0; z-index: 20; background: rgba(42, 33, 24, .62); display: flex; align-items: center;
        justify-content: center; padding: 1rem; }
.modal { background: var(--card); border: 1px solid var(--gold); border-radius: var(--radius); padding: 1.3rem; width: 100%;
         max-width: 520px; max-height: 88vh; overflow: auto; box-shadow: 0 12px 40px rgba(0, 0, 0, .35); }
.eyebrow { font: .85rem var(--special); letter-spacing: .08em; text-transform: uppercase; color: var(--vermilion); margin: 0; }
#toast { visibility: hidden; position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%); z-index: 30; max-width: 92vw;
         background: var(--ink); color: #f6eedb; padding: .7rem 1.1rem; border-radius: calc(var(--radius) * .75); font-weight: 600;
         transition: transform .18s ease; pointer-events: none; text-align: center; }
#toast.show { visibility: visible; transform: translate(-50%, 0); }
#toast.bad { background: var(--vermilion); color: #fff; }

@media (max-width: 720px) {
  .stats { grid-template-columns: repeat(3, 1fr); }
  .tabs { justify-content: flex-start; padding: .45rem .5rem; }
  .tabs button { flex: 1 0 auto; padding: .55rem .7rem; }
  main { padding: .6rem; }
  .card { padding: .8rem; }
  .market thead { display: none; }
  .market tr { display: grid; grid-template-columns: 1fr auto auto; gap: 0 .6rem; padding: .55rem 0; border-bottom: 1px solid #eadfc2; }
  .market td { border: 0; padding: .15rem 0; }
  .market td:first-child { grid-column: 1; }
  .market td.qty { grid-column: 1; width: auto; }
  .market td.do { grid-column: 2 / 4; align-self: start; }
  .market td:nth-child(2)::before { content: "Price "; color: var(--muted); font-size: .75rem; }
  .market td:nth-child(3)::before { content: "Aboard "; color: var(--muted); font-size: .75rem; }
  .mini { justify-content: flex-start; }
  .masthead h1 { font-size: 2.1rem; }
}
@media (prefers-reduced-motion: reduce) { #toast { transition: none; } }

/* ------------------------------------------------------------ harbor board -- */
/* ------------------------------------------------- brand, artwork and ranks -- */
.logo { max-width: min(80vw, 520px); max-height: 5.5rem; display: block; margin: 0 auto; }
.gicon { width: 1.9rem; height: 1.9rem; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: .5rem; }
.shipart { width: 100%; max-height: 120px; object-fit: cover; border-radius: calc(var(--radius) * .5); margin-bottom: .5rem; }
.yardart { width: 3.2rem; height: 2.2rem; object-fit: cover; border-radius: 4px; vertical-align: middle; margin-right: .5rem; }
.portart { width: 100%; max-height: 190px; object-fit: cover; border-radius: calc(var(--radius) * .75); margin-bottom: .7rem; display: block; }
.rankname { font: .85rem var(--special); color: var(--gold); white-space: nowrap; }
.bar .rankname { color: var(--highlight); margin-left: .5rem; font-size: .95rem; }

/* voices: who is speaking, and the speaker button */
#voicebox { display: contents; }
#mute { position: fixed; left: .8rem; bottom: .8rem; z-index: 25; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--gold); background: var(--card); font-size: 1.15rem;
        line-height: 1; padding: 0; cursor: pointer; box-shadow: 0 3px 12px rgba(0,0,0,.25); }
#mute.off { opacity: .6; }
#mute[hidden] { display: none; }
#speaking { position: fixed; top: .6rem; left: 50%; transform: translateX(-50%); z-index: 26; display: flex; align-items: center; gap: .6rem; background: var(--teak); color: var(--on-dark); border: 1px solid var(--who, var(--gold));
            border-left: 5px solid var(--who, var(--gold)); border-radius: var(--radius); padding: .45rem .8rem .45rem .45rem;
            box-shadow: 0 6px 22px rgba(0,0,0,.35); max-width: min(92vw, 26rem); animation: voiceIn .25s ease-out; }
#speaking[hidden] { display: none; }
/* The join, Set the terms and end screens (thresholds.js) have their own on-screen persona, so no floating speaker card drops over them. */
body.threshold-screen #speaking { display: none; }
#speaking img, #speaking i { flex: none; width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; object-position: 50% 20%;
                             border: 2px solid var(--who, var(--gold)); }
#speaking i { display: grid; place-items: center; font: 700 1.05rem var(--serif); font-style: normal; background: var(--who, var(--gold)); color: #fff; }
#speaking b { display: block; font-family: var(--serif); font-size: 1rem; line-height: 1.15; }
#speaking span { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
#speaking em { display: flex; align-items: flex-end; gap: 2px; height: 1.1rem; margin-left: .2rem; }
#speaking em s { display: block; width: 3px; height: 30%; background: var(--who, var(--gold)); border-radius: 2px; animation: voiceBar .9s ease-in-out infinite; }
#speaking em s:nth-child(2) { animation-delay: .15s; } #speaking em s:nth-child(3) { animation-delay: .3s; } #speaking em s:nth-child(4) { animation-delay: .45s; }
@keyframes voiceBar { 0%, 100% { height: 25%; } 50% { height: 100%; } }
@keyframes voiceIn { from { opacity: 0; margin-top: -8px; } }
body.board #speaking { top: auto; bottom: 2.4em; left: auto; right: 1.6em; transform: none; }
body.board #speaking { padding: .7rem 1.2rem .7rem .7rem; max-width: 40rem; }
body.board #speaking img, body.board #speaking i { width: 5rem; height: 5rem; font-size: 1.7rem; }
body.board #speaking b { font-size: 1.6rem; } body.board #speaking span { font-size: .9rem; }
/* the speaker card: a large picture or clip from the Media Library while a line is read */
#speaking .sp-art { flex: none; width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; object-position: 50% 20%;
                    border: 2px solid var(--who, var(--gold)); background: #000; }
#speaking.card { flex-direction: column; align-items: stretch; text-align: center; gap: .35rem; padding: .45rem; width: min(80vw, 15rem); }
#speaking.card .sp-art { width: 100%; height: auto; aspect-ratio: 3 / 4; max-height: 46vh; border-radius: calc(var(--radius) * .6); border-width: 0; }
#speaking.card > div { padding: 0 .3rem; }
#speaking.card em { justify-content: center; margin: 0; height: .8rem; }
body.board #speaking .sp-art { width: 5rem; height: 5rem; }
body.board #speaking.card { width: min(30vw, 24rem); }
body.board #speaking.card .sp-art { width: 100%; height: auto; max-height: 62vh; }
.mfade { animation: mfade .6s ease-out; }
@keyframes mfade { from { opacity: 0; } }
video.portart, video.shipart { background: #000; }
@media (prefers-reduced-motion: reduce) { #speaking, #speaking em s, .mfade { animation: none; } }

/* ------------------------------------------------------------ lettering -- */
/* Four roles, set under Admin > Look & Style: --title (game name), --serif (name headers),
   --sans (general text) and --special (taglines, ranks, log heading, board headline). */

/* Names in the game title font (16 Nov 2026). House, ship and port names
   follow Admin > Look & Style > Game title font. Uncial Antiqua has one
   weight, so these are set to 400 (faux bold is off). */
.roster li > b, .hname,
.chart .port .port-name { font-family: var(--title); font-weight: 400; }

/* Join screen: saved Captains (Admin > Captains). */
main.narrow.cap-join { max-width: 760px; }
.cap-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: .7rem; margin-top: .6rem; }
.cap-tile { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .55rem .4rem .7rem; min-height: 0;
  background: var(--input); border: 1px solid var(--rule); border-radius: var(--radius); cursor: pointer; text-align: center; }
.cap-tile:hover, .cap-tile:focus-visible { border-color: var(--gold); box-shadow: 0 4px 14px rgba(69,41,26,.18); }
.cap-tile b { font-family: var(--serif); font-size: 1.02rem; color: var(--ink); line-height: 1.15; }
.cap-tile small { color: var(--muted); font-size: .78rem; line-height: 1.2; }
.cap-tile.guest { border-style: dashed; }
.cap-face { width: 100%; aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 35%, var(--deck-oxblood) 0%, var(--deck-night) 80%); }
.cap-face img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.cap-face b { font: 700 2.2rem var(--serif); color: var(--on-dark); }
.cap-face.big { width: 120px; flex: none; }
.cap-chosen { display: flex; gap: 1rem; align-items: flex-start; margin: .3rem 0 .8rem; }
.cap-chosen h3 { font-family: var(--serif); font-size: 1.4rem; margin: 0 0 .2rem; }
.cap-chosen label { display: block; margin-top: .6rem; }
.cap-chosen input { font-size: 1.3rem; letter-spacing: .3em; max-width: 12rem; }
.cap-label { font-weight: 600; margin: .4rem 0 .35rem; }
.cap-houses { display: grid; gap: .45rem; margin-bottom: .8rem; }
.cap-house { display: flex; align-items: center; gap: .65rem; text-align: left; padding: .45rem .6rem; min-height: 0;
  background: var(--input); border: 2px solid var(--rule); border-radius: var(--radius); cursor: pointer; }
.cap-house.on { border-color: var(--hc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--hc) 30%, transparent); }
.cap-house b { display: block; font-family: var(--serif); }
.cap-house small { color: var(--muted); font-style: italic; }
.cap-crest { width: 2.6rem; height: 2.6rem; border-radius: 50%; overflow: hidden; flex: none; display: grid; place-items: center;
  background: var(--hc); border: 2px solid var(--hc); color: #fff7ea; font: 700 .9rem var(--serif); }
.cap-crest img { width: 100%; height: 100%; object-fit: cover; }
.cap-typed summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.cap-typed[open] summary { margin-bottom: .6rem; }
@media (max-width: 520px) { .cap-face.big { width: 88px; } }

/* ================================================ HOUSE CRESTS & CAPTAIN PORTRAITS (17 Nov 2026) == */
/* A House's crest from the Media Library stands where its colour chip used to: bare, no frame, the whole
   picture shown (17 Nov 2026: frame, rounding and backing removed at Anthony's request). */
.crest { display: inline-block; flex: none; width: 1.6rem; height: 1.6rem; margin-right: .5rem; vertical-align: middle;
  object-fit: contain; border-radius: 0; background: none; box-shadow: none; }
.roster li .crest { width: 1.9rem; height: 1.9rem; }
.pt-chip .crest { width: 1.1rem; height: 1.1rem; margin-right: .35rem; }
