/* Theme chooser stays in the organiser's existing interface. */
.theme-options { border: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 16px; }
.theme-options legend { margin-bottom: 12px; }
.theme-option { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 2px solid #71839e; border-radius: 18px; cursor: pointer; }
.theme-option:has(input:checked) { border-color: #ffc046; box-shadow: 0 0 0 2px #ffc04644; }
.theme-option input { width: 22px; height: 22px; margin: 0; accent-color: #e3a72f; }
.theme-sample { min-height: 150px; padding: 20px; display: flex; flex-direction: column; gap: 12px; border-radius: 12px; }
.theme-sample-classic { color: #fff; background: linear-gradient(135deg,#071126,#164871); }
.theme-sample-pirate { color: #3c2917; background: linear-gradient(135deg,#fff5d8,#efd59e); font-family: Georgia,serif; }
.theme-sample-button { align-self: flex-start; background: #ffc046; color: #172c3b; padding: 8px 14px; border-radius: 9px; font: bold 15px Arial,sans-serif; }
.theme-sample-pirate .theme-sample-button { background: #155b67; color: #fff; }
.theme-sample-pirate strong { color: #3c2917; }
.theme-note { font-size: .95rem; color: var(--muted); }
.theme-voyage { display: none; }

html[data-game-theme="pirate"] {
  --text: #33271b; --muted: #62513a; --panel: #fff5dc; --panel-strong: #f7e7c1;
  --panel-soft: #f4e5c5; --line: #a58b5b; --accent-hot: #e3ae39; --accent-hot-2: #72500d;
  --accent-cold: #155c68; --accent-cold-2: #237c84; --ok: #246641; --danger: #a52828;
}
html[data-game-theme="pirate"] body {
  font-family: "Trebuchet MS",Arial,sans-serif; color: var(--text); letter-spacing: 0;
  background: radial-gradient(ellipse at 15% 0%,#59b9b5 0,transparent 42%),linear-gradient(155deg,#157783,#16485e 60%,#0b344a);
}
html[data-game-theme="pirate"] body::before { background: repeating-radial-gradient(ellipse at 0 0,transparent 0 55px,#ffffff18 56px 58px,transparent 59px 110px); opacity: .7; }
html[data-game-theme="pirate"] body::after { display:none; }
html[data-game-theme="pirate"] .theme-voyage { display:flex; align-items:center; justify-content:center; gap:16px; padding:22px 16px 0; color:#fff4d5; font:bold 1rem Georgia,serif; letter-spacing:.12em; text-align:center; }
.theme-voyage svg { width:56px; height:56px; flex-shrink:0; }
html[data-game-theme="pirate"] .card,
html[data-game-theme="pirate"] .hero-shell {
  color:var(--text); background:linear-gradient(135deg,#fff8e7,#f2dfb5); border:2px solid #dfc58d;
  border-radius:20px 28px 22px 26px; box-shadow:0 14px 32px #00273655,inset 0 0 25px #b8903717;
}
html[data-game-theme="pirate"] :is(h1,h2,h3,.assignment-name,.timer) { font-family:Georgia,"Times New Roman",serif; color:#3e2b18; text-shadow:none; letter-spacing:0; }
html[data-game-theme="pirate"] h1 { font-size:clamp(1.9rem,6vw,3.4rem); line-height:1.12; text-transform:none; }
html[data-game-theme="pirate"] :is(.eyebrow,.assignment-kicker,.assignment-label,.timer-meta) { color:#72500d; }
html[data-game-theme="pirate"] :is(.screen-copy,.hero-content p,.brief-item p,.assignment-directive,.scanner-hint,.register-player-hint,.meta,.feedback,.scores-locked p) { color:#4b422f; }
html[data-game-theme="pirate"] :is(.meta,.feedback,.stand-box,.assignment-hero,.assignment-empty,.brief-item,.scores-locked,.public-row,.scanner-panel) { background:#fff9e9; border-color:#d4bd8e; box-shadow:none; }
html[data-game-theme="pirate"] .assignment-hero::before { display:none; }
html[data-game-theme="pirate"] :is(button,.button) { background:#155b67; color:#fffaf0; border:1px solid #104b55; box-shadow:0 4px 0 #0b3c45; text-shadow:none; font-family:"Trebuchet MS",Arial,sans-serif; font-weight:700; }
html[data-game-theme="pirate"] :is(button,.button):hover { background:#1c7180; }
html[data-game-theme="pirate"] :is(button.secondary,.button.secondary) { background:#f3dc9f; color:#423018; border-color:#a88949; box-shadow:0 3px 0 #b39760; }
html[data-game-theme="pirate"] :is(input,select,textarea) { background:#fffdf6; color:#33271b; border:2px solid #a68c60; border-radius:12px; }
html[data-game-theme="pirate"] input::placeholder { color:#796a52; opacity:1; }
html[data-game-theme="pirate"] .status-chip { background:#e7d4a9; color:#483619; border-color:#b79b62; }
html[data-game-theme="pirate"] .feedback.error { background:#fff1e7; color:#932828; border-color:#b84e3e; }
html[data-game-theme="pirate"] .hero-media { display:none; }
html[data-game-theme="pirate"] .hero-shell { grid-template-columns:1fr; }
html[data-game-theme="pirate"] .hero-content { max-width:none; }
html[data-game-theme="pirate"] .register-diagonals,
html[data-game-theme="pirate"] .register-runes,
html[data-game-theme="pirate"] .glitch-title::before,
html[data-game-theme="pirate"] .glitch-title::after { display:none; }
html[data-game-theme="pirate"] .glitch-title { animation:none !important; }
html[data-game-theme="pirate"] :is(.card,.hero-shell,.register-intro,.register-panel) { animation:none !important; opacity:1; transform:none; }
html[data-game-theme="pirate"] .register-intro::before,
html[data-game-theme="pirate"] .register-intro::after { display:none; }
html[data-game-theme="pirate"] :is(.hint-overlay-card,.game-over-card,.start-burst-core,.result-burst-core) { background:#fff2cf; color:#33271b; border:2px solid #bc934a; box-shadow:0 18px 50px #032b3d80; }
html[data-game-theme="pirate"] :is(.hint-overlay-card,.game-over-card,.start-burst-core,.result-burst-core) p { color:#574124; }
html[data-game-theme="pirate"] :is(.start-burst-core,.result-burst-core) h2 { color:#155b67; text-shadow:none; }
html[data-game-theme="pirate"] .assignment-photo { border-radius:16px; }
html[data-game-theme="pirate"] a:not(.button) { color:#155b67; }
html[data-game-theme="pirate"] :focus-visible { outline-color:#a94a11; }
@media (prefers-reduced-motion:reduce) { .theme-sample { transition:none; } }

/* Captain's log: tactile wood, rope, brass and real parchment. */
.pirate-hero-illustration,.pirate-story-card { display:none; }
html[data-game-theme="pirate"] body {
  background:linear-gradient(#17303966,#13222388),url('pirate/ship-wood-v2.webp') center top / 640px auto repeat;
}
html[data-game-theme="pirate"] body::before,html[data-game-theme="pirate"] body::after { display:none; }
html[data-game-theme="pirate"] .theme-voyage {
  width:min(1100px,calc(100% - 32px)); margin:20px auto 0; padding:14px 24px;
  background:linear-gradient(#47260c30,#170e0880),url('pirate/ship-wood-v2.webp') center / 600px;
  border:3px ridge #c4a16a; border-radius:9px; color:#ffedbd;
  box-shadow:inset 0 2px 2px #ffe0a46b,inset 0 -3px 4px #170c08,0 8px 15px #0008;
  font-size:clamp(.95rem,2vw,1.25rem); letter-spacing:.03em; text-shadow:0 2px 1px #1f1008;
}
html[data-game-theme="pirate"] .theme-voyage small { font:normal .8rem "Trebuchet MS",sans-serif; letter-spacing:.12em; }
html[data-game-theme="pirate"] .theme-voyage svg { width:42px;height:42px; }
html[data-game-theme="pirate"] .card {
  background:linear-gradient(#fff6dfbb,#fff1d4c9),url('pirate/treasure-map-v2.webp') center / cover;
  border:1px solid #a88249; border-radius:8px 13px 10px 15px;
  box-shadow:inset 0 0 30px #8e59152b,inset 0 1px 0 #fff6d7,0 2px 0 #79532f,0 12px 24px #110b0888;
}
html[data-game-theme="pirate"] .hero-shell {
  display:grid; grid-template-columns:1.12fr 1fr; gap:0; overflow:hidden;
  padding:10px; background:url('pirate/ship-wood-v2.webp') center/700px;
  border:7px ridge #c4a16a; border-radius:14px; box-shadow:0 18px 35px #100b09a8,inset 0 0 5px #170d04;
  border-image:repeating-linear-gradient(35deg,#67421f 0 2px,#ba9056 3px 5px,#efd19a 6px 8px,#916633 9px 12px) 7;
}
html[data-game-theme="pirate"] .pirate-hero-illustration {
  display:flex; flex-direction:column; margin:0; padding:0;
  background:#38200f; border:2px solid #634021; box-shadow:inset 0 0 15px #110805;
}
.pirate-hero-illustration img { display:block; width:100%; height:auto; object-fit:contain; }
html[data-game-theme="pirate"] .pirate-hero-illustration img { flex:1; object-fit:contain; background:#28190f; }
.pirate-hero-illustration figcaption { padding:12px 18px; text-align:center; color:#f5ddb1; font:italic .95rem Georgia,serif; }
html[data-game-theme="pirate"] .hero-content { margin:0; padding:clamp(22px,3vw,40px); border-radius:4px; box-shadow:inset 0 0 35px #9a64272b; }
html[data-game-theme="pirate"] .landing .hero-content h1 { max-width:20ch; font-size:clamp(1.9rem,3.5vw,3rem); line-height:1.1; text-shadow:0 1px 0 #fff9e5; }
html[data-game-theme="pirate"] .landing { display:grid; gap:24px; }
html[data-game-theme="pirate"] .pirate-story-card { display:block; margin:0 0 24px; padding:7px; background:url('pirate/ship-wood-v2.webp') center/500px; border:5px ridge #c7a26a; border-radius:10px; box-shadow:0 10px 22px #100b0980; }
.pirate-story-card img { display:block; width:100%; height:auto; border-radius:4px; }
html[data-game-theme="pirate"] .register-shell .pirate-story-card { width:min(100%,600px); margin-inline:auto; }
html[data-game-theme="pirate"] :is(button,.button) {
  position:relative; background:linear-gradient(#a5763b12,#24130788),url('pirate/ship-wood-v2.webp') center/360px;
  border:2px solid #c09b5c; border-radius:8px; color:#fff4cf; text-shadow:0 2px 1px #160a02;
  box-shadow:inset 0 2px 1px #efcb8b9c,inset 0 -2px 2px #2b1406,0 4px 0 #291709,0 6px 8px #2b160854;
}
html[data-game-theme="pirate"] :is(button,.button):hover { background:linear-gradient(#edc78320,#24130760),url('pirate/ship-wood-v2.webp') center/360px; }
html[data-game-theme="pirate"] :is(button,.button):active { transform:translateY(3px); box-shadow:inset 0 2px 5px #1c0d07,0 1px 0 #291709; }
html[data-game-theme="pirate"] :is(button.secondary,.button.secondary) {
  background:linear-gradient(#fff8d25c,#996b2438),url('pirate/treasure-map-v2.webp') center/500px;
  color:#493018; text-shadow:0 1px #fff3c8; border-color:#8e663a;
  box-shadow:inset 0 2px 0 #fff0b9,0 3px 0 #6c4727,0 5px 8px #26140740;
}
html[data-game-theme="pirate"] :is(.meta,.assignment-hero,.assignment-empty,.scores-locked) {
  background:linear-gradient(#fff8e0db,#fff4d7d9),url('pirate/treasure-map-v2.webp') center/cover;
  border:4px double #987444; border-radius:6px; box-shadow:inset 0 0 12px #94612026,0 2px 3px #563b182b;
}
html[data-game-theme="pirate"] :is(input,select,textarea) { background:#fff9e8; border:2px solid #957446; box-shadow:inset 0 2px 4px #63411d38,0 1px 0 #fff7d8; }
html[data-game-theme="pirate"] .timer { display:table; padding:10px 16px; margin:14px 0; background:linear-gradient(115deg,#78501f,#dec48b 8%,#f6e2ad 48%,#bb9250 95%,#684017); border:3px ridge #ad854d; border-radius:8px; color:#38250f; box-shadow:inset 0 1px 0 #fff1c6,0 3px 7px #62411c45; font-variant-numeric:tabular-nums; }
html[data-game-theme="pirate"] .status-chip { background:linear-gradient(#ead299,#c3a062); border:2px ridge #b18c4b; box-shadow:0 1px 2px #5b361b55; color:#38260f; }
.theme-sample-pirate { background:linear-gradient(#fff4d8cc,#f0d29999),url('pirate/treasure-map-v2.webp') center/cover; border:3px ridge #a9854a; }
.theme-sample-pirate .theme-sample-button { background:url('pirate/ship-wood-v2.webp') center/300px; color:#fff4d2; border:2px ridge #bca06c; box-shadow:0 3px 0 #412515; }
@media (max-width:800px) {
  html[data-game-theme="pirate"] .hero-shell { grid-template-columns:minmax(0,1fr); padding:5px; border-width:5px; }
  html[data-game-theme="pirate"] .pirate-hero-illustration img { width:100%; height:auto; flex:none; }
  html[data-game-theme="pirate"] .theme-voyage { padding:10px 12px; gap:10px; }
  html[data-game-theme="pirate"] .theme-voyage svg { width:32px;height:32px; }
  html[data-game-theme="pirate"] .landing .hero-content h1 { font-size:clamp(1.85rem,7vw,2.6rem); }
  html[data-game-theme="pirate"] .timer { max-width:100%; padding:8px 10px; }
}
