/* Captain journal: isolated layer, existing game geometry and styles unchanged. */
.cj-button,.cj-referral-button{position:fixed;z-index:45;bottom:calc(var(--nav-h,72px) + env(safe-area-inset-bottom) + 12px);right:clamp(10px,3vw,20px);width:42px;height:42px;padding:4px;color:#ffe7ab;background:linear-gradient(145deg,#715034,#302013);border:2px solid #c19a55;border-radius:10px;box-shadow:0 2px 6px #0008;font:700 20px Georgia,serif;cursor:pointer}
.cj-button,.cj-referral-button{box-sizing:border-box;width:25.2px;height:25.2px;min-width:0;min-height:0;display:grid;place-items:center;padding:1.2px;border-width:1px;border-radius:6px;box-shadow:0 1px 3px #0008}
.cj-button{right:calc(clamp(15.5px,calc(1.5vw + 10.5px),20.5px) + 33.2px)}
.cj-referral-button{right:clamp(15.5px,calc(1.5vw + 10.5px),20.5px)}
.cj-button svg,.cj-referral-button svg{display:block;width:16.32px;height:16.32px}.cj-count{position:absolute;right:-4px;top:-9px;box-sizing:border-box;display:grid;place-items:center;background:#fff;color:#386238;border:0;border-radius:999px;min-width:15.4px;height:15.4px;padding:0 2px;text-align:center;font:700 9px/1 Arial;pointer-events:none}
.cj-layer{position:fixed;inset:0;z-index:180;pointer-events:none}
.cj-layer[hidden],.cj-button[hidden],.cj-referral-button[hidden],.cj-layer [hidden]{display:none!important}
.cj-scrim{position:absolute;inset:0;background:#08192348;pointer-events:auto}
.cj-highlight{position:fixed;pointer-events:none;border:2px solid #f3cb73;border-radius:8px;box-shadow:0 0 0 3px #8f592e70,0 0 14px #f4cb7180}
.cj-highlight.cj-pulse{animation:cj-pulse 1.6s ease-in-out infinite}
@keyframes cj-pulse{50%{box-shadow:0 0 0 5px #b58b3a38,0 0 15px #f4cb71a0}}
.cj-card{position:fixed;pointer-events:auto;width:min(342px,calc(100vw - 24px));max-height:calc(100dvh - 26px);box-sizing:border-box;padding:13px 15px;background:#f2dfb6 url('../img/ui/parchment.webp') repeat;color:#4a301b;border:2px solid #ae8241;border-radius:11px;box-shadow:inset 0 0 0 2px #f8e6bf99,0 7px 25px #0008;font:14px/1.45 'Golos Text',Arial,sans-serif}
.cj-card h3,.cj-journal h2{margin:0 0 6px;color:#624022;font:700 22px/1.12 'Cormorant Garamond',Georgia,serif}
.cj-card p{margin:0 0 10px}.cj-foot{display:flex;align-items:center;justify-content:space-between;gap:12px}.cj-bp{color:#8b5a15;font-weight:700;white-space:nowrap}
.cj-confirm,.cj-close,.cj-go{min-height:36px;border:1px solid #b98f49;border-radius:6px;padding:6px 15px;color:#fff0c7;background:linear-gradient(#608449,#31512d);box-shadow:inset 0 1px #e6cf8b66,0 2px 3px #0004;font:700 15px Georgia,serif;cursor:pointer}
.cj-card:after{content:'';position:absolute;left:var(--cj-arrow,50%);width:11px;height:11px;background:#eed7ad;border:solid #ae8241;border-width:2px 0 0 2px;transform:translateX(-50%) rotate(45deg);top:-8px;pointer-events:none}
.cj-card.cj-above:after{top:auto;bottom:-8px;transform:translateX(-50%) rotate(225deg)}.cj-card.cj-center:after{display:none}
.cj-book-shade{position:fixed;inset:0;z-index:174;background:#071e2b80}
.cj-journal{position:fixed;z-index:175;inset:var(--cj-journal-top,0px) auto auto 50%;transform:translateX(-50%);width:min(420px,calc(100vw - 22px));max-height:calc(100dvh - var(--cj-journal-top,0px) - 8px);overflow:auto;box-sizing:border-box;background:#f2dfb6 url('../img/ui/parchment.webp') repeat;border:3px ridge #b58d50;border-radius:12px;padding:0 14px 14px;color:#4a301b;box-shadow:0 12px 40px #000b;font:14px/1.4 'Golos Text',Arial,sans-serif}
.cj-journal h2{text-align:center}.cj-journal nav{display:flex;gap:6px;margin:12px 0}.cj-journal nav button{flex:1;background:#69492e;border:1px solid #b88d4a;color:#ffe7b0;border-radius:6px;padding:8px;font:700 15px Georgia,serif}.cj-journal nav button[aria-pressed=true]{background:#e8cfa0;color:#624022}.cj-journal article{padding:9px;margin:7px 0;border:1px solid #b99a66;border-radius:7px;background:#fff0ce80}.cj-journal article header{display:flex;justify-content:space-between;gap:8px;font-weight:700}.cj-journal article p{margin:4px 0;font-size:13px}.cj-journal .cj-go{margin-top:5px;font-size:13px;padding:3px 9px;min-height:30px}/* The journal heading and close cross stay visible while the task list scrolls. */
.cj-journal-head{
 position:sticky;top:0;z-index:3;display:grid;grid-template-columns:40px minmax(0,1fr) 40px;
 align-items:center;gap:4px;margin:0 -14px 12px;padding:8px 10px 9px;
 background:linear-gradient(180deg,#f9ebce,#ebd1a1);
 border-bottom:1px solid #b78a4c;border-radius:9px 9px 0 0;
 box-shadow:0 2px 6px #75492036;
}
.cj-journal-head::before{content:"";width:40px;height:1px;}
.cj-journal .cj-journal-head h2{margin:0;text-align:center;line-height:1.04;}
.cj-journal-dismiss{
 display:grid;place-items:center;justify-self:end;width:40px;height:40px;
 padding:0;border:0;border-radius:9px;
 background:transparent;
 box-shadow:none;
 color:#624022;font:700 20.3px/1 Georgia,serif;text-shadow:none;
 cursor:pointer;
}
.cj-journal-dismiss:hover{filter:brightness(1.13);}
.cj-journal-dismiss:focus-visible{outline:2px solid #ae6b15;outline-offset:2px;}
.cj-ball{position:fixed;z-index:210;pointer-events:none;width:70px;height:70px;display:grid;place-items:center;box-sizing:border-box;border-radius:50%;border:1.5px solid #b5a052;background:radial-gradient(circle at 45% 38%,#77b86a 0%,#4b9251 55%,#317a48 100%);box-shadow:inset -1px -2px 3px #153c283d,inset 1px 1px 2px #d4efc033,0 2px 4px #0003;color:#fff;text-shadow:none;font:700 17px/1 Georgia,serif;white-space:nowrap;transform-origin:center;animation:cj-ball-flight 1.45s cubic-bezier(.15,.55,.35,1) forwards}
.cj-ball:before{content:'';position:absolute;top:12%;left:23%;width:22%;height:8%;border-radius:50%;background:#e5ffdb26;transform:rotate(-30deg)}
.cj-ball span{position:relative;background:none;background-clip:border-box;-webkit-background-clip:border-box;color:#fff;-webkit-text-fill-color:#fff;text-shadow:none;filter:none}
@keyframes cj-ball-flight{0%{transform:translate(0,0) scale(.35);opacity:0}12%{opacity:1}30%{transform:translate(calc(var(--dx) * .32),-49px) scale(1.02)}60%{transform:translate(calc(var(--dx) * .74),-90px) scale(1)}82%{opacity:1;transform:translate(calc(var(--dx) * .91),-93px) scale(.97)}100%{transform:translate(var(--dx),-75px) scale(.78);opacity:0}}
.cj-spark{position:fixed;z-index:209;pointer-events:none;width:8px;height:8px;border-radius:50%;background:radial-gradient(circle at 30% 25%,#c4f58d,#29763c 78%);animation:cj-splash .75s ease-out forwards}
@keyframes cj-splash{from{transform:scale(.3);opacity:1}to{transform:translate(var(--sx),var(--sy)) scale(.35);opacity:0}}
@media(prefers-reduced-motion:reduce){.cj-highlight.cj-pulse{animation:none}.cj-ball{animation:cj-fade .8s ease-out forwards}.cj-spark{display:none}}@keyframes cj-fade{0%,70%{opacity:1}100%{opacity:0}}


/* Journal tabs remain below the sticky title when the long journal scrolls. */
.cj-journal nav {
 position:sticky;
 top:64px;
 z-index:2;
 display:grid;
 grid-template-columns:repeat(3,minmax(0,1fr));
 gap:5px;
 margin:18px 0 14px;
 padding:6px;
 border:1px solid #c5a06b;
 border-radius:8px;
 background:#f4dfbafa;
 box-shadow:0 2px 6px #67461d27;
}
.cj-journal nav button {
 flex:initial;
 min-width:0;
 min-height:35px;
 padding:7px 3px;
 font:700 clamp(12px,3vw,15px)/1.1 Georgia,serif;
}
.cj-journal .cj-book-filter {
 display:block;
 width:100%;
 min-height:34px;
 margin:3px 0 10px;
 padding:5px 9px;
 border:1px solid #b88d5a;
 border-radius:7px;
 background:#f6e3bf;
 box-shadow:inset 0 1px 2px #fff8df;
 color:#58391f;
 font:600 13px/1.3 'Golos Text',Arial,sans-serif;
 cursor:pointer;
}
.cj-journal .cj-book-filter:focus-visible {outline:2px solid #ae6b15;outline-offset:2px;}
.cj-journal .cj-book-filter:disabled {opacity:.6;cursor:default;}
.cj-journal .cj-book-list > [hidden] {display:none!important;}
.cj-journal .cj-filter-empty {margin:8px 0;padding:9px 11px;border:1px solid #c4a06b;border-radius:7px;background:#fff1d2c9;color:#765338;}
.cj-journal .cj-combo-intro{
 margin:7px 0 8px;
 padding:11px 12px;
 border:1px solid #c4a06b;
 border-radius:8px;
 background:#fff1d2c9;
 color:#5f3c1e;
 font:600 13px/1.45 'Golos Text',Arial,sans-serif;
}
.cj-journal .cj-combo-hint{
 margin:0 0 12px;
 padding:0 3px;
 color:#765338;
 font:12px/1.4 'Golos Text',Arial,sans-serif;
}
.cj-journal .cj-combo {
 display:grid;
 gap:5px;
 margin:8px 0;
 padding:12px;
 border:1px solid #bc9456;
 border-radius:9px;
 background:linear-gradient(145deg,#fff1d6e8,#e6cfa6cf);
 box-shadow:inset 0 1px 0 #fff8e9ba,0 1px 3px #7149232e;
}
.cj-journal .cj-combo header {
 display:flex;
 flex-wrap:wrap;
 align-items:baseline;
 justify-content:space-between;
 gap:5px 12px;
 color:#583419;
 font:700 15px/1.25 'Golos Text',Arial,sans-serif;
}
.cj-journal .cj-combo-actions {
 display:flex;
 flex-wrap:wrap;
 align-items:center;
 gap:8px 12px;
 min-width:0;
 margin-top:5px;
}
.cj-journal .cj-combo .cj-combo-count {
 display:inline-flex;
 align-items:center;
 gap:3px;
 flex:none;
 color:#b47a13;
 font:italic 700 21px/1.1 'Cormorant Garamond',Georgia,serif;
 letter-spacing:.15px;
 text-shadow:0 1px 0 #fff0ae,0 .4px .7px #80500f;
 white-space:nowrap;
}
.cj-journal .cj-combo .cj-combo-multiplier {color:#e87500;font-size:42px;line-height:1;text-shadow:0 1px 0 #ffe2a2,0 .5px 1px #a34a08;white-space:nowrap;}
.cj-journal .cj-combo .cj-combo-art {display:block;width:56px;height:56px;object-fit:contain;flex:none;}
.cj-journal .cj-combo p {margin:3px 0;font:13px/1.4 'Golos Text',Arial,sans-serif;}
.cj-journal .cj-combo .cj-combo-meta {color:#755138;font-size:12px;}
.cj-journal .cj-combo .cj-combo-base {color:#267040;font-weight:700;}
.cj-journal .cj-combo-claim {
 display:block;
 max-width:100%;
 min-height:35px;
 padding:7px 15px;
 border:2px solid #d5aa5d;
 border-radius:8px;
 background:linear-gradient(180deg,#659b46,#36732c 52%,#225a29);
 box-shadow:inset 0 1px 0 #d9ffbd75,0 2px 3px #49310d40;
 color:#fff;
 font:700 14px/1.2 'Golos Text',Arial,sans-serif;
 text-shadow:none;
 white-space:normal;
}
@media (max-width:360px) {
 .cj-journal .cj-combo-claim {padding-inline:10px;}
}
.cj-journal .cj-combo-claim:not(:disabled):hover {filter:brightness(1.09);}
.cj-journal .cj-combo-claim:disabled {opacity:.55;}
.cj-journal .cj-combo .cj-combo-claimed {color:#267040;font-weight:600;}
.cj-journal .cj-combo .cj-combo-error {color:#942f22;font-size:12px;}

/* Advisor button shares the original journal/referral control geometry. */
.cj-referral-button.cj-advisor-button{right:calc(clamp(15.5px,calc(1.5vw + 10.5px),20.5px) + 66.4px)}
.cj-journal .cj-advisor-list article p{line-height:1.45}

.cj-journal .cj-advisor-intro{margin:0 2px 10px;color:#624022;font:13px/1.4 'Golos Text',Arial,sans-serif;}
