/* Painted instruments and live labels share one physical console. */
@font-face { font-family: 'Pirata One'; src: url('/fonts/PirataOne-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Barlow Condensed'; src: url('/fonts/BarlowCondensed-Bold.ttf') format('truetype'); font-weight: 700 900; font-display: swap; }
.theme-sinking-ship { --ship-ink: #261b13; --ship-paper: #ffeac0; --ship-brass: #e9b969; font-family: 'Barlow Condensed', sans-serif; }
.theme-sinking-ship h1, .theme-sinking-ship h2, .theme-sinking-ship h3 { font-family: 'Pirata One', serif; font-weight: 400 !important; }
.theme-sinking-ship .bg-fx { display: none; }
.theme-sinking-ship.player-app { max-width: 42rem; background: #271911 url('/images/sinking-ship/console.webp') center top / 100% auto repeat-y; }
.theme-sinking-ship .player-screen { background: transparent; }
.sinking-ship-panel {
  min-height: 100dvh; padding: 0 .7rem 1rem; overflow: visible; color: var(--ship-paper);
  background: linear-gradient(#140d0960, #140d0960), #271911 url('/images/sinking-ship/console.webp') center top / 100% auto repeat-y;
  font-family: 'Barlow Condensed', sans-serif; text-shadow: 0 2px 3px #100900;
}
.sinking-ship-panel.is-critical { animation: none; }
.sinking-ship-panel::before { display: none; }
.sinking-ship-panel [hidden], .sinking-ship-host [hidden] { display: none !important; }
.ship-protocol-mismatch > :not(.ship-protocol-message) { display: none !important; }
.ship-panel__status {
  position: sticky; top: 0; z-index: 30; margin: 0 -.7rem; padding: max(.35rem, env(safe-area-inset-top)) .7rem .25rem;
  background: #271911 url('/images/sinking-ship/console.webp') center top / 100% auto;
  box-shadow: 0 8px 12px #160c0899;
}
.ship-run-progress { min-height: 1.25rem; margin-bottom: .2rem; }
.ship-run-progress__leg { font: 400 1.2rem/1 'Pirata One', serif; letter-spacing: .04em; }
.ship-run-progress__leg::before { content: ''; }
.ship-run-progress__best { padding: 0; color: #edcb91; border: 0; border-radius: 0; background: none; font-size: .8rem; letter-spacing: .05em; }
.ship-water-gauge { height: 1.3rem; border: 1px solid #b78a4a; border-radius: 2px; background: #102525; box-shadow: inset 0 2px 5px #000b; }
.ship-water-gauge__text { font: 700 .8rem/1 'Barlow Condensed', sans-serif; letter-spacing: .05em; }
.ship-water-gauge__fill { background: linear-gradient(90deg, #187c87, #48aeb3); }
.is-critical .ship-water-gauge__fill { background: #ba4136; }
.ship-command-card, .ship-command-card.is-procedure {
  position: relative; top: auto; display: grid; gap: .2rem; margin: .25rem 0 .1rem; padding: .55rem .7rem;
  border: 1px solid #b68c56; border-radius: .2rem; color: var(--ship-ink); text-shadow: none;
  background: #f4dfb5;
  box-shadow: none; backdrop-filter: none;
}
.ship-command-card__eyebrow { color: #784224; font: 700 .75rem/1 'Barlow Condensed', sans-serif; letter-spacing: .08em; }
.ship-command-card__text, .ship-command-card.is-procedure .ship-command-card__text { color: #261b13; font: 700 clamp(1.1rem, 5.2vw, 1.45rem)/1.08 'Barlow Condensed', sans-serif; letter-spacing: 0; }
.ship-command-card__timer { height: .22rem; background: #70421f33; margin: .2rem 0 0; }
.ship-command-card__timer-fill { background: #167b7b; }
.ship-command-card.is-hurry .ship-command-card__timer-fill { background: #b63a2e; }
.ship-command-card__timer-text { color: #744020; font: 700 .75rem/1 'Barlow Condensed', sans-serif; height: auto; }
.ship-command-card.is-hurry { animation: none; }
.ship-command-card.is-calibration .ship-command-card__eyebrow { color: #12615e; }
.ship-command-details { margin: 0; color: #694427; font-size: .85rem; }
.ship-command-details summary { cursor: pointer; font-size: .75rem; }
.ship-procedure__heading { color: #784224; font-size: .75rem; }
.ship-procedure__progress { color: #261b13; }
.ship-procedure__steps:empty { display: none; }
.ship-procedure__steps li { color: #3f2919; background: none; border: 0; padding: 0; }
.ship-procedure__steps li > small { color: #5b3920; }
.ship-console-heading { margin: .5rem 0 .25rem; padding: 0 .15rem; }
.ship-console-heading span { font: 400 1.3rem/1.1 'Pirata One', serif; letter-spacing: .02em; color: #f4d495; }
.ship-console-heading small { color: #e4c7a2; font-size: .8rem; }
.ship-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; padding: 0; }
.ship-widget {
  min-width: 0; min-height: 180px; padding: .5rem .3rem .6rem; border: 1px solid #d7a55b55; border-radius: .3rem;
  background: #21150f99; box-shadow: inset 0 1px #ffe3ab14; overflow: visible;
}
.ship-widget button { touch-action: manipulation; }
.ship-widget .ship-wheel__face, .ship-widget .ship-slider__input, .ship-widget .ship-pump__handle { touch-action: none; }
.ship-widget::after, .ship-widget__plate::after { display: none; }
.ship-widget__plate { display: block; margin: 0 0 .25rem; padding: 0; border: 0; background: none; }
.ship-widget__label { display: block; min-height: 2.1em; color: #ffedc4; font: 700 1rem/1.08 'Barlow Condensed', sans-serif; letter-spacing: .015em; overflow-wrap: anywhere; }
.ship-widget__station { display: block; color: #d3b078; font: 700 .65rem/1.1 'Barlow Condensed', sans-serif; letter-spacing: .1em; margin-top: .15rem; }
.ship-widget.is-locked { opacity: .5; }
.ship-controls button:focus-visible, .ship-controls input:focus-visible, .ship-command-details summary:focus-visible { outline: 3px solid #9ce6db; outline-offset: 2px; }
.ship-widget.is-locked::before { content: 'LOCKED'; font: 400 1.35rem 'Pirata One', serif; }
.ship-widget__malfunction { position: relative; left: auto; right: auto; bottom: auto; width: 100%; min-height: 48px; padding: .4rem; margin: .15rem 0; font: 700 .85rem 'Barlow Condensed', sans-serif; border-radius: 0; border: 1px solid #f2bb70; background: #722d20; }
.ship-widget.has-malfunction { box-shadow: none; }
.ship-widget.is-corrupted .ship-widget__plate, .ship-widget.is-ghost-echo .ship-widget__plate { box-shadow: none; }
.ship-lever__rail { width: 54px; height: 77px; margin: 0 auto; border: 0; border-radius: 0; background: url('/images/sinking-ship/lever-base.webp') center / contain no-repeat; box-shadow: none; }
.ship-lever__handle {
  left: 50%; top: calc((1 - var(--ship-lever-position, 0)) * 22px); width: 48px; height: 55px; min-height: 48px;
  transform: translateX(-50%); border: 0; border-radius: 0; background: url('/images/sinking-ship/lever-handle.webp') center / contain no-repeat; box-shadow: none;
}
.ship-lever__positions { gap: .1rem; margin-top: .15rem; }
.ship-lever__position { min-width: 48px; min-height: 48px; padding: .1rem; color: #ffedc4; background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font: 700 .75rem 'Barlow Condensed', sans-serif; text-shadow: 0 2px 2px #000; box-shadow: none; }
.ship-lever__position.is-current { border-color: #f1c071; color: #ffdc82; background: #3c251855; box-shadow: none; }
.ship-wheel__compass { position: relative; width: 142px; height: 120px; margin: 0 auto; }
.ship-wheel__face { position: absolute; inset: 13px 22px; width: 98px; height: 98px; margin: 0; padding: 0; border: 0; background: none; box-shadow: none; transform: none; }
.ship-wheel__art { display: block; width: 100%; height: 100%; background: url('/images/sinking-ship/wheel.webp') center / contain no-repeat; transform: rotate(var(--ship-wheel-angle, 0deg)); transition: transform .12s; }
.ship-wheel__bearing { position: absolute; left: calc(50% + var(--bearing-x) * 60px); top: calc(50% + var(--bearing-y) * 55px); transform: translate(-50%, -50%); color: #ffe2a5; font: 700 .75rem 'Barlow Condensed', sans-serif; pointer-events: none; }
.ship-slider__input { appearance: none; box-sizing: border-box; display: block; width: 100%; height: 64px; min-height: 48px; padding: 0 6px; margin: .5rem 0 .2rem; border: 0; outline: 0; background: url('/images/sinking-ship/slider-track.webp') center / 100% 48px no-repeat; }
.ship-slider__input::-webkit-slider-runnable-track { height: 48px; background: transparent; }
.ship-slider__input::-webkit-slider-thumb { appearance: none; width: 48px; height: 48px; border: 0; background: url('/images/sinking-ship/slider-handle.webp') center / contain no-repeat; cursor: grab; }
.ship-slider__input::-moz-range-track { height: 48px; background: transparent; }
.ship-slider__input::-moz-range-thumb { width: 48px; height: 48px; border: 0; border-radius: 0; background: url('/images/sinking-ship/slider-handle.webp') center / contain no-repeat; }
.ship-slider__notches { flex-wrap: wrap; justify-content: space-between; color: #f1d5a5; font: 700 .7rem 'Barlow Condensed', sans-serif; gap: .2rem .35rem; }
.ship-slider__notches span { min-width: 0; overflow-wrap: anywhere; }
.ship-slider__readout, .ship-wheel__readout, .ship-sequence__readout, .ship-signal__entered { display: block; min-width: 0; padding: .15rem 0; color: #ffe6b7; background: none; border: 0; border-radius: 0; font: 700 .8rem/1.1 'Barlow Condensed', sans-serif; text-shadow: 0 2px 2px #000; overflow-wrap: anywhere; }
.ship-sequence__pad, .ship-signal__pad { gap: .12rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ship-sequence__button, .ship-signal__button {
  min-width: 0; min-height: 48px; padding: .2rem; border: 0; border-radius: 0; box-shadow: none;
  background: url('/images/sinking-ship/cannon-key.webp') center / 100% 100% no-repeat;
  color: #fff2cb; font: 700 .8rem/1 'Barlow Condensed', sans-serif; text-shadow: 0 1px 3px #000, 0 0 4px #000;
}
.ship-signal__button { background-image: url('/images/sinking-ship/signal-key.webp'); color: #122b28; text-shadow: 0 1px 1px #91d5c8; }
.ship-sequence__button:active, .ship-signal__button:active { transform: translateY(2px); box-shadow: none; }
.ship-pad-footer { display: flex; gap: .2rem; align-items: center; justify-content: space-between; }
.ship-pad-clear { flex: none; min-width: 48px; min-height: 48px; padding: .1rem; color: #edd1a0; background: none; border: 0; font: 700 .75rem 'Barlow Condensed', sans-serif; text-decoration: underline; }
.ship-pad-clear:disabled { opacity: .45; }
.ship-pump__handle { display: flex; gap: .2rem; justify-content: center; align-items: center; width: 100%; min-height: 98px; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; color: #ffdf94; }
.ship-pump__art { display: block; width: 98px; height: 98px; background: url('/images/sinking-ship/pump.webp') center / contain no-repeat; }
.ship-pump__handle strong { font: 400 1.3rem 'Pirata One', serif; }
.ship-pump__handle:active .ship-pump__art { transform: translateY(3px) rotate(-3deg); }
.ship-pump__handle:active { box-shadow: none; }
.ship-pump__gauge { height: .4rem; margin: .25rem .3rem 0; background: #120e08; border-radius: 1px; }
.ship-pump__fill { background: #51b7ad; }
.ship-alert-stack { z-index: 20; }
.ship-hazard-banner { padding: .4rem 0; margin: .2rem 0; background: none; border: 0; border-radius: 0; color: #ffcf8b; font: 700 .85rem/1.1 'Barlow Condensed', sans-serif; }
.ship-translator-card { padding: .4rem .6rem; margin: .2rem 0 0; border: 1px solid #75c7b8; border-radius: .2rem; background: #173f37; }
.ship-translator-card__eyebrow { font: 700 .8rem 'Barlow Condensed', sans-serif; letter-spacing: .04em; }
.ship-translator-card__decode { font-size: 1.05rem; }
.ship-emergency-overlay { border: 2px solid #d5a556; border-radius: 0; padding: .6rem; gap: .3rem; background: #3b2316 url('/images/sinking-ship/console.webp') center / cover; }
.ship-emergency-overlay__title { color: #ffe2a5; font: 400 1.65rem 'Pirata One', serif; }
.ship-emergency-overlay__hint, .ship-emergency-overlay__timer { font-size: 1rem; }
.ship-emergency-overlay__button { min-height: 48px; border: 0; border-radius: 0; color: #261b13; background: url('/images/sinking-ship/parchment.webp') center / 100% 100%; font: 700 1.3rem 'Barlow Condensed', sans-serif; box-shadow: none; }
.ship-emergency-overlay__button:disabled { opacity: .5; }
.ship-damage-report, .ship-results-card { border: 0; border-radius: 0; background: #382215 url('/images/sinking-ship/console.webp') center / cover; color: #ffe5b1; }
.ship-damage-report strong, .ship-results-card__title { color: #ffe5b1; font: 400 2rem 'Pirata One', serif; }
.ship-intro-copy { font: 700 1.3rem/1.5 'Barlow Condensed', sans-serif; color: #ffdfac; }
.theme-sinking-ship .ship-voyage-choice { display: flex; flex-direction: column; gap: .3rem; min-height: 108px; padding: 1.1rem 2rem; border: 0 !important; border-radius: 0; color: #382215 !important; background: url('/images/sinking-ship/parchment.webp') center / 100% 100% no-repeat !important; box-shadow: none; }
.ship-voyage-choice span { font: 400 1.8rem 'Pirata One', serif; }
.ship-voyage-choice small { font: 700 1rem/1.1 'Barlow Condensed', sans-serif; }
.ship-voyage-choice.btn-primary { filter: drop-shadow(0 0 5px #65cfc1); }
.ship-voyage-choice.btn-primary span::before { content: '✓ '; }
.theme-sinking-ship .timer-badge { background: none; color: #f6d391; font-family: 'Pirata One', serif; }
.theme-sinking-ship .choice-display-card { background: url('/images/sinking-ship/parchment.webp') center / 100% 100% no-repeat; color: #382215; border: 0; border-radius: 0; padding: 2rem; font-family: 'Pirata One', serif; }
.theme-sinking-ship .choice-display-card small { display: block; margin-top: .5rem; font: 700 1.2rem 'Barlow Condensed', sans-serif; }
.ship-stage { background: #123341 url('/images/sinking-ship/sea.webp') center / cover; }
.ship-stage__sky { display: none; }
.ship-stage__vessel { z-index: 4; width: min(76vw, 1050px); left: 12%; top: 15%; }
.ship-stage__ship-art { filter: drop-shadow(0 12px 15px #071c21aa); }
.ship-stage__water { z-index: 5; background: #095064 url('/images/sinking-ship/sea.webp') center bottom / auto 400% repeat-x; opacity: .93; }
.ship-stage__water::before { height: 18px; border: 0; background: url('/images/sinking-ship/sea.webp') center bottom / 100% auto; box-shadow: none; }
.ship-stage__foam, .ship-stage__bubbles { display: none; }
.ship-stage__water-readout { z-index: 8; border: 0; border-radius: 0; background: #3f2618 url('/images/sinking-ship/console.webp') center / cover; padding: .8rem; }
.ship-stage__water-readout strong { font: 400 2.8rem 'Pirata One', serif; color: #fbe1a7; }
.ship-stage__water-readout span { font: 700 .9rem 'Barlow Condensed', sans-serif; }
.ship-stage__hazard { z-index: 9; border: 0; border-radius: 0; padding: .5rem 1.6rem; background: #392315 url('/images/sinking-ship/console.webp') center / cover; font: 400 2.2rem 'Pirata One', serif; transform: none; }
.ship-stage__hazard-item { display: flex; align-items: center; gap: .5rem; background: none; }
.ship-stage__hazard-item::before { content: ''; display: inline-block; flex: none; width: 88px; height: 88px; background: url('/images/sinking-ship/hazards.webp') 0 0 / 300% 200% no-repeat; }
.ship-stage__hazard--storm::before { background-position: 50% 0; }
.ship-stage__hazard--navy-frigate::before { background-position: 100% 0; }
.ship-stage__hazard--ghost-ship::before { background-position: 0 100%; }
.ship-stage__hazard--siren-song::before { background-position: 50% 100%; }
.ship-stage__hazard--whirlpool::before { background-position: 100% 100%; }
.ship-host-dashboard { z-index: 10; border: 0; border-radius: 0; background: #382215 url('/images/sinking-ship/console.webp') center / cover; padding: .9rem; }
.ship-host-progress { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: #ffe3a5; }
.ship-host-progress strong { font: 400 2rem 'Pirata One', serif; }
.ship-host-progress span { font: 700 1rem 'Barlow Condensed', sans-serif; }
.ship-activity-pip { border-radius: 0; background: none; font-size: 1rem; }
.ship-command-feed { font-size: 1.1rem; }
.ship-run-summary__title { font-family: 'Pirata One', serif; font-weight: 400; }
@media (max-width: 359px) { .ship-widget { padding-inline: .2rem; } .ship-wheel__compass { width: min(142px, 100%); } }
@media (min-width: 560px) { .ship-widget { min-height: 190px; } .ship-widget__label { font-size: 1.1rem; } }
@media (prefers-reduced-motion: reduce) { .ship-wheel__art { transition: none; } }
