/* Pirate page visual identity: warm chart-room by day, lantern-lit ship by night.
   Scoped to the pirate page. The WebGL scene, barrel, swords, island and flight
   animations keep their own colors, geometry and game logic. */

/* Shared material: antique brass, timber, the chart-paper edge. */
html[data-theme] body.standalone-hub-page-pirate {
  --pirate-brass:#b88747;
  --pirate-ink:#1d4050;
}
html[data-theme] body.standalone-hub-page-pirate .intro {
  position:relative;
  border-bottom:1px solid var(--pirate-divider);
}
html[data-theme] body.standalone-hub-page-pirate .intro-coin {
  border-color:#e2b668;
  box-shadow:0 0 0 5px #c18b422b,0 16px 22px #172b2e3b,inset 0 2px 15px #ffecc7b8;
}
html[data-theme] body.standalone-hub-page-pirate :is(.setup,.sidebar,.howto,.game-heading,.result) {
  position:relative;
  box-shadow:0 14px 28px #09232d23,inset 0 1px #fff3cc24;
}
html[data-theme] body.standalone-hub-page-pirate .primary {
  background:linear-gradient(140deg,#ffda87,#d8994d);
  color:#25353d;
  border:1px solid #c28b45;
  box-shadow:0 4px 0 #8c5728,0 8px 19px #5d392b26;
}
html[data-theme] body.standalone-hub-page-pirate :is(.primary,.secondary,.subtle,.view-toggle):focus-visible {
  outline:3px solid #c99538;outline-offset:3px;
}

/* DAY — sunlit harbor, ivory sails, hand-drawn parchment, blue-green sea. */
html[data-theme="light"] body.standalone-hub-page-pirate {
  --pirate-divider:#a8c5bd;
  background:
    radial-gradient(ellipse 55% 350px at 70% 1%,#c8e9e4aa 0,transparent 100%),
    repeating-linear-gradient(0deg,transparent 0 73px,#3f7d8721 74px 75px),
    linear-gradient(160deg,#edf3e8 0%,#f6efdd 46%,#ede3cb 100%);
  color:#234450;
}
html[data-theme="light"] body.standalone-hub-page-pirate .intro-eyebrow {color:#80542b;}
html[data-theme="light"] body.standalone-hub-page-pirate .intro h1 {
  color:#19495a;text-shadow:0 2px 0 #fff6d5;
}
html[data-theme="light"] body.standalone-hub-page-pirate .intro p {color:#3d6065;}
html[data-theme="light"] body.standalone-hub-page-pirate .intro p strong {color:#21555b;}
html[data-theme="light"] body.standalone-hub-page-pirate .intro-tags span {
  background:#fff8e8;border:1px solid #c9ac79;color:#36545a;
  box-shadow:0 1px 0 #fffdf6;
}
html[data-theme="light"] body.standalone-hub-page-pirate .setup {
  background:
    radial-gradient(ellipse at 88% 10%,#ffffff92 0,transparent 42%),
    repeating-linear-gradient(0deg,transparent 0 41px,#b98f5430 42px 43px),
    linear-gradient(125deg,#fff6df,#eadaba);
  color:#2b4850;border:2px solid #c9a566;
}
html[data-theme="light"] body.standalone-hub-page-pirate .setup .eyebrow {color:#845722;}
html[data-theme="light"] body.standalone-hub-page-pirate .setup :is(.panel-heading h2,.count-field) {color:#274b53;}
html[data-theme="light"] body.standalone-hub-page-pirate .count-field select {
  color:#294750;background:#fffdf2;border-color:#bca16f;
}
html[data-theme="light"] body.standalone-hub-page-pirate .setup-footer {border-top-color:#c9ae7e;}
html[data-theme="light"] body.standalone-hub-page-pirate .ug-dice-style-roster .ug-dice-style-row.ug-participant-row {
  background:#fffaec!important;border-color:#ccb78d!important;
}
html[data-theme="light"] body.standalone-hub-page-pirate .ug-dice-style-roster .ug-dice-style-row:focus-within {
  background:#fffdf7!important;border-color:#977044!important;
}
html[data-theme="light"] body.standalone-hub-page-pirate .ug-dice-style-roster .ug-dice-style-row .ug-participant-avatar {
  background:#e1d9be;border-color:#baa275;color:#284750;
}
html[data-theme="light"] body.standalone-hub-page-pirate .ug-dice-style-controls .ug-dice-style-add {
  background:#275e5a;border-color:#275e5a;color:#fff;
}
html[data-theme="light"] body.standalone-hub-page-pirate .game-heading {
  background:linear-gradient(112deg,#fff5dc,#e9e1ce);
  border-color:#c5a268;
}
html[data-theme="light"] body.standalone-hub-page-pirate .game-heading .eyebrow {color:#7a572f;}
html[data-theme="light"] body.standalone-hub-page-pirate .game-heading :is(h2,p) {color:#2b5057;}
html[data-theme="light"] body.standalone-hub-page-pirate .game-heading h2 span:first-child {color:#965032;}
html[data-theme="light"] body.standalone-hub-page-pirate .round-status {
  background:linear-gradient(140deg,#205361,#16414d);border-color:#336779;
}
html[data-theme="light"] body.standalone-hub-page-pirate :is(.stage,.stage.is-3d) {
  background:
    radial-gradient(circle at 78% 16%,#fff8d1ed 0,#fff0bf8c 8%,transparent 28%),
    linear-gradient(180deg,#91c4d1 0%,#c5e0d7 40%,#5aa1af 45%,#2d758b 78%,#174d65 100%);
  border-color:#c79e60;
  box-shadow:inset 0 0 0 7px #234e5773,inset 0 0 0 9px #fff1c557,0 14px 30px #19485241;
}
html[data-theme="light"] body.standalone-hub-page-pirate .pirate-horizon {
  background:linear-gradient(180deg,transparent 0 39%,#f8f4d24d 42%,#2c80922a 45%,#103e6a24 100%);
}
html[data-theme="light"] body.standalone-hub-page-pirate .pirate-horizon::after {
  background:linear-gradient(90deg,transparent,#fff7d7df 45%,#e4ffedc9 75%,transparent);
}
html[data-theme="light"] body.standalone-hub-page-pirate .horizon-cloud {
  background:#fffef2a3;filter:blur(5px);
}
html[data-theme="light"] body.standalone-hub-page-pirate .horizon-cloud::after {background:#ffffffb3;}
html[data-theme="light"] body.standalone-hub-page-pirate .stage-marquee {
  color:#fff2d4;background:#1c4f62e8;border-color:#e1b777;
  box-shadow:0 3px 0 #0d374a7a;
}
html[data-theme="light"] body.standalone-hub-page-pirate .stage-caption {
  color:#fff8e5;background:#163e51e6;border-color:#c4e8df6d;
}
html[data-theme="light"] body.standalone-hub-page-pirate .view-toggle {
  color:#fff5de;background:#1a4d60ed;border-color:#f1cf91;
}
html[data-theme="light"] body.standalone-hub-page-pirate .sidebar {
  color:#29474a;background:linear-gradient(150deg,#fff5de,#e9d8b6);
  border-color:#cba764;
}
html[data-theme="light"] body.standalone-hub-page-pirate .sidebar :is(.side-heading h3,.chance-note strong) {color:#30484b;}
html[data-theme="light"] body.standalone-hub-page-pirate .score-micro>span {
  background:#fff9eb;border-color:#d0b78b;color:#425f61;
}
html[data-theme="light"] body.standalone-hub-page-pirate .turn-list li {
  background:#fff9eb;border-color:#d0b78d;color:#344e50;
}
html[data-theme="light"] body.standalone-hub-page-pirate .turn-list li.active {
  background:#fdf0ca;border-color:#bd8c4a;
}
html[data-theme="light"] body.standalone-hub-page-pirate .turn-list li.lost {
  background:#f8dfd0;border-color:#bc8773;color:#813b2d;
}
html[data-theme="light"] body.standalone-hub-page-pirate .chance-note {
  background:#f1e3c6;border-color:#c5aa78;color:#334a4b;
}
html[data-theme="light"] body.standalone-hub-page-pirate .howto.panel {
  background:linear-gradient(125deg,#fff9e8,#e6e3ce);
  border-color:#d0b585;color:#2f4c51;
}
html[data-theme="light"] body.standalone-hub-page-pirate .howto :is(h2,.eyebrow,.howto-grid b) {color:#63461e;}
html[data-theme="light"] body.standalone-hub-page-pirate .howto-grid>div {border-top-color:#c4ad7f;}
html[data-theme="light"] body.standalone-hub-page-pirate .howto-grid p {color:#4c6363;}
html[data-theme="light"] body.standalone-hub-page-pirate .seo-related-games {
  background:linear-gradient(135deg,#fff8e7,#e7e9dc);
  border-color:#c9ae7a;color:#294a50;
}
html[data-theme="light"] body.standalone-hub-page-pirate .seo-related-copy h2 {color:#284b50!important;}
html[data-theme="light"] body.standalone-hub-page-pirate .seo-related-copy p {color:#4c6262;}
html[data-theme="light"] body.standalone-hub-page-pirate .seo-related-links a {
  background:#fffbef!important;border-color:#cdb68b;color:#28474c!important;
}
html[data-theme="light"] body.standalone-hub-page-pirate .seo-related-links a:hover {
  background:#f4e9ca!important;border-color:#9a7746;
}
html[data-theme="light"] body.standalone-hub-page-pirate .seo-related-icon {background:#e8dcc1;}
html[data-theme="light"] body.standalone-hub-page-pirate .seo-related-links :is(strong,small) {color:#39585d;}

/* NIGHT — lantern-lit timber and moonlit sea, not washed-out light cards. */
html[data-theme="dark"] body.standalone-hub-page-pirate {
  --pirate-divider:#7f744f80;
  background:
    radial-gradient(ellipse 40% 370px at 83% 5%,#5367737a 0,transparent 90%),
    repeating-linear-gradient(90deg,transparent 0 74px,#8b745314 75px 77px),
    linear-gradient(165deg,#122b38,#071d2e 68%,#102d38);
  color:#f6ead0;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .intro-eyebrow {color:#f0cb86;}
html[data-theme="dark"] body.standalone-hub-page-pirate .intro h1 {color:#fff0c9;text-shadow:0 3px 1px #071b22;}
html[data-theme="dark"] body.standalone-hub-page-pirate .intro p {color:#cce0da;}
html[data-theme="dark"] body.standalone-hub-page-pirate .intro p strong {color:#fbe3a7;}
html[data-theme="dark"] body.standalone-hub-page-pirate .intro-tags span {
  color:#f5dfb3;background:#1c3946;border-color:#9d8255;
}
html[data-theme="dark"] body.standalone-hub-page-pirate :is(.setup,.sidebar,.howto,.game-heading,.result) {
  background:
    repeating-linear-gradient(0deg,transparent 0 34px,#be98600c 35px 36px),
    linear-gradient(133deg,#234047,#182e38 65%,#152931);
  color:#f6edda;border:1px solid #806b4ba8;
  box-shadow:inset 0 1px #e7ba7940,0 16px 29px #000a;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .setup .eyebrow,
html[data-theme="dark"] body.standalone-hub-page-pirate .game-heading .eyebrow,
html[data-theme="dark"] body.standalone-hub-page-pirate .sidebar .eyebrow,
html[data-theme="dark"] body.standalone-hub-page-pirate .howto .eyebrow {color:#efc68b;}
html[data-theme="dark"] body.standalone-hub-page-pirate :is(.setup .panel-heading h2,.game-heading h2,.side-heading h3,.howto h2) {color:#fdf0d2;}
html[data-theme="dark"] body.standalone-hub-page-pirate :is(
  .setup .panel-heading p,.setup-footer p,.game-heading p,.side-subtitle,.howto-grid p
) {color:#c9d7d2;}
html[data-theme="dark"] body.standalone-hub-page-pirate .count-field {color:#f2deba;}
html[data-theme="dark"] body.standalone-hub-page-pirate .count-field select {
  color:#f8e8c8;background:#203b46;border:1px solid #9d8359;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .setup-footer {border-top-color:#846e4e;}
html[data-theme="dark"] body.standalone-hub-page-pirate .ug-dice-style-roster .ug-dice-style-row.ug-participant-row {
  background:#132d39!important;color:#f3e9d1!important;border-color:#6c7567!important;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .ug-dice-style-roster .ug-dice-style-row:focus-within {
  background:#24454e!important;border-color:#f1cd90!important;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .ug-dice-style-roster .ug-dice-style-row .ug-participant-avatar {
  background:#3b5960!important;border-color:#a38f6d!important;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .ug-dice-style-controls .ug-dice-style-add {
  background:#e6bd76;color:#213742;border-color:#f0d19b;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .ug-dice-style-controls .ug-dice-style-count {
  color:#e3d2b0;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .game-heading h2 span:first-child {color:#ffcc81;}
/* Shared text tokens otherwise paint these two labels dark even on the night panel. */
html[data-theme="dark"] body.standalone-hub-page-pirate .game-heading #turn-suffix {color:#f6e9d1!important;}
html[data-theme="dark"] body.standalone-hub-page-pirate .game-heading #turn-help {color:#c9d7d2!important;}
html[data-theme="dark"] body.standalone-hub-page-pirate .round-status {
  background:linear-gradient(145deg,#0e2734,#203d48);border-color:#9f8555;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .round-status>span,
html[data-theme="dark"] body.standalone-hub-page-pirate .round-status small {color:#e6d8ba;}
html[data-theme="dark"] body.standalone-hub-page-pirate :is(.stage,.stage.is-3d) {
  background:
    radial-gradient(circle at 81% 13%,#e6e0c477 0,#b7c8d334 9%,transparent 25%),
    radial-gradient(ellipse at 48% 67%,#4172856b 0,transparent 63%),
    linear-gradient(180deg,#1b3549 0,#0e2d44 41%,#14435a 44%,#081e31 100%);
  border-color:#b38b50;
  box-shadow:inset 0 0 0 7px #071723cf,inset 0 0 0 9px #e5b96c3b,0 17px 29px #000a;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-horizon {
  background:linear-gradient(180deg,transparent 0 42%,#a4c6d51b 44%,#123e5f80 46%,#081e3399 100%);
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-horizon::after {
  background:linear-gradient(90deg,transparent,#aac8d17d 43%,#e9d9a68f 64%,transparent);
}
html[data-theme="dark"] body.standalone-hub-page-pirate .horizon-cloud {background:#bbd0d638;}
html[data-theme="dark"] body.standalone-hub-page-pirate .stage-marquee {
  color:#ffe4b2;background:#071f2ce8;border-color:#b9955c;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .stage-caption {
  color:#f6e8c9;background:#0b2536de;border-color:#c6a46d5e;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .view-toggle {
  color:#ffe2b2;background:#0a293acc;border-color:#be995e;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .score-micro>span,
html[data-theme="dark"] body.standalone-hub-page-pirate .turn-list li {
  color:#e4e9df;background:#112d37;border-color:#63756f;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .score-micro strong {color:#ffca7a;}
html[data-theme="dark"] body.standalone-hub-page-pirate .turn-list li.active {
  background:#37483c;border-color:#edbc6f;box-shadow:inset 4px 0 #e9b768;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .turn-list li.lost {
  background:#503538;border-color:#b87a65;color:#ffe7d7;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .turn-list small {color:#d2d7c9;}
html[data-theme="dark"] body.standalone-hub-page-pirate .chance-note {
  color:#f9e7c0;background:#163039;border:1px solid #8a744f;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .chance-icon {
  color:#f8dfaa;background:#344341;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .chance-note p {color:#c9d4d1;}
html[data-theme="dark"] body.standalone-hub-page-pirate .secondary {
  color:#ffdfaa;background:#204853;border-color:#9d855d;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .subtle {
  color:#e4d6b6;background:#183641;border-color:#816e50;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .howto-grid>div {border-top-color:#826c4c;}
html[data-theme="dark"] body.standalone-hub-page-pirate .howto-grid b {color:#efca8b;}
html[data-theme="dark"] body.standalone-hub-page-pirate :is(.fair-note,.credits,.credits p) {color:#c6d2cf;}
html[data-theme="dark"] body.standalone-hub-page-pirate .credits summary {color:#f0cb92;}
html[data-theme="dark"] body.standalone-hub-page-pirate .credits a {color:#f6d38e;}
html[data-theme="dark"] body.standalone-hub-page-pirate .result {
  background:linear-gradient(130deg,#344a40,#223842);border-color:#e2b66f;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .result :is(div span,p) {color:#e8d4b1;}
html[data-theme="dark"] body.standalone-hub-page-pirate .result strong {color:#ffd18b;}
html[data-theme="dark"] body.standalone-hub-page-pirate .seo-related-games {
  background:linear-gradient(145deg,#213c42,#142b35);border-color:#796948;
  color:#f9ebd2;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .seo-related-copy h2 {color:#f9ebd2;}
html[data-theme="dark"] body.standalone-hub-page-pirate .seo-related-copy p {color:#cbd9d2;}
html[data-theme="dark"] body.standalone-hub-page-pirate .seo-related-links a {
  background:#1b3741!important;color:#f7ebd2!important;border-color:#816e4f;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .seo-related-links a:hover {
  background:#294d53!important;border-color:#dfb773;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .seo-related-icon {background:#34535b;}
html[data-theme="dark"] body.standalone-hub-page-pirate .seo-related-links strong {color:#f8e9ce;}
html[data-theme="dark"] body.standalone-hub-page-pirate .seo-related-links small {color:#c7d8d1;}

/* Keep touch targets and responsive layout from the shared components. */
@media (max-width:500px) {
  html[data-theme] body.standalone-hub-page-pirate .intro {padding-bottom:22px;}
  html[data-theme] body.standalone-hub-page-pirate .stage-marquee {max-width:calc(100% - 110px);overflow:hidden;text-overflow:ellipsis;}
}
@media (prefers-reduced-motion:reduce) {
  html[data-theme] body.standalone-hub-page-pirate .intro-coin {transition:none;}
}

/* Result announcement remains readable on parchment by day and deck wood at night. */
html[data-theme="light"] body.standalone-hub-page-pirate .result #rescue-result-headline{
  color:#62451f;font-size:14px;line-height:1.5;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .result #rescue-result-headline{
  color:#ffe4a6;font-size:14px;line-height:1.5;
}

/* Dark & Day theme polish for Tension Bar, Shuffle Button & Live Voyage Log */
html[data-theme="dark"] body.standalone-hub-page-pirate .intro {
  background:
    radial-gradient(ellipse at 85% 20%, #e5b86921 0%, transparent 55%),
    linear-gradient(135deg, #1d3946 0%, #132833 65%, #0f212b 100%);
  border-color: #8f7750a8;
  box-shadow: 0 16px 32px #0008, inset 0 1px 0 #f2c87e30;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .ug-dice-style-controls .ug-dice-style-shuffle {
  background: #203d48;
  color: #f6e7c8;
  border-color: #967e56;
  box-shadow: 0 2px 0 #0b1c24;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-tension-bar {
  background: linear-gradient(135deg, #1d3740 0%, #142831 100%);
  border-color: #88724e;
  box-shadow: 0 10px 22px #0007, inset 0 1px 0 #e8be7a2e;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .tension-detail {
  color: #e4decb;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .tension-track {
  background: #0a1b24;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-box {
  background: #132b35;
  border-color: #6b7972;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-head {
  color: #f3e4c3;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-head small {
  color: #c2d0cb;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-list li {
  background: #1a3642;
  border-color: #556a68;
  color: #eef1e6;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-list li.log-empty {
  color: #b8c8c4;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-list li.is-pop {
  background: #4e3133;
  border-color: #c27c68;
  color: #ffe8d9;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-list .log-outcome {
  color: #8ce0b5;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-list li.is-pop .log-outcome {
  color: #ffb49e;
}

html[data-theme="dark"] body.standalone-hub-page-pirate .streak-badge {
  background: #27444e;
  color: #ffd588;
  border-color: #9e8355;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-speech {
  background: #132d3bf0;
  color: #f7ebd2;
  border-color: #c89f5d;
  box-shadow: 0 8px 20px #0009;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-speech::after {
  border-color: #c89f5d;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-speech strong {
  color: #fff2d6;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-speech[data-mood="near-miss"],
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-speech[data-mood="critical"] {
  background: #3d2428f2;
  border-color: #e07655;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-list li.is-near {
  background: #3d2c24;
  border-color: #c98552;
  color: #ffead4;
}
html[data-theme="dark"] body.standalone-hub-page-pirate .pirate-log-list li.is-near .log-outcome {
  color: #ffad75;
}
