:root { --ink: #1c1712; --gold: #f2c46d; --glass: rgba(14, 14, 32, .62); --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #1a1630; color: #fff; font-family: ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif; -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui button { pointer-events: auto; font: inherit; color: inherit; cursor: pointer; border: 0; -webkit-tap-highlight-color: transparent; }

.title { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; cursor: pointer; background: linear-gradient(to top, rgba(10, 8, 24, .78) 0%, rgba(10, 8, 24, .25) 34%, rgba(10, 8, 24, 0) 55%); transition: opacity 1.1s ease; }
.title.gone { opacity: 0; pointer-events: none; }
.title .tc { text-align: center; margin-bottom: 13vh; padding: 0 16px; }
.title h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(46px, 9vw, 104px); margin: 6px 0 14px; letter-spacing: .01em; line-height: .95; color: #fff7e8; text-shadow: 0 2px 30px rgba(255, 150, 60, .35), 0 2px 4px rgba(0, 0, 0, .45); }
.title .kick { font-size: 13px; letter-spacing: .32em; text-transform: uppercase; color: var(--gold); opacity: .9; }
.title .tap { font-size: 16px; letter-spacing: .06em; color: #fff; opacity: .85; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .45; } }

.bar { position: absolute; left: 0; right: 0; top: 0; height: 5px; display: flex; opacity: 0; transition: opacity 1s; }
.bar i { flex: 1 1 0; height: 100%; transition: flex-grow 1.2s ease; }
.on .bar { opacity: .95; }

.msg { position: absolute; top: 18px; left: 50%; transform: translate(-50%, -8px); max-width: min(640px, calc(100vw - 32px)); box-sizing: border-box; padding: 9px 16px 9px 12px; border-radius: 22px; background: var(--glass); display: flex; gap: 9px; align-items: center; font-size: 15px; line-height: 1.3; opacity: 0; transition: opacity .45s, transform .45s; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.msg.show { opacity: 1; transform: translate(-50%, 0); }
.msg.god span { font-family: var(--serif); font-style: italic; font-size: 16px; }
.glyph { width: 22px; height: 22px; flex: none; border-radius: 50%; background: radial-gradient(circle at 50% 50%, #1b1426 0 22%, #f8d88e 24% 38%, rgba(242, 196, 109, .25) 40% 100%); box-shadow: 0 0 10px rgba(242, 196, 109, .6); }
.msg:not(.god) .glyph { background: radial-gradient(circle, #fff 0 25%, rgba(255, 255, 255, .2) 30%); box-shadow: none; width: 10px; height: 10px; margin-left: 4px; }

.chip { position: absolute; top: 16px; left: 16px; font-size: 12px; padding: 6px 10px; border-radius: 14px; background: var(--glass); opacity: 0; transition: opacity 1s; display: flex; gap: 7px; align-items: center; white-space: nowrap; }
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.chip .n { opacity: .85; }
.on .chip { opacity: 1; }

.btnwrap { position: absolute; left: 50%; bottom: max(26px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; opacity: 0; transition: opacity 1s .6s; }
.on .btnwrap { opacity: 1; }
.btn { position: relative; width: 128px; height: 128px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, rgba(60, 52, 96, .92), rgba(16, 14, 34, .92) 70%); box-shadow: 0 10px 30px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .18), 0 0 0 1px rgba(242, 196, 109, .35); display: grid; place-items: center; touch-action: none; transition: transform .12s; }
.btn:active, .btn.held { transform: scale(.94); }
.btn svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.btn circle { fill: none; stroke-width: 4; }
.btn .trk { stroke: rgba(242, 196, 109, .18); }
.btn .prog { stroke: var(--gold); stroke-dasharray: 289; stroke-dashoffset: 289; stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.btn .w { font-weight: 800; font-size: 21px; letter-spacing: .12em; color: #fff3da; text-shadow: 0 0 12px rgba(242, 196, 109, .55); }
.btn.pop .w { animation: pop .45s ease; }
@keyframes pop { 0% { transform: scale(.82); opacity: .6; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }
.btn.flash::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 2px solid var(--gold); animation: ring .6s ease-out forwards; }
@keyframes ring { from { opacity: 1; transform: scale(.9); } to { opacity: 0; transform: scale(1.3); } }
.sub { font-size: 13px; color: #fff; opacity: .92; text-shadow: 0 1px 3px rgba(0, 0, 0, .7); min-height: 16px; max-width: 80vw; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mute, .zoom button { width: 40px; height: 40px; border-radius: 50%; background: var(--glass) !important; font-size: 18px !important; display: grid; place-items: center; }
.mute { position: absolute; left: 16px; bottom: max(22px, env(safe-area-inset-bottom)); opacity: 0; transition: opacity 1s; }
.mute.off { text-decoration: line-through; opacity: .5 !important; }
.on .mute { opacity: .9; }
.zoom { position: absolute; right: 16px; bottom: max(44px, calc(env(safe-area-inset-bottom) + 22px)); display: flex; flex-direction: column; gap: 8px; opacity: 0; transition: opacity 1s; }
.on .zoom { opacity: .9; }
.honest { position: absolute; right: 16px; bottom: 10px; font-size: 10px; opacity: .62; max-width: 56vw; text-align: right; line-height: 1.25; text-shadow: 0 1px 2px rgba(0, 0, 0, .6); }

.paper { position: absolute; inset: 0; background: rgba(8, 6, 18, .55); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; opacity: 0; pointer-events: none; transition: opacity .5s; padding: 16px; box-sizing: border-box; }
.paper.show { opacity: 1; pointer-events: auto; }
.paper .sheet { width: min(980px, 100%); max-height: calc(100% - 70px); overflow: auto; box-sizing: border-box; padding: 22px 28px 18px; color: var(--ink); font-family: var(--serif); border-radius: 3px; transform: rotate(-.6deg) translateY(30px); transition: transform .6s cubic-bezier(.2, .8, .2, 1);
  background: radial-gradient(ellipse at 20% 10%, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 60%), radial-gradient(ellipse at 90% 90%, rgba(150, 110, 60, .18), rgba(0, 0, 0, 0) 60%), #efe4cc; box-shadow: 0 30px 80px rgba(0, 0, 0, .55); }
.paper.show .sheet { transform: rotate(-.6deg) translateY(0); }
.paper .mast { text-align: center; border-bottom: 3px double var(--ink); padding-bottom: 6px; }
.paper .mast h1 { font-size: clamp(30px, 6vw, 56px); margin: 4px 0; font-weight: 700; letter-spacing: .02em; font-variant: small-caps; }
.paper .small { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.paper .hold { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 12px; padding: 6px 0; border-bottom: 1px solid rgba(0, 0, 0, .35); }
.paper .hold i { display: inline-block; width: 9px; height: 9px; background: var(--c); margin-right: 4px; border-radius: 50%; }
.paper h2 { font-size: clamp(22px, 4.2vw, 40px); line-height: 1.02; margin: 12px 0 4px; text-align: center; letter-spacing: .01em; }
.paper .sub { color: var(--ink); text-shadow: none; opacity: 1; font-style: italic; text-align: center; white-space: normal; max-width: none; font-size: 15px; margin: 0 0 10px; }
.paper .cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; border-top: 1px solid rgba(0, 0, 0, .4); padding-top: 8px; }
.paper .cols > div + div { border-left: 1px solid rgba(0, 0, 0, .25); padding-left: 16px; }
.paper h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; margin: 8px 0 6px; border-bottom: 1px solid rgba(0, 0, 0, .3); padding-bottom: 3px; }
.paper ul, .paper ol { margin: 0; padding-left: 18px; font-size: 14px; line-height: 1.35; }
.paper li { margin-bottom: 4px; }
.paper .log { list-style: none; padding-left: 0; }
.paper .pt { font-size: 11px; opacity: .6; margin-right: 4px; font-family: ui-monospace, monospace; }
.paper .ed { font-size: 15px; font-style: italic; margin: 0 0 8px; }
.paper .hint { border: 1px solid var(--ink); padding: 6px 8px; font-size: 13px; margin: 6px 0; }
.paper .foot { margin-top: 12px; border-top: 1px solid rgba(0, 0, 0, .35); padding-top: 6px; font-size: 11px; text-align: center; opacity: .7; }
.paper .close { padding: 12px 26px; border-radius: 24px; background: rgba(16, 14, 34, .9) !important; color: #fff3da !important; letter-spacing: .1em; font-weight: 700 !important; box-shadow: 0 0 0 1px rgba(242, 196, 109, .5); }
@media (max-width: 720px) { .paper .cols { grid-template-columns: 1fr; } .paper .cols > div + div { border-left: 0; padding-left: 0; border-top: 1px solid rgba(0, 0, 0, .25); } .paper .sheet { padding: 16px; } }

.offer { position: absolute; left: 50%; bottom: 200px; transform: translate(-50%, 20px); width: min(420px, calc(100vw - 32px)); box-sizing: border-box; padding: 16px 18px; border-radius: 18px; background: rgba(16, 14, 34, .86); box-shadow: 0 0 0 1px rgba(242, 196, 109, .45), 0 20px 50px rgba(0, 0, 0, .5); text-align: center; opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s; }
.offer.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.offer p { font-family: var(--serif); font-style: italic; font-size: 17px; margin: 8px 0 14px; }
.offer .glyph.big { width: 34px; height: 34px; margin: 0 auto; }
.offer .row { display: flex; gap: 12px; justify-content: center; }
.offer .row button { padding: 11px 30px; border-radius: 22px; font-weight: 800 !important; letter-spacing: .1em; }
.offer .yes { background: var(--gold) !important; color: #2a1c08 !important; }
.offer .no { background: rgba(255, 255, 255, .12) !important; }
.born { display: none; }
@media (max-width: 600px) { .btn { width: 116px; height: 116px; } .btn .w { font-size: 19px; } .msg { top: 14px; font-size: 14px; } .chip { top: auto; bottom: max(78px, calc(env(safe-area-inset-bottom) + 66px)); left: 12px; } .mute { left: 12px; } .zoom { right: 12px; } .honest { max-width: 42vw; } .offer { bottom: 180px; } }

.mood { position: absolute; top: 16px; right: 16px; display: flex; gap: 7px; align-items: center; font-size: 12px; padding: 6px 10px; border-radius: 14px; background: var(--glass); opacity: 0; transition: opacity 1s; font-family: var(--serif); font-style: italic; }
.on .mood { opacity: 1; }
.mood .glyph { width: 14px; height: 14px; transition: box-shadow 1s, filter 1s; }
.mood[data-mood="pleased"] .glyph { box-shadow: 0 0 14px #ffd27a; }
.mood[data-mood="sulking"] .glyph { filter: hue-rotate(220deg) saturate(.7); box-shadow: 0 0 10px #8a6aff; }
.mood[data-mood="suspicious"] .glyph { filter: hue-rotate(-30deg) saturate(1.6); box-shadow: 0 0 12px #ff6a3a; }
.mood[data-mood="bored"] .glyph { filter: grayscale(.7); }
.mood .wind { font-style: normal; display: inline-block; transition: transform 1.5s ease, opacity 1s; color: #cfe8ff; }
.chip .purse { color: var(--gold); }

.market .sheet { width: min(760px, 100%); }
.msheet .mast h1 { font-size: clamp(28px, 5vw, 44px); }
.msheet .purse { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 4px; font-size: 15px; }
.msheet .purse svg { width: 34px; height: 34px; }
.msheet .purse b { font-size: 28px; }
.msheet .purse .note { flex-basis: 100%; font-style: italic; font-size: 14px; }
.msheet .goods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.msheet .good { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 6px; padding: 6px 8px; border: 1px solid rgba(0, 0, 0, .25); border-radius: 6px; background: rgba(255, 255, 255, .35); }
.msheet .good svg { width: 34px; height: 34px; grid-row: span 2; }
.msheet .good span { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.msheet .good b { font-size: 20px; }
.msheet .good i { display: none; }
.msheet .good.up b::after { content: " \25B2"; color: #2a7a2a; font-size: 12px; }
.msheet .good.down b::after { content: " \25BC"; color: #a02a2a; font-size: 12px; }
.msheet .lot, .msheet .item { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid rgba(0, 0, 0, .15); }
.msheet .lot .ic svg, .msheet .item svg { width: 40px; height: 40px; flex: none; }
.msheet .ln, .msheet .item > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.msheet .ln span, .msheet .item span { font-size: 12px; opacity: .8; }
.msheet .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 5px; }
.msheet .tm { font-family: ui-monospace, monospace; font-size: 13px; width: 36px; text-align: right; }
.msheet button { padding: 9px 14px; border-radius: 18px; background: #1d1a30 !important; color: #fff3da !important; font-weight: 700 !important; font-size: 13px !important; white-space: nowrap; }
.msheet button[disabled] { opacity: .4; }
.msheet .tag { font-size: 12px; padding: 4px 10px; border-radius: 12px; border: 1px solid rgba(0, 0, 0, .3); }
.msheet .tag.lead { background: var(--gold); border-color: transparent; }
.msheet .none { font-style: italic; font-size: 14px; opacity: .75; }
.paper .mk { list-style: none; padding: 0; display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; }
@media (max-width: 600px) { .msheet .goods { grid-template-columns: repeat(2, 1fr); } .mood { top: 60px; right: 12px; } }
.paper:not(.show) *, .offer:not(.show) *, #ui:not(.on) button { pointer-events: none !important; }
.title .kick { text-shadow: 0 1px 6px rgba(0, 0, 0, .6); }
@media (max-width: 600px) {
  .chip { top: 14px; bottom: auto; left: 12px; max-width: 54vw; overflow: hidden; }
  .chip .n:not(.purse) { display: none; }
  .mood { top: 14px; right: 12px; }
  .msg { top: 54px; }
  .honest { left: 12px; right: 12px; max-width: none; text-align: center; bottom: 6px; }
  .btnwrap { bottom: max(36px, calc(env(safe-area-inset-bottom) + 30px)); }
  .zoom { bottom: 96px; }
  .mute { bottom: 96px; }
}

/* fleet colours by attribute (no inline style, so the CSP can stay strict) */
[data-f="0"]{--c:#ff5a2c}[data-f="1"]{--c:#14b8b0}[data-f="2"]{--c:#ffc928}[data-f="3"]{--c:#a05cff}

/* the tap prompt appears only when every shader is warm (no progress bar) */
.title:not(.ready) .tap { visibility: hidden; }
