/* Public entry pages: the island's sea, parchment, wood and brass. */
body.pirate-theme:has(#log_main) {
  margin:0; padding:32px 16px; min-height:100vh; box-sizing:border-box;
  background:#173f49 url('../images/pirate/island/landscape-realistic-v3.png') center / cover fixed no-repeat;
  color:#49331f;
}
body.pirate-theme:has(#log_main)::before {
  content:'';position:fixed;inset:0;pointer-events:none;
  background:linear-gradient(90deg,#082d3b66,#0c283322);z-index:-1;
}
body.pirate-theme:has(#log_main) #page_body {margin:0;padding:0;overflow:visible}
body.pirate-theme #log_skipper {height:0}
body.pirate-theme #log_main {
  box-sizing:border-box;width:min(520px,100%);margin:0 auto;padding:30px 36px;
  background:var(--paper,linear-gradient(#ead6ad,#e6cfa1));
  border:1px solid #927044;border-radius:5px;color:#49331f;opacity:1;
  box-shadow:inset 0 0 35px #9e723530,0 20px 65px #071f35a0;
  text-align:center;
}
body.pirate-theme .pirate-login-mark {width:64px;height:64px;margin:0 0 12px;filter:sepia(.45)}
body.pirate-theme #log_title {font:30px/1.2 Georgia,serif;color:#4c321c;background:none;padding:0 0 18px;border-bottom:3px double #98714488}
body.pirate-theme #log_description {margin:18px 0;color:#6a4d2c;font-size:13px;line-height:1.7;text-align:center}
body.pirate-theme #log_form {height:auto;min-height:0;padding:0;margin:20px 0}
body.pirate-theme .log_input_wrapper {float:none;width:auto;margin:0 0 16px;text-align:left}
body.pirate-theme .log_input_wrapper label {display:block;margin-bottom:6px;color:#51361e}
body.pirate-theme #log_main input:not([type=checkbox]):not([type=hidden]),
body.pirate-theme #log_main select {box-sizing:border-box;width:100%;min-height:42px;font-size:14px;padding:10px}
body.pirate-theme #log_main input[type=checkbox] {accent-color:#805422;width:16px;height:16px;vertical-align:middle}
body.pirate-theme #log_main input[type=submit] {margin:8px 0;padding:12px;white-space:normal}
body.pirate-theme .log_options {display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left;font-size:11px;margin:2px 0 14px}
body.pirate-theme #log_register {display:block;margin:20px 0 0;padding:12px;background:#f9ebc944;border:1px solid #98714488;border-radius:3px;color:#694322;font-weight:bold;font-size:13px;text-decoration:none}
body.pirate-theme #log_register:hover {background:#fff0ca;color:#4c321c}
body.pirate-theme #log_menu {border-top:1px solid #98714455;padding:14px 0 0;margin-top:16px;color:#927044;font-size:11px;line-height:2}
body.pirate-theme #log_menu a {display:inline-block;margin:0 3px;color:#79431d}
body.pirate-theme #log_menu img {vertical-align:middle}
body.pirate-theme #log_main table {width:100%;border-spacing:0;background:transparent;table-layout:fixed}
body.pirate-theme #log_main th {width:auto;background:transparent;border:0;border-bottom:1px solid #98714422;text-align:left;padding:10px 5px;color:#51361e;overflow-wrap:anywhere}
body.pirate-theme #log_main th:first-child:not([colspan]) {width:34%;font-weight:normal}
body.pirate-theme #log_main th[colspan] {font-weight:normal;font-size:12px;line-height:1.7;padding:16px 0}
body.pirate-theme #log_main button {padding:7px 10px;margin-top:7px;max-width:100%;white-space:normal}
body.pirate-theme #log_main a[style] {color:#79431d!important}
body.pirate-theme .log_status {box-sizing:border-box;width:min(520px,100%);margin:10px auto 0;padding:10px 16px;background:#173632ed;border:1px solid #a48b5866;border-radius:4px;color:#eadbbc;font-size:11px;line-height:1.7}
body.pirate-theme .log_status strong {color:#f5d797;font-weight:normal}
body.pirate-theme #log_main #log_status {width:auto;background:transparent;border:0;border-bottom:1px solid #98714455;color:#694322;margin:12px 0;padding:10px 0}
body.pirate-theme:has(#log_main) #copyright {width:auto;background:transparent;border:0;opacity:1;color:#f2dfb7;text-shadow:0 1px 3px #142e30;margin:20px auto}
body.pirate-theme:has(#log_main) #copyright a {color:#f2dfb7}
@media(max-width:560px){
  body.pirate-theme:has(#log_main){padding:18px 12px;background-position:60% center}
  body.pirate-theme #log_main{padding:24px 20px}
  body.pirate-theme #log_title{font-size:26px}
  body.pirate-theme #log_main th{display:block;padding:6px 0;border:0;width:auto!important}
  body.pirate-theme #log_main th[colspan]{padding:14px 0}
  body.pirate-theme #log_main tr{display:block;margin-bottom:9px}
  body.pirate-theme .log_options{flex-wrap:wrap}
}

/* A captain's writing desk overlooking the island. */
body.pirate-theme:has(#log_main) {
  padding:clamp(150px,26vh,290px) 7vw 32px;
  background-color:#34251b;
  background-image:url('../images/pirate/captains-cabin-v1.png');
  background-position:center center;
  background-size:cover;
  background-attachment:fixed;
}
body.pirate-theme:has(#log_main)::before {display:none}
body.pirate-theme #log_main {
  position:relative;width:min(480px,100%);margin:0 auto;padding:28px 34px;
  border:1px solid #b38a4f;border-radius:3px 9px 5px 12px;
  background:radial-gradient(ellipse at 0 40%,#9a612b27,transparent 50%),radial-gradient(ellipse at 100% 80%,#99652b33,transparent 50%),repeating-linear-gradient(0deg,#80582008 0 1px,transparent 1px 4px),linear-gradient(105deg,#d5b576,#f1dfb4 14%,#ead3a1 80%,#cfaa6c);
  box-shadow:inset 0 0 28px #93571d30,2px 5px 4px #140c0766,0 22px 45px #160d09a6;
}
body.pirate-theme #log_main::before,body.pirate-theme #log_main::after {
  content:'';position:absolute;left:-7px;right:-7px;height:10px;border:1px solid #ab8045;
  border-radius:50% / 35%;background:linear-gradient(#b78b4e,#f1ddb0 45%,#c49b5d);
  box-shadow:0 3px 4px #28180d55;pointer-events:none;
}
body.pirate-theme #log_main::before {top:-5px}
body.pirate-theme #log_main::after {bottom:-5px;transform:rotate(.3deg)}
body.pirate-theme .pirate-login-mark {width:44px;height:44px;margin-bottom:8px}
body.pirate-theme #log_title {font-size:27px;padding-bottom:13px}
body.pirate-theme #log_description {font-size:12px;line-height:1.6;margin:14px 0}
body.pirate-theme #log_main .log_status {width:auto;background:transparent;color:#735331;border:0;margin:0;padding:3px 0;font-size:10px}
body.pirate-theme #log_main .log_status strong {color:#57391c}
body.pirate-theme .log_ship_register {margin:12px 0 0;padding:9px 0;border-bottom:1px solid #98714444;text-align:left;font-size:11px;color:#735331}
body.pirate-theme .log_ship_register summary {cursor:pointer;text-align:center;line-height:1.7}
body.pirate-theme .log_ship_register[open] summary {margin-bottom:8px}
body.pirate-theme #log_form {margin:16px 0}
body.pirate-theme #log_menu {font-size:10px;margin-top:12px;padding-top:9px}
body.pirate-theme:has(#log_main) #copyright {box-sizing:border-box;width:min(480px,100%);margin:22px auto 0;padding:9px 12px;background:#21170dbd;border-radius:3px;font-size:10px}

@media(max-width:760px){
  body.pirate-theme:has(#log_main){padding:180px 18px 24px;background-position:60% center}
  body.pirate-theme #log_main {margin:0 auto;padding:25px 24px}
  body.pirate-theme:has(#log_main) #copyright {margin:22px auto 0}
}
@media(max-width:420px){
  body.pirate-theme:has(#log_main){padding:150px 14px 24px}
  body.pirate-theme #log_main {padding:23px 20px}
  body.pirate-theme #log_title {font-size:24px}
}
/* The legacy renderer wraps public templates in a center element. */
body.pirate-theme:has(#log_main) > center {text-align:left}

/* Original aged scroll; nine-slice scaling keeps the curled ends undistorted. */
body.pirate-theme #log_main {
  border:solid transparent;border-width:104px 44px 100px;
  border-image-source:url('../images/pirate/captains-parchment-v1.png');
  border-image-slice:230 96 220 96 fill;border-image-repeat:stretch;
  border-radius:0;background:none;padding:8px 6px 14px;box-shadow:none;
  filter:drop-shadow(2px 10px 9px #140b08a0);
}
body.pirate-theme #log_main::before,body.pirate-theme #log_main::after {display:none}
@media(max-width:560px){body.pirate-theme #log_main{border-width:76px 32px 73px;padding:8px 2px 12px}}
/* The quill tip is the click point. Text fields retain the writing caret. */
body.pirate-theme:has(#log_main),body.pirate-theme #log_main * {
  cursor:url('../images/pirate/quill-cursor.svg') 3 29,auto;
}
body.pirate-theme #log_main a,body.pirate-theme #log_main button,
body.pirate-theme #log_main summary,body.pirate-theme #log_main label,
body.pirate-theme #log_main input[type=submit],body.pirate-theme #log_main input[type=checkbox] {
  cursor:url('../images/pirate/quill-cursor.svg') 3 29,pointer;
}
body.pirate-theme #log_main input:not([type=checkbox]):not([type=submit]):not([type=button]),
body.pirate-theme #log_main textarea {cursor:text}


/* The news link is a sized block: image and copy share one responsive frame. */
body.pirate-theme .cabin-news {display:block;position:absolute;right:3vw;top:56vh;width:300px;max-width:100%;box-sizing:border-box;text-align:left;color:#50331c;text-decoration:none;z-index:1;isolation:isolate;filter:drop-shadow(3px 12px 7px #160d0980);cursor:url('../images/pirate/quill-cursor.svg') 3 29,pointer}
.cabin-news::before,.cabin-news::after {display:none}
.cabin-news-paper {display:block;position:relative;width:100%;aspect-ratio:2/3;box-sizing:border-box;border:0;padding:0;background:url('../images/pirate/news-scrolls-v2.png') center/contain no-repeat;transition:transform .2s}
.cabin-news-content {display:block;position:absolute;top:33.333%;left:16.333%;right:16.333%;bottom:14.444%;overflow:hidden}
.cabin-news:hover .cabin-news-paper,.cabin-news:focus-visible .cabin-news-paper {transform:translateY(-3px)}
.cabin-news-eyebrow {display:block;font-size:8px;letter-spacing:1.1px;text-transform:uppercase;color:#835b32;margin-bottom:7px}
.cabin-news-content>strong {display:block;font:19px/1.2 Georgia,serif;color:#50331c}
.cabin-news-date {display:block;font-size:9px;margin:7px 0;color:#80552d}
.cabin-news-excerpt {font:12px/1.5 Georgia,serif;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;margin:9px 0;overflow-wrap:anywhere;color:#50331c}
.cabin-news-open {display:block;border-top:1px solid #93632e55;padding-top:8px;font-size:10px;line-height:1.5;color:#77401e}
body.pirate-theme .cabin-news:focus-visible {outline:2px solid #f3d294;outline-offset:5px}
@media(max-width:1100px){body.pirate-theme .cabin-news{position:relative;right:auto;top:auto;margin:30px auto 20px}}
@media(prefers-reduced-motion:reduce){.cabin-news-paper{transition:none}}

/* Public registers share the cabin and scroll with the welcome page. */
body.pirate-theme #log_main.cabin-info {width:min(660px,100%)}
body.pirate-theme #log_main.cabin-bans {width:min(900px,100%)}
.cabin-document-brand {font:14px/1.5 Georgia,serif;color:#75512d;margin:14px 0 22px}
.cabin-document-table {width:100%;overflow-x:auto;scrollbar-width:thin;scrollbar-color:#916a3b #e7c991}
body.pirate-theme #log_main.cabin-document table {width:100%;color:#49331f}
body.pirate-theme #log_main.cabin-document td {background:transparent;color:#51361e;border:0;border-bottom:1px solid #98714433;padding:10px 6px;overflow-wrap:anywhere;font-size:12px}
body.pirate-theme #log_main.cabin-document td.c {background:#a1703020;color:#53351d;font-family:Georgia,serif;font-weight:bold;padding:13px 7px}
body.pirate-theme #log_main.cabin-info th:first-child:not([colspan]) {width:56%}
body.pirate-theme #log_main.cabin-bans table {min-width:610px;table-layout:auto}
body.pirate-theme #log_main.cabin-bans td {font-size:11px}
body.pirate-theme:has(.cabin-document) .cabin-news {position:relative;right:auto;top:auto;margin:30px auto 20px}
@media(max-width:560px){body.pirate-theme #log_main.cabin-document td{font-size:11px;padding:9px 4px}body.pirate-theme #log_main.cabin-bans tr{display:table-row;margin:0}body.pirate-theme #log_main.cabin-info th:first-child:not([colspan]){width:auto}}
/* Birthday information: visible with a mouse, keyboard, or touch focus. */
.birthday-help{display:inline-block;position:relative;vertical-align:middle;margin-left:5px}
body.pirate-theme .birthday-help-button{display:inline-grid;place-items:center;width:22px;height:22px;min-width:22px;padding:0!important;border-radius:50%!important;font:bold 14px Georgia,serif;cursor:help}
.birthday-help [role=tooltip]{display:none;position:absolute;z-index:20;left:0;top:calc(100% + 8px);width:220px;max-width:65vw;box-sizing:border-box;padding:12px 14px;border:1px solid #987448;border-radius:5px;background:#fff0cf;color:#49331f;font:12px/1.5 'Trebuchet MS',Verdana,sans-serif;text-align:left;box-shadow:0 4px 14px #49331f33;white-space:normal}
.birthday-help:hover [role=tooltip],.birthday-help:focus-within [role=tooltip]{display:block}


/* Keep the two scrolls together on desktop and smaller laptop windows. */
@media(min-width:700px){
  body.pirate-theme:has(#log_main:not(.cabin-document)) > center {display:grid;grid-template-columns:minmax(0,480px) minmax(220px,300px);gap:24px;justify-content:center;align-items:start;max-width:100%}
  body.pirate-theme #log_main:not(.cabin-document) {width:100%;margin:0;min-width:0}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news {position:relative;right:auto;top:auto;width:100%;max-width:300px;margin:120px 0 0}
}
@media(min-width:700px) and (max-width:900px){
  body.pirate-theme:has(#log_main:not(.cabin-document)) {padding-left:16px;padding-right:16px}
  body.pirate-theme:has(#log_main:not(.cabin-document)) > center {grid-template-columns:minmax(0,480px) 220px;gap:14px}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-content>strong {font-size:16px}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-eyebrow {font-size:7px;letter-spacing:.5px;margin-bottom:5px}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-excerpt {font-size:10px;margin:5px 0}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-date {font-size:8px;margin:5px 0}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-open {font-size:9px;padding-top:5px}
}

/* The form stays on the screen's centre line; dispatches occupy its right margin. */
@media(min-width:700px){
  body.pirate-theme:has(#log_main:not(.cabin-document)) > center {display:block;position:relative}
  body.pirate-theme #log_main:not(.cabin-document) {width:min(480px,100%);margin:0 auto}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news {position:absolute;left:calc(50% + 252px);right:auto;top:120px;width:min(210px,calc(50vw - 270px));max-width:none;margin:0}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-content>strong {font-size:14px}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-eyebrow {display:none}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-excerpt {font-size:10px;line-height:1.4;-webkit-line-clamp:2;margin:5px 0}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-date {font-size:8px;margin:4px 0}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-open {font-size:9px;padding-top:5px}
}
@media(min-width:700px) and (max-width:1000px){
  body.pirate-theme #log_main:not(.cabin-document) {width:400px}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news {left:calc(50% + 210px);width:min(190px,calc(50vw - 225px))}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-content>strong {font-size:12px}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-excerpt {font-size:9px}
  body.pirate-theme:has(#log_main:not(.cabin-document)) .cabin-news-open {font-size:8px}
}
/* Touch screens use a smaller cabin texture and avoid fixed-background repainting. */
@media(max-width:760px), (pointer:coarse) and (max-width:1100px){
  body.pirate-theme:has(#log_main){background-image:url('../images/pirate/captains-cabin-mobile-v1.webp');background-attachment:scroll;min-width:0}
  body.pirate-theme #log_main{border-image-source:url('../images/pirate/captains-parchment-v1-mobile.webp')}
  body.pirate-theme .cabin-news-paper{background-image:url('../images/pirate/news-scrolls-v2-mobile.webp')}
}
