/* The Hearsay Sea. One look throughout: ink and thin watercolour on old parchment, lit by a candle. */
@font-face { font-family: 'IM Fell English'; src: url(../fonts/fell.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'IM Fell English'; font-style: italic; src: url(../fonts/fell-italic.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'IM Fell English SC'; src: url(../fonts/fell-sc.woff2) format('woff2'); font-display: swap; }

:root {
  --ink: #2b2118; --ink2: rgba(43, 33, 24, .72); --paper: #e9d8b0; --paper2: #f3e7c6; --madder: #a23b2a; --madder2: #7c2a1d;
  --ochre: #b8862d; --sea: #4f7d74; --indigo: #2f4a6b; --graphite: #5d574f; --desk: #231a12;
  --sc: 'IM Fell English SC', 'IM Fell English', Georgia, serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--desk); color: var(--ink);
  font: 17px/1.35 'IM Fell English', Georgia, serif; -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent; }
canvas#map { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: default; }
[hidden] { display: none !important; }
img.eng { mix-blend-mode: multiply; }
h1, h2, h3 { font-family: var(--sc); font-weight: normal; margin: 0; letter-spacing: .04em; }
p { margin: .5em 0; }
em { font-style: italic; }

/* ---------- paper ---------- */
/* isolation: the engravings multiply onto their own sheet of paper, never onto the live chart behind it (which
   would make the browser re-blend them every frame the chart moves) */
.slip, .panel, .card, #tip, #buttons .btn { isolation: isolate; }
.slip, .panel, .card { background: var(--paper) url(../img/parchment.jpg) center / 640px; color: var(--ink); }
.slip { border: 1px solid rgba(43, 33, 24, .55); box-shadow: 0 3px 14px rgba(0, 0, 0, .45), inset 0 0 0 3px rgba(243, 231, 198, .5), inset 0 0 0 4px rgba(43, 33, 24, .18); border-radius: 2px; }
.panel { border: 1px solid rgba(43, 33, 24, .7); border-radius: 3px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, .6), inset 0 0 0 6px rgba(243, 231, 198, .45), inset 0 0 0 7px rgba(43, 33, 24, .3), inset 0 0 60px rgba(120, 84, 30, .18); }

.btn { font: 17px/1 var(--sc); letter-spacing: .05em; color: var(--ink); background: rgba(255, 249, 228, .5); border: 1.5px solid var(--ink2);
  padding: 9px 18px 10px; border-radius: 2px; cursor: pointer; transition: background .12s, color .12s, transform .08s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--ink); color: var(--paper2); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .42; cursor: default; }
.btn.red { background: var(--madder); color: #f8eccf; border-color: var(--madder2); box-shadow: 0 2px 0 var(--madder2), 0 4px 10px rgba(0, 0, 0, .3); }
.btn.red:hover:not(:disabled) { background: #b9432f; color: #fff6dc; }
.btn.big { font-size: 21px; padding: 13px 28px 14px; }
.btn.small { font-size: 15px; padding: 6px 11px 7px; }
.btn em { font-style: normal; opacity: .7; }
.coin { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; font-family: var(--sc); }
.coin::before { content: ''; width: 1.05em; height: 1.05em; background: url(../img/i/coin.webp) center / contain no-repeat; display: inline-block; }

/* ---------- heads-up ---------- */
#hud > * { position: fixed; z-index: 5; will-change: transform; }      /* their own layers: the chart repaints every frame, these should not */
#plaque { top: 12px; left: 12px; display: flex; gap: 4px; padding: 6px 10px 5px; }
.stat { display: flex; align-items: baseline; gap: 3px; padding: 0 8px 0 2px; position: relative; }
.stat + .stat { border-left: 1px solid rgba(43, 33, 24, .2); padding-left: 8px; }
.stat img { width: 34px; height: 34px; align-self: center; }
.stat b { font: 27px/1 var(--sc); font-weight: normal; min-width: .6em; text-align: right; transition: color .2s; }
.stat i { font-style: normal; opacity: .55; font-size: 15px; }
.stat span { font-size: 13px; opacity: .6; font-style: italic; margin-left: 2px; }
.stat.low b { color: var(--madder); }
.stat b { display: inline-block; }
.stat.bump b { animation: bump .35s; }
@keyframes bump { 30% { transform: scale(1.22); } }
#folio { top: 68px; left: 12px; padding: 6px 12px 7px; font-size: 15px; max-width: 360px; }
#folio b { font: 19px var(--sc); font-weight: normal; }
#folio .worth { color: var(--madder2); }
#rankbox { top: 12px; right: 12px; display: flex; gap: 8px; align-items: center; padding: 6px 12px 6px 8px; min-width: 210px; }
#rankbox img { width: 40px; height: 40px; }
#rankname { font: 18px/1.1 var(--sc); }
#rankbar { height: 5px; background: rgba(43, 33, 24, .16); margin: 4px 0 2px; width: 150px; }
#rankbar u { display: block; height: 100%; background: var(--sea); width: 0; transition: width .6s; }
#ranknext { font-size: 13.5px; opacity: .7; font-style: italic; }
#buttons { top: 74px; right: 12px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; max-width: 560px; }
#buttons .btn { background: var(--paper) url(../img/parchment.jpg) center / 500px; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
#buttons .btn:hover { background: var(--ink); }
#buttons .btn.red { background: var(--madder); }
#gauge { left: 12px; bottom: 12px; padding: 6px 12px 7px; font-size: 15px; }
#gauge b { font: 18px var(--sc); font-weight: normal; }
#gauge.warn { background: #e2c283; }
#gauge.bad { background: var(--madder); color: #f8eccf; animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(162, 59, 42, .35), 0 3px 14px rgba(0, 0, 0, .45); } }
#context { left: 50%; bottom: 12px; transform: translateX(-50%); padding: 7px 16px 8px; max-width: min(640px, 60vw); text-align: center; font-size: 15.5px; pointer-events: none; }
#context b { font: 18px var(--sc); font-weight: normal; }
#context .cost { color: var(--indigo); white-space: nowrap; }
#context .bad { color: var(--madder); }
#tip { left: 12px; top: 116px; max-width: min(430px, 40vw); width: max-content; cursor: pointer; padding: 12px 18px 13px 62px; font-size: 16.5px; line-height: 1.32;
  background: var(--paper2) url(../img/parchment.jpg) center / 500px; border: 1px solid rgba(43, 33, 24, .6); box-shadow: 0 6px 24px rgba(0, 0, 0, .5); border-radius: 2px;
  animation: tipin .5s both; }
#tip::before { content: ''; position: absolute; left: 10px; top: 50%; width: 44px; height: 44px; margin-top: -22px; background: url(../img/i/seal.webp) center / contain no-repeat; }
#tip b { font-family: var(--sc); font-weight: normal; }
#tip::after { content: '×'; position: absolute; right: 7px; top: 1px; font: 18px var(--sc); opacity: .45; }
#tip:hover::after { opacity: 1; }
@keyframes tipin { from { opacity: 0; transform: translateY(-12px); } }

#toasts { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { padding: 6px 16px 7px; background: rgba(43, 33, 24, .9); color: var(--paper2); border-radius: 2px; font-size: 16px; animation: toast 2.6s both; white-space: nowrap; }
.toast.good { background: rgba(60, 96, 86, .95); }
.toast.bad { background: rgba(140, 45, 30, .96); }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 8%, 78% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-10px); } }

/* ---------- overlays ---------- */
#layer > * { position: fixed; z-index: 60; }
.veil { inset: 0; background: rgba(20, 12, 5, .55); display: grid; place-items: center; animation: fade .25s both; padding: 12px; }
.veil.clear { background: rgba(20, 12, 5, .18); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

/* the draft */
#draft { left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; padding: 70px 10px 14px; pointer-events: none;
  background: linear-gradient(to top, rgba(20, 12, 5, .78) 0%, rgba(20, 12, 5, .62) 62%, rgba(20, 12, 5, 0) 100%); animation: fade .3s both; }
#draft > * { pointer-events: auto; }
#draft .ask { font: 22px var(--sc); color: var(--paper2); text-shadow: 0 2px 8px #000, 0 0 22px #000; margin-bottom: 22px; text-align: center; }
#draft .ask small { display: block; font: italic 15px 'IM Fell English', serif; opacity: .85; }
.cards { display: flex; gap: 14px; align-items: flex-end; justify-content: center; }
.card { width: 198px; min-height: 282px; padding: 9px 11px 10px; border: 1px solid rgba(43, 33, 24, .7); border-radius: 4px; cursor: pointer; position: relative; text-align: center;
  box-shadow: 0 8px 26px rgba(0, 0, 0, .55), inset 0 0 0 4px rgba(243, 231, 198, .5), inset 0 0 0 5px rgba(43, 33, 24, .22);
  transition: transform .14s, box-shadow .14s; animation: rise .4s both; display: flex; flex-direction: column; }
.card:nth-child(2) { animation-delay: .07s; } .card:nth-child(3) { animation-delay: .14s; } .card:nth-child(4) { animation-delay: .21s; }
.card:hover, .card.hot { transform: translateY(-12px) rotate(-.6deg); box-shadow: 0 18px 36px rgba(0, 0, 0, .6), inset 0 0 0 4px rgba(243, 231, 198, .5), inset 0 0 0 5px rgba(162, 59, 42, .55); }
.card.blind { filter: saturate(.5); }
.card.blind .art img { opacity: .8; }
.card .src { font: 12px var(--sc); letter-spacing: .08em; text-transform: uppercase; opacity: .6; text-align: left; padding-left: 2px; }
.card.rumour .src { color: var(--madder2); opacity: 1; }
.card .art { height: 112px; display: grid; place-items: center; margin: 2px 0; }
.card .art img { height: 112px; width: 112px; object-fit: contain; }
.card h3 { font-size: 20px; line-height: 1.05; margin: 2px 0 4px; }
.card .rule { font-size: 14.5px; line-height: 1.22; flex: 1; }
.card .kin { font-style: italic; opacity: .8; }
#commline { top: 112px; right: 12px; padding: 5px 12px 6px; font-size: 14.5px; max-width: 360px; text-align: right; }
#commline b { font-family: var(--sc); font-weight: normal; }
.card .why { font-size: 12.5px; line-height: 1.2; color: var(--madder2); margin-top: 4px; }
.card .say { font-size: 13px; line-height: 1.2; font-style: italic; opacity: .72; margin-top: 5px; }
.card .worth { position: absolute; top: -11px; right: -9px; min-width: 44px; height: 44px; border-radius: 50%; background: var(--madder); color: #f8eccf; font: 20px/44px var(--sc); text-align: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5), inset 0 0 0 2px rgba(248, 236, 207, .35); padding: 0 6px; }
.card .harm { align-self: center; white-space: nowrap; padding: 2px 9px 3px; margin: 0 0 5px; background: var(--ink); color: var(--paper2); font: 13px var(--sc); border-radius: 2px; }
.card .key { position: absolute; bottom: 3px; right: 7px; font: 12px var(--sc); opacity: .35; }
#draft .under { margin-top: 10px; display: flex; gap: 10px; align-items: center; }
#draft .under .btn { background: var(--paper) url(../img/parchment.jpg) center / 500px; }
#draft .under .btn:hover:not(:disabled) { background: var(--ink); }

/* wind rose for choosing a heading */
#rose { width: 0; height: 0; }
#rose .hint { position: absolute; left: -160px; width: 320px; top: 118px; text-align: center; font: 20px var(--sc); color: var(--paper2); text-shadow: 0 2px 8px #000, 0 0 20px #000; pointer-events: none; }
#rose button { position: absolute; width: 46px; height: 46px; margin: -23px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--paper2); cursor: pointer; font-size: 22px; line-height: 1;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5); transition: transform .1s, background .1s; color: var(--ink); padding: 0; }
#rose button:hover { background: var(--madder); color: #fff3d6; transform: scale(1.15); }
#rose button span { display: block; }

/* events, wonders, dialogs */
.dialog { width: min(560px, 94vw); padding: 22px 28px 22px; text-align: center; animation: rise .35s both; max-height: 94vh; overflow: auto; }
.dialog .art { height: 150px; margin: -4px 0 4px; }
.dialog .art img { height: 150px; }
.dialog h2 { font-size: 30px; margin-bottom: 6px; }
.dialog .text { font-size: 18.5px; line-height: 1.38; margin: 8px 4px 14px; text-wrap: pretty; }
.dialog .result { font-size: 18.5px; font-style: italic; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { text-align: left; white-space: normal; padding: 10px 14px 11px; font-size: 18px; display: block; width: 100%; }
.opt small { display: block; font: italic 14.5px 'IM Fell English', serif; opacity: .78; margin-top: 3px; letter-spacing: 0; }
.notes { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 10px 0 14px; }
.note { padding: 3px 10px 4px; border: 1px solid var(--ink2); border-radius: 2px; font: 15px var(--sc); background: rgba(255, 249, 228, .5); }
.note.good { border-color: var(--sea); color: #2c5a50; } .note.bad { border-color: var(--madder); color: var(--madder2); }

.wonder { width: min(760px, 96vw); padding: 20px 30px 24px; text-align: center; animation: rise .6s both; max-height: 96vh; overflow: auto; }
.wonder .kicker { font: 15px var(--sc); letter-spacing: .3em; text-transform: uppercase; color: var(--madder2); }
.wonder h2 { font-size: 44px; line-height: 1.05; margin: 2px 0 0; }
.wonder .pic { height: min(42vh, 380px); margin: 0 0 2px; }
.wonder .pic img { height: min(42vh, 380px); width: auto; max-width: 100%; object-fit: contain; animation: bloom 1.6s both; }
@keyframes bloom { from { opacity: 0; transform: scale(.9); } }
.wonder .lore { font-size: 19px; font-style: italic; margin: 6px auto 12px; max-width: 560px; text-wrap: pretty; }
.wonder .boon { display: inline-block; padding: 8px 18px 9px; border: 1px solid var(--ink2); margin-bottom: 14px; background: rgba(255, 249, 228, .45); }
.wonder .boon b { font: 19px var(--sc); font-weight: normal; }
.picture { width: min(860px, 96vw); padding: 0 0 22px; text-align: center; overflow: hidden; animation: rise .5s both; max-height: 96vh; overflow-y: auto; }
.picture > img { width: 100%; display: block; border-bottom: 1px solid var(--ink2); max-height: 52vh; object-fit: cover; }
.picture h2 { font-size: 38px; margin: 14px 0 0; }
.picture .text { font-size: 18.5px; margin: 6px 34px 14px; text-wrap: pretty; }
.picture .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* publishing */
#publish { top: 0; right: 0; bottom: 0; width: min(340px, 46vw); padding: 14px; display: flex; flex-direction: column; justify-content: center; pointer-events: none; }
#publish .panel { padding: 14px 16px 16px; pointer-events: auto; animation: rise .35s both; display: flex; flex-direction: column; max-height: 92vh; }
#publish h2 { font-size: 23px; text-align: center; }
#publish h2 small { display: block; font: italic 15px 'IM Fell English', serif; letter-spacing: 0; opacity: .75; }
#publish .list { overflow: auto; margin: 8px 0; flex: 1 1 auto; min-height: 60px; max-height: 38vh; border-top: 1px solid rgba(43, 33, 24, .25); border-bottom: 1px solid rgba(43, 33, 24, .25); padding: 4px 0; scrollbar-width: thin; }
#publish .line { display: flex; justify-content: space-between; gap: 8px; font-size: 15.5px; padding: 1px 2px; animation: rise .25s both; }
#publish .line b { font: 17px var(--sc); font-weight: normal; }
#publish .line.curio { font-style: italic; }
#publish .sum { display: flex; justify-content: space-between; font-size: 16.5px; padding: 1px 2px; }
#publish .sum b { font: 19px var(--sc); font-weight: normal; }
#publish .total { text-align: center; font: 34px/1.1 var(--sc); margin: 8px 0 2px; color: var(--madder2); }
#publish .total small { display: block; font: italic 14px 'IM Fell English', serif; color: var(--ink); opacity: .7; }
#publish .extra { text-align: center; font-size: 15.5px; margin: 3px 0; animation: rise .3s both; }
#publish .extra b { font-family: var(--sc); font-weight: normal; }
#publish .rankup { text-align: center; font: 21px var(--sc); color: #2c5a50; margin: 6px 0; animation: rise .4s both; }
#publish .btn { margin-top: 10px; }
.banner { top: 7%; left: 50%; transform: translateX(-50%); font: 42px var(--sc); color: var(--paper2); text-shadow: 0 3px 12px #000, 0 0 40px #000; padding: 6px 44px 10px; background: radial-gradient(closest-side, rgba(20, 12, 5, .7), rgba(20, 12, 5, 0)); letter-spacing: .08em; text-align: center; pointer-events: none; animation: rise .5s both; white-space: nowrap; }
.banner small { display: block; font: italic 19px 'IM Fell English', serif; letter-spacing: 0; opacity: .9; }

/* the port */
.port { width: min(1020px, 97vw); height: min(680px, 95vh); display: flex; flex-direction: column; overflow: hidden; animation: rise .4s both; }
.port header { height: 136px; flex: none; background: url(../img/harbour.jpg) center 62% / cover; position: relative; border-bottom: 1px solid var(--ink2); }
.port header::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(233, 216, 176, .92) 0%, rgba(233, 216, 176, .55) 34%, rgba(233, 216, 176, 0) 60%); }
.port header div { position: absolute; left: 26px; top: 20px; z-index: 1; }
.port header.outport { background-position: 30% 62%; filter: sepia(.35) saturate(.8); }
.port header.wonderport { background: none; }
.port header.wonderport::after { display: none; }
.port header.wonderport > img { position: absolute; right: 150px; top: -14px; height: 190px; }
.port header h2 { font-size: 40px; line-height: 1; }
.port header p { margin: 4px 0 0; font-style: italic; font-size: 16.5px; }
.port header .purse { left: auto; right: 18px; top: auto; bottom: 10px; padding: 4px 12px 5px; font-size: 21px; }
.tabs { display: flex; gap: 0; padding: 0 16px; border-bottom: 1px solid rgba(43, 33, 24, .35); flex: none; background: rgba(120, 84, 30, .1); overflow-x: auto; }
.tab { font: 18px var(--sc); letter-spacing: .05em; padding: 9px 16px 8px; border: 0; background: none; cursor: pointer; color: var(--ink); opacity: .6; border-bottom: 3px solid transparent; white-space: nowrap; position: relative; }
.tab:hover { opacity: 1; }
.tab.on { opacity: 1; border-bottom-color: var(--madder); }
.tab .pip { position: absolute; top: 5px; right: 3px; width: 9px; height: 9px; border-radius: 50%; background: var(--madder); }
.port .body { flex: 1; overflow: auto; padding: 14px 22px 10px; scrollbar-width: thin; }
.port footer { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 22px 14px; border-top: 1px solid rgba(43, 33, 24, .3); }
.port footer .ship { font-size: 15.5px; font-style: italic; opacity: .85; }
.port footer .ship b { font: 18px var(--sc); font-weight: normal; font-style: normal; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.item { display: flex; gap: 10px; padding: 9px 11px 10px; border: 1px solid rgba(43, 33, 24, .35); background: rgba(255, 249, 228, .32); border-radius: 2px; align-items: center; min-height: 86px; }
.item > img { width: 66px; height: 66px; flex: none; object-fit: contain; }
.item .what { flex: 1; min-width: 0; }
.item h4 { font: 19px/1.1 var(--sc); margin: 0 0 2px; font-weight: normal; }
.item h4 small { font: italic 14px 'IM Fell English', serif; opacity: .7; letter-spacing: 0; display: block; margin-top: 1px; }
.item p { margin: 0; font-size: 14.5px; line-height: 1.22; }
.item p.say { font-style: italic; opacity: .7; font-size: 13.5px; margin-top: 2px; }
.item .btn { flex: none; }
.item.sold { opacity: .45; }
.item.owned { border-color: var(--sea); background: rgba(79, 125, 116, .12); }
.item.active { border-color: var(--madder); background: rgba(162, 59, 42, .09); }
.steps { display: flex; gap: 3px; margin-top: 4px; }
.steps u { width: 14px; height: 5px; background: rgba(43, 33, 24, .18); }
.steps u.on { background: var(--sea); }
.sec { font: 20px var(--sc); margin: 14px 0 6px; border-bottom: 1px solid rgba(43, 33, 24, .25); padding-bottom: 2px; display: flex; justify-content: space-between; align-items: baseline; }
.sec:first-child { margin-top: 0; }
.sec small { font: italic 14.5px 'IM Fell English', serif; opacity: .7; letter-spacing: 0; }
.lede { font-size: 16.5px; font-style: italic; margin: 0 0 10px; opacity: .85; }
.comm { display: flex; align-items: center; gap: 12px; padding: 7px 4px; border-bottom: 1px dotted rgba(43, 33, 24, .3); font-size: 16.5px; }
.comm .bar { width: 90px; height: 6px; background: rgba(43, 33, 24, .16); flex: none; }
.comm .bar u { display: block; height: 100%; background: var(--sea); }
.comm .what { flex: 1; }
.wrow { display: flex; align-items: center; gap: 12px; padding: 6px 4px; border-bottom: 1px dotted rgba(43, 33, 24, .3); }
.wrow img { width: 58px; height: 58px; object-fit: contain; }
.wrow.unfound img { filter: grayscale(1) contrast(.5) brightness(1.3) blur(1.5px); opacity: .55; }
.wrow .what { flex: 1; font-size: 15px; }
.wrow h4 { font: 19px var(--sc); margin: 0; font-weight: normal; }
.swatch { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
table.reg { width: 100%; border-collapse: collapse; font-size: 16px; }
table.reg td { padding: 3px 6px; border-bottom: 1px dotted rgba(43, 33, 24, .25); }
table.reg td:first-child { width: 2.2em; opacity: .6; text-align: right; }
table.reg td:last-child { text-align: right; font-family: var(--sc); }
table.reg tr.me td { background: rgba(162, 59, 42, .12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip .chiptext { max-width: 250px; line-height: 1.2; }
.chip { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid rgba(43, 33, 24, .4); background: rgba(255, 249, 228, .35); border-radius: 2px; font-size: 15px; }
.chip img { width: 40px; height: 40px; }
.chip .x { border: 0; background: none; cursor: pointer; font: 15px var(--sc); color: var(--madder2); padding: 2px 4px; margin-left: 2px; }
.chip .x:hover { text-decoration: underline; }
.quay { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.quay ul { margin: 4px 0; padding-left: 20px; font-size: 16px; }
.quay li { margin: 3px 0; }
.sheet { width: min(620px, 95vw); max-height: 92vh; overflow: auto; padding: 18px 24px 20px; animation: rise .3s both; }
.sheet h2 { font-size: 28px; text-align: center; margin-bottom: 6px; }
.sheet .close { position: sticky; float: right; top: 0; }
.sheet label { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: 17px; }
.sheet input[type=range] { flex: 1; accent-color: var(--madder); }
.reward .cards { margin: 12px 0 6px; flex-wrap: wrap; align-items: stretch; }
.reward .card { min-height: 250px; }
.center { text-align: center; }

input.field { display: block; width: 100%; font: 22px 'IM Fell English', serif; padding: 8px 10px; border: 0; border-bottom: 1.5px solid var(--ink); background: rgba(255, 250, 232, .6); color: var(--ink); outline: none; text-align: center; user-select: text; -webkit-user-select: text; }
.gaz { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 6px; }
.gz { text-align: center; font-size: 12.5px; line-height: 1.1; padding: 4px 2px 6px; border: 1px solid rgba(43, 33, 24, .2); background: rgba(255, 249, 228, .3); }
.gz img, .gz svg { width: 62px; height: 62px; display: block; margin: 0 auto; }
.gz.unknown { border-style: dashed; opacity: .55; font-style: italic; }
.gz b { display: block; font: italic 34px/62px 'IM Fell English', serif; font-weight: normal; color: var(--graphite); }
.gz span { display: block; }
#starve { position: fixed; inset: 0; pointer-events: none; z-index: 4; box-shadow: inset 0 0 160px 40px rgba(140, 30, 14, .55); opacity: 0; transition: opacity .8s; }
#starve.on { opacity: 1; animation: starve 1.6s infinite; }
@keyframes starve { 50% { box-shadow: inset 0 0 200px 60px rgba(140, 30, 14, .7); } }

textarea.share { width: 100%; font: 15px/1.3 'IM Fell English', serif; background: rgba(255, 250, 232, .6); border: 1px solid var(--ink2); padding: 8px; color: var(--ink); resize: none; height: 64px; margin: 10px 0 4px; user-select: text; -webkit-user-select: text; }

/* ---------- title ---------- */
#title { position: fixed; inset: 0; z-index: 50; background: #cdc5b6; display: grid; transition: opacity .9s; }
#title.gone { opacity: 0; pointer-events: none; }
#title-art { position: absolute; inset: 0; background: url(../img/title.jpg) left center / cover; }
#title-box { position: absolute; right: 7vw; top: 50%; transform: translateY(-50%); width: min(430px, 86vw); text-align: center; }
#title h1 { font-size: clamp(46px, 6.2vw, 84px); line-height: .95; letter-spacing: .03em; color: var(--ink); text-shadow: 0 0 22px rgba(243, 231, 198, .9), 0 0 6px rgba(243, 231, 198, .9); }
#title h1 small { display: block; font-size: .5em; letter-spacing: .3em; }
#title .tag { font-style: italic; font-size: 21px; margin: 12px 0 22px; text-shadow: 0 0 12px rgba(243, 231, 198, 1); }
#title label { display: block; text-align: left; font: 15px var(--sc); letter-spacing: .08em; margin: 0 auto 12px; width: 300px; max-width: 100%; }
#title .row { display: flex; gap: 6px; }
#title input { display: block; width: 100%; font: 20px 'IM Fell English', serif; padding: 6px 10px 7px; border: 0; border-bottom: 1.5px solid var(--ink); background: rgba(255, 250, 232, .6); color: var(--ink); outline: none; border-radius: 0; user-select: text; -webkit-user-select: text; }
#title input:focus { background: rgba(255, 250, 232, .9); }
#title .btn { margin-top: 8px; }
#b-daily { margin-top: 16px !important; background: rgba(255, 249, 228, .75); }
#b-daily small { display: block; font: italic 13.5px 'IM Fell English', serif; letter-spacing: 0; margin-top: 3px; opacity: .8; }
#title .fine { font-size: 15.5px; font-style: italic; opacity: .8; margin-top: 16px; }
#title-box::before { content: ''; position: absolute; inset: -40px -50px; background: radial-gradient(closest-side, rgba(243, 232, 204, .9) 55%, rgba(243, 232, 204, 0)); z-index: -1; }
#title-continue p { font-size: 17px; font-style: italic; text-shadow: 0 0 12px rgba(243, 231, 198, 1); }
#title-continue .btn { display: block; margin: 8px auto; }

/* ---------- small windows ---------- */
@media (max-width: 760px) {
  body { font-size: 15.5px; }
  #plaque { gap: 0; padding: 4px 6px; top: 6px; left: 6px; }
  .stat img { width: 24px; height: 24px; } .stat b { font-size: 21px; } .stat span { display: none; } .stat { padding: 0 5px 0 0; } .stat + .stat { padding-left: 5px; }
  #rankbox { top: 52px; right: auto; left: 6px; min-width: 0; padding: 4px 8px; } #rankbox img { width: 26px; height: 26px; } #rankbar { width: 100px; } #ranknext { display: none; } #rankname { font-size: 15px; }
  #folio { top: 98px; left: 6px; font-size: 13.5px; }
  #buttons { top: 6px; right: 6px; max-width: 46vw; }
  #tip { top: auto; bottom: 86px; left: 3vw; max-width: 94vw; width: 94vw; font-size: 15px; }
  #context { bottom: 46px; max-width: 94vw; width: max-content; font-size: 14px; }
  #gauge { left: 6px; bottom: 6px; font-size: 13.5px; }
  #commline { display: none; }
  .cards { gap: 6px; }
  .card { width: calc((100vw - 20px - (var(--n, 3) - 1) * 6px) / var(--n, 3)); max-width: 160px; min-height: 216px; padding: 6px 5px 8px; }
  .card .kin { font-style: italic; opacity: .8; }
#commline { top: 112px; right: 12px; padding: 5px 12px 6px; font-size: 14.5px; max-width: 360px; text-align: right; }
#commline b { font-family: var(--sc); font-weight: normal; }
.card .why { display: none; } .card .src { font-size: 10px; letter-spacing: .04em; }
  .card .art, .card .art img { height: 70px; width: 70px; margin: 0 auto; }
  .card h3 { font-size: 16px; } .card .rule { font-size: 12.5px; } .card .say { display: none; }
  .card .worth { min-width: 34px; height: 34px; font-size: 16px; line-height: 34px; top: -8px; right: -5px; }
  .card .harm { font-size: 11px; white-space: normal; }
  #draft .ask { font-size: 18px; }
  .port header { height: 84px; } .port header h2 { font-size: 27px; } .port header div { left: 14px; top: 10px; } .port header p { font-size: 14px; }
  .port .body { padding: 10px 12px; } .tab { padding: 8px 10px; font-size: 16px; }
  .quay { grid-template-columns: 1fr; }
  #publish { width: 100vw; top: auto; height: 56vh; }
  .banner { font-size: 26px; top: 7%; }
  #title-box { right: 50%; transform: translate(50%, -50%); background: rgba(233, 216, 176, .82); padding: 18px 14px; box-shadow: 0 0 40px 30px rgba(233, 216, 176, .82); }
  .wonder h2 { font-size: 32px; }
}
@media (max-height: 560px) {
  .card { min-height: 0; } .card .say { display: none; } .card .art, .card .art img { height: 64px; width: 64px; margin: 0 auto; }
  .port header { height: 70px; } .port header h2 { font-size: 26px; } .port header div { top: 8px; } .port header p { display: none; }
}

body.publishing #rankbox, body.publishing #buttons, body.publishing #commline { opacity: 0; pointer-events: none; transition: opacity .3s; }
