/* The Hidden Harbours (assets/js/hidden-harbours.js adds body.hidden-harbour and --hh-accent):
   a premium nautical finish over each hidden page's own night scene, the wax seals of the game,
   the Compass Mind's hints, the passage to the next harbour and the captain's certificate. */

body.hidden-harbour{--hh-gold:#c9aa6a;--hh-gold-light:#f2d99b;--hh-ivory:#f7f0e2;--hh-wax:#8e2a1f;}

/* ---------- The card as a framed chart ---------- */
body.hidden-harbour main>section:first-of-type{
  border:1px solid rgba(201,170,106,.55)!important;border-radius:30px!important;
  box-shadow:inset 0 0 0 7px rgba(4,12,24,.55),inset 0 0 0 8px rgba(201,170,106,.25),0 40px 100px rgba(0,0,0,.5)!important;
}
body.hidden-harbour h1{font:italic 400 clamp(36px,5.6vw,66px)/1.05 "Harbour Serif",Georgia,"Times New Roman",serif!important;letter-spacing:-.02em!important;text-transform:none!important;color:var(--hh-ivory)!important;}
body.hidden-harbour h2{font-family:"Harbour Serif",Georgia,"Times New Roman",serif!important;font-style:italic;color:var(--hh-gold-light)!important;}
body.hidden-harbour .kicker{color:var(--hh-gold)!important;letter-spacing:.3em!important;}
body.hidden-harbour .panel,body.hidden-harbour .secret-panel,body.hidden-harbour .crate-panel{
  border:1px solid rgba(201,170,106,.32)!important;box-shadow:inset 0 0 0 4px rgba(4,12,24,.35),0 18px 38px rgba(0,0,0,.25)!important;}
body.hidden-harbour .panel-label{color:var(--hh-gold)!important;}
body.hidden-harbour .notice-title{font-family:"Harbour Serif",Georgia,serif!important;font-style:italic;}

/* gold actions */
body.hidden-harbour .return-btn,body.hidden-harbour .dock-btn,body.hidden-harbour .secret-btn{
  background:linear-gradient(135deg,#f4dfa6,#c9aa6a 55%,#a9843f)!important;color:#07111c!important;border:0!important;
  box-shadow:0 14px 30px rgba(0,0,0,.35),inset 0 0 0 1px rgba(255,255,255,.3)!important;}
.hh-ask{min-height:44px;padding:0 22px;border-radius:999px;cursor:pointer;border:1px solid rgba(201,170,106,.7);background:rgba(4,12,24,.5);
  color:var(--hh-gold-light);font:inherit;font-size:12px;font-weight:900;letter-spacing:.16em;text-transform:uppercase;transition:background .25s,transform .25s var(--ease-sail);}
.hh-ask::before{content:"";display:inline-block;width:14px;height:14px;margin:0 8px -2px 0;border-radius:50%;border:1.5px solid currentColor;
  background:conic-gradient(from 0deg,transparent 0 40%,currentColor 40% 60%,transparent 60%);}
.hh-ask:hover{background:rgba(201,170,106,.16);transform:translateY(-2px);}
.hh-ask:focus-visible{outline:2px solid var(--hh-gold-light);outline-offset:3px;}
.hh-hint{max-width:560px;margin:4px auto 14px;padding:12px 18px;border-radius:14px;border:1px solid rgba(201,170,106,.4);background:rgba(4,12,24,.55);
  font:italic 16px/1.5 "Harbour Serif",Georgia,serif;color:var(--hh-ivory);text-align:center;animation:hhIn .5s var(--ease-sail);}
.hh-hint span{display:block;margin-bottom:4px;font:900 11px/1 Inter,system-ui,sans-serif;letter-spacing:.24em;text-transform:uppercase;color:var(--hh-accent,#c9aa6a);}

/* artefacts: recovered cargo */
body.hidden-harbour .artefact,body.hidden-harbour .achievement{border:1px solid rgba(201,170,106,.4)!important;border-top:3px solid var(--hh-accent,#c9aa6a)!important;}
body.hidden-harbour .artefact-title,body.hidden-harbour .achievement-title{font-family:"Harbour Serif",Georgia,serif!important;font-style:italic;}

/* ---------- The seal ribbon ---------- */
.hh-ribbon{display:grid;justify-items:center;gap:12px;margin:6px auto 20px;}
.hh-ribbon__title{margin:0;font-size:11px;font-weight:900;letter-spacing:.24em;text-transform:uppercase;color:var(--hh-gold);}
.hh-ribbon__title span{color:rgba(247,240,226,.4);}
.hh-ribbon__title b{color:var(--hh-ivory);font-weight:900;}
.hh-seals{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:12px 20px;margin:0;padding:0;}
.hh-seal{display:grid;justify-items:center;gap:6px;}
.hh-seal__wax{position:relative;width:48px;height:48px;border-radius:50% 46% 52% 48%;
  background:radial-gradient(circle at 36% 30%,#c65243,var(--hh-wax) 55%,#4f140d);
  box-shadow:0 0 0 4px rgba(142,42,31,.25),0 8px 16px rgba(0,0,0,.45),inset 0 -5px 10px rgba(0,0,0,.35);}
/* the anchor pressed into the wax */
.hh-seal__wax::after{content:"⚓";position:absolute;inset:0;display:grid;place-items:center;font-size:20px;color:rgba(255,220,200,.55);text-shadow:0 1px 0 rgba(0,0,0,.4);}
.hh-seal__name{font-size:11px;font-weight:800;letter-spacing:.16em;text-transform:uppercase;color:rgba(247,240,226,.6);}
/* broken: cracked in two, glowing in the harbour's colour */
.hh-seal.is-broken .hh-seal__wax{background:radial-gradient(circle at 36% 30%,#d9b46a,#a9843f 55%,#5d4719);
  box-shadow:0 0 0 4px color-mix(in srgb,var(--hh-accent,#c9aa6a) 35%,transparent),0 0 22px color-mix(in srgb,var(--hh-accent,#c9aa6a) 55%,transparent),inset 0 -5px 10px rgba(0,0,0,.3);
  clip-path:polygon(0 0,52% 0,44% 38%,58% 55%,46% 100%,0 100%,0 0,100% 0,100% 100%,54% 100%,66% 55%,52% 38%,60% 0,100% 0);}
.hh-seal.is-broken .hh-seal__wax::after{content:"✓";color:#07111c;font-weight:900;}
.hh-seal.is-broken .hh-seal__name{color:var(--hh-ivory);}
.hh-seal.is-stamping .hh-seal__wax{animation:hhStamp .6s var(--ease-stamp);}
@keyframes hhStamp{from{transform:scale(1.7) rotate(-12deg);opacity:.2}to{transform:none;opacity:1}}
.hh-voyage{display:flex;gap:8px;margin:0;}
.hh-voyage span{width:10px;height:10px;transform:rotate(45deg);border:1.5px solid rgba(201,170,106,.6);}
.hh-voyage span.is-here{border-color:var(--hh-accent,#c9aa6a);box-shadow:0 0 8px var(--hh-accent,#c9aa6a);}
.hh-voyage span.is-sealed{background:var(--hh-gold);}

/* ---------- The passage ---------- */
.hh-passage{display:flex;align-items:center;gap:16px;max-width:620px;margin:0 auto 20px;padding:14px 20px;border-radius:16px;text-align:left;
  border:1px solid rgba(201,170,106,.6);background:linear-gradient(135deg,rgba(201,170,106,.18),rgba(4,12,24,.6));box-shadow:0 0 30px rgba(201,170,106,.18);}
.hh-passage.is-new{animation:hhIn .8s var(--ease-sail);}
.hh-passage strong{display:block;font-size:11px;font-weight:900;letter-spacing:.22em;text-transform:uppercase;color:var(--hh-gold);}
.hh-passage p{margin:4px 0 0;font:italic 17px/1.4 "Harbour Serif",Georgia,serif;color:var(--hh-ivory);}
.hh-passage__seal{flex:0 0 auto;width:40px;height:40px;border-radius:50%;background:radial-gradient(circle at 36% 30%,#f4dfa6,#a9843f 60%,#5d4719);box-shadow:0 0 18px rgba(242,217,155,.5);}
/* the hidden link becomes a glowing beacon */
.secret-hover-zone.is-revealed img{opacity:1!important;transform:none!important;}
.secret-hover-zone.is-revealed{width:44px!important;height:44px!important;border-radius:50%!important;
  box-shadow:0 0 0 2px #c9aa6a,0 0 0 8px rgba(201,170,106,.18),0 0 30px rgba(242,217,155,.7);animation:hhBeacon 2.4s ease-in-out infinite;}
.secret-hover-zone.is-revealed img{width:32px!important;height:32px!important;border-radius:50%!important;}
@keyframes hhBeacon{0%,100%{box-shadow:0 0 0 2px #c9aa6a,0 0 0 8px rgba(201,170,106,.18),0 0 24px rgba(242,217,155,.5)}50%{box-shadow:0 0 0 2px #f2d99b,0 0 0 14px rgba(201,170,106,.08),0 0 40px rgba(242,217,155,.9)}}

/* ---------- The finale ---------- */
.hh-certificate{position:relative;max-width:640px;margin:10px auto 22px;padding:32px 34px 28px;border-radius:6px;text-align:center;color:#0b1b2d;
  background:radial-gradient(circle at 50% 0%,rgba(242,217,155,.5),transparent 60%),linear-gradient(180deg,#fffdf8,#f2e6c8);
  border:1px solid #b8964f;box-shadow:inset 0 0 0 6px #fffdf8,inset 0 0 0 7px rgba(184,150,79,.5),0 30px 70px rgba(0,0,0,.45);}
.hh-certificate.is-new{animation:hhIn 1s var(--ease-sail);}
.hh-certificate__kicker{margin:0 0 8px;font-size:11px;font-weight:900;letter-spacing:.3em;text-transform:uppercase;color:#9a783b;}
.hh-certificate__title{margin:0!important;font:italic 400 clamp(28px,4vw,40px)/1.1 "Harbour Serif",Georgia,serif!important;color:#0b1b2d!important;}
.hh-certificate__text{margin:12px auto 0;max-width:460px;font-size:15px;line-height:1.6;color:rgba(11,27,45,.72);}
.hh-certificate__date{margin:14px 0 0;font:italic 16px "Harbour Serif",Georgia,serif;color:#7d5f27;}
.hh-certificate__seal{position:absolute;right:22px;bottom:-18px;width:62px;height:62px;border-radius:50% 46% 52% 48%;
  background:radial-gradient(circle at 36% 30%,#c65243,#8e2a1f 55%,#4f140d);box-shadow:0 10px 20px rgba(0,0,0,.35);}
.hh-certificate__seal::after{content:"⚓";position:absolute;inset:0;display:grid;place-items:center;font-size:24px;color:rgba(255,220,200,.6);}

@keyframes hhIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.hh-seal.is-stamping .hh-seal__wax,.hh-passage.is-new,.hh-certificate.is-new,.hh-hint,.secret-hover-zone.is-revealed{animation:none;}}

/* ---------- The Wrong Dock is a daylight harbour: ink on ivory ---------- */
body.hh-light{--hh-ivory:#0b1b2d;--hh-gold:#9a783b;--hh-gold-light:#7d5f27;}
body.hh-light main>section:first-of-type{box-shadow:inset 0 0 0 7px rgba(255,253,248,.7),inset 0 0 0 8px rgba(184,150,79,.3),0 40px 100px rgba(7,17,28,.16)!important;}
body.hh-light .hh-ribbon__title span{color:rgba(11,27,45,.35);}
body.hh-light .hh-seal__name{color:rgba(11,27,45,.55);}
body.hh-light .hh-ask{background:#fffdf8;color:#7d5f27;}
body.hh-light .hh-hint,body.hh-light .hh-passage{background:#fffdf8;}
body.hh-light .hh-passage p{color:#0b1b2d;}
