/* Schiffe versenken (01.11.2026): Meer mit Wellen, eigene Schiffszeichnungen (engines-schiffe.js),
   Fontäne, Explosion, Rauch und sinkendes Schiff. Alles CSS/SVG, keine fremden Grafiken.
   Bewegung aus (Einstellung „Animationen“ oder prefers-reduced-motion): nur ruhende Marken. */

/* Bühne: helle Hafenfläche statt Holztisch */
.screen-runner .scan-stage.brettspiel:has(>.brettspiel__body>.schiffebrett){border-radius:28px;background:radial-gradient(ellipse 60% 55% at 50% 45%,#ffffffe6 0,#ffffff00 75%),linear-gradient(180deg,#e6f2f9,#cde2ee);box-shadow:inset 0 0 0 1px #b9d3e3}
html[data-activity-backgrounds=off] .screen-runner .scan-stage.brettspiel:has(>.brettspiel__body>.schiffebrett){background:none;box-shadow:none}
[data-theme=cvi] .screen-runner .scan-stage.brettspiel:has(>.brettspiel__body>.schiffebrett){background:#000;box-shadow:none}
[data-theme=contrast] .screen-runner .scan-stage.brettspiel:has(>.brettspiel__body>.schiffebrett){background:none;box-shadow:none}

.screen-runner .brettspiel__board.schiffebrett,.brettspiel__board.schiffebrett{display:grid;gap:12px;position:relative;box-sizing:border-box;padding:0;background:none;border:0;aspect-ratio:auto}
.schiffebrett[data-form=quer]{grid-template-columns:minmax(0,100fr) minmax(0,40fr);grid-template-rows:minmax(0,1fr)}
.schiffebrett[data-form=hoch]{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,100fr) minmax(0,16fr);gap:8px}
.schiffe__haupt{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;position:relative}
.schiffe__seite{display:flex;flex-direction:column;gap:8px;min-width:0;min-height:0;overflow:hidden}
.schiffebrett[data-form=hoch] .schiffe__titel,.schiffebrett[data-form=hoch] .schiffe__klein{display:none}
.schiffebrett[data-form=hoch] .schiffe__flotten{flex-direction:row;gap:8px}
.schiffebrett[data-form=hoch] .schiffe__flotte{flex:1 1 0;padding:4px 6px}
.schiffe__titel{margin:0;font:700 clamp(13px,1.9vmin,19px)/1.2 system-ui,sans-serif;color:#123b5c;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.schiffe__klein{width:100%;aspect-ratio:1;flex:none;min-height:0}

/* Meer */
.schiffe__meer{display:grid;position:relative;box-sizing:border-box;overflow:hidden;border:6px solid #2f7fe0;border-radius:14px;
  background-color:#1d6fa8;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='32'%3E%3Cpath d='M0 16 Q8 9 16 16 T32 16 T48 16 T64 16' fill='none' stroke='%23ffffff' stroke-opacity='.2' stroke-width='2'/%3E%3Cpath d='M-16 30 Q-8 23 0 30 T16 30 T32 30 T48 30 T64 30' fill='none' stroke='%23ffffff' stroke-opacity='.1' stroke-width='2'/%3E%3C/svg%3E"),linear-gradient(160deg,#47a8e0,#1f74ad 55%,#165b8d);
  background-size:64px 32px,100% 100%;box-shadow:0 6px 0 #0f3d6340,0 12px 22px #0f3d6330;animation:schiffe-wellen 16s linear infinite}
.schiffe__meer--orange{border-color:#f0943a}
.schiffe__meer--gross{height:100%;max-width:100%;aspect-ratio:1}
.schiffe__meer--klein{width:100%;height:100%;border-width:4px;border-radius:9px}
@keyframes schiffe-wellen{from{background-position:0 0,0 0}to{background-position:64px 0,0 0}}

.schiffe__kopf{display:flex;align-items:center;justify-content:center;min-width:0;min-height:0;font:800 clamp(11px,2.3vmin,24px)/1 system-ui,sans-serif;color:#fff;background:#0f3d63d9;border:0;padding:0}
.schiffe__kopf.is-gewaehlt{background:#ffd24a;color:#0f2b44}
.schiffebrett button.schiffe__zeilenwahl{background:#0f3d63!important;color:#fff!important;border:2px solid #ffffff99!important;border-radius:6px;cursor:pointer;font:800 clamp(12px,2.4vmin,26px)/1 system-ui,sans-serif}
.schiffebrett .brettspiel__cell.schiffe__feld,.schiffe__feld{position:relative;min-width:0;min-height:0;box-sizing:border-box;border:1px solid #ffffff30!important;border-radius:0!important;background:transparent!important;padding:0;z-index:1;box-shadow:none}
.schiffebrett .brettspiel__cell.schiffe__feld:not(:disabled){cursor:crosshair}
.schiffebrett .brettspiel__cell.schiffe__feld:not(:disabled):hover{background:#ffffff26!important}
.schiffe__feld--ruhig{opacity:.45}
.schiffebrett .schiffe__feld.brettspiel__tipp{box-shadow:inset 0 0 0 4px #ffd24a!important;background:#ffd24a33!important}

/* Schiffe (img mit eigener SVG) */
.schiffe__schiff{width:100%;height:100%;min-width:0;min-height:0;box-sizing:border-box;padding:7%;z-index:2;pointer-events:none;object-fit:fill;filter:drop-shadow(0 3px 2px #06223a99)}
.schiffe__meer--klein .schiffe__schiff{padding:5%;filter:none}
.schiffe__schiff--wrack{filter:grayscale(.75) brightness(.72) drop-shadow(0 2px 2px #06223a80);opacity:.9}
.schiffe__schiff--aufgedeckt{opacity:.62}
.schiffe__schiff--sinkt{animation:schiffe-sinken 1.9s ease-in both}
.schiffe__schiff--neu{animation:schiffe-auftauchen .45s ease-out both}
@keyframes schiffe-sinken{0%{transform:none;filter:none;opacity:1}30%{transform:rotate(-3deg) translateY(2%)}100%{transform:rotate(-6deg) translateY(8%) scale(.94);filter:grayscale(.75) brightness(.72);opacity:.9}}
@keyframes schiffe-auftauchen{from{transform:scale(.8);opacity:0}to{transform:none;opacity:1}}

/* Marken: Wasser, Treffer, sicheres Wasser (Hilfen) */
.schiffe__marke{z-index:3;pointer-events:none;align-self:center;justify-self:center;width:64%;height:64%;border-radius:50%}
.schiffe__marke--wasser{background:radial-gradient(circle,#f2faff 0 24%,#a9d8f4 26% 40%,#ffffff00 42%),radial-gradient(circle,#ffffff00 54%,#ffffffcc 56% 64%,#ffffff00 66%)}
.schiffe__marke--treffer{width:84%;height:84%;border-radius:0;background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cpath d='M20 2l4 9 9-4-4 9 9 4-9 4 4 9-9-4-4 9-4-9-9 4 4-9-9-4 9-4-4-9 9 4z' fill='%23ff8a1f' stroke='%237a1d00' stroke-width='1.6' stroke-linejoin='round'/%3E%3Ccircle cx='20' cy='20' r='6.5' fill='%23d62b0e'/%3E%3Ccircle cx='20' cy='20' r='2.6' fill='%23ffe36b'/%3E%3C/svg%3E") center/contain no-repeat}
.schiffe__marke--rand{width:20%;height:20%;background:#ffffff70}

/* Fontäne (Wasser) */
.schiffe__fx{position:relative;z-index:4;pointer-events:none;width:100%;height:100%;overflow:visible}
.schiffe__fx--fontaene i{position:absolute;left:50%;bottom:40%;width:18%;height:26%;border-radius:50% 50% 50% 50%/60% 60% 40% 40%;background:linear-gradient(#ffffff,#9fd6f5);opacity:0;animation:schiffe-tropfen .95s ease-out both;animation-delay:calc(var(--k) * 25ms)}
.schiffe__ring{position:absolute;inset:18%;border:3px solid #ffffff;border-radius:50%;animation:schiffe-ring .9s ease-out both}
@keyframes schiffe-tropfen{0%{transform:translate(-50%,0) scale(.5);opacity:1}45%{transform:translate(calc(-50% + (var(--k) - 3) * 38%),-230%) scale(1);opacity:1}100%{transform:translate(calc(-50% + (var(--k) - 3) * 60%),30%) scale(.6);opacity:0}}
@keyframes schiffe-ring{from{transform:scale(.3);opacity:1}to{transform:scale(1.7);opacity:0}}

/* Explosion mit Funken und Rauch (Treffer/Versenkt) */
.schiffe__fx--explosion:before{content:'';position:absolute;inset:-35%;border-radius:50%;background:radial-gradient(circle,#fffbe0 0,#ffd23f 24%,#ff7b1a 48%,#c22b0b 66%,#c22b0b00 72%);animation:schiffe-blitz .65s ease-out both}
.schiffe__fx--explosion i{position:absolute;left:41%;top:41%;width:18%;height:18%;border-radius:50%;background:radial-gradient(circle,#fff6a8,#ffb02e 45%,#e2420f 75%,#e2420f00 78%);transform:rotate(calc(var(--k) * 45deg));animation:schiffe-funke .75s ease-out both}
.schiffe__rauch{position:absolute;left:25%;top:20%;width:50%;height:50%;border-radius:50%;background:radial-gradient(circle,#59626dd9,#59626d00 70%);opacity:0;animation:schiffe-rauch 1.9s ease-out both;animation-delay:calc(.2s + var(--k) * .15s)}
@keyframes schiffe-blitz{0%{transform:scale(.2);opacity:1}55%{transform:scale(1);opacity:.95}100%{transform:scale(1.25);opacity:0}}
@keyframes schiffe-funke{from{transform:rotate(calc(var(--k) * 45deg)) translateY(0) scale(1);opacity:1}to{transform:rotate(calc(var(--k) * 45deg)) translateY(-170%) scale(.35);opacity:0}}
@keyframes schiffe-rauch{0%{transform:translate(0,0) scale(.6);opacity:0}25%{opacity:.85}100%{transform:translate(calc((var(--k) - 1) * 30%),-150%) scale(1.9);opacity:0}}

/* Sichtschutz beim Wechsel zu zweit */
.schiffe__vorhang{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3%;width:100%;height:100%;box-sizing:border-box;padding:6%;border-radius:18px;text-align:center;color:#fff;
  background:repeating-linear-gradient(135deg,#183f63 0 18px,#1d4a73 18px 36px);font:700 clamp(18px,3.2vmin,34px)/1.25 system-ui,sans-serif;box-shadow:0 6px 0 #0f3d6340}
.schiffe__vorhang svg{width:22%;height:auto;max-width:140px}
.schiffe__vorhang span{font-size:.62em;font-weight:600;opacity:.92}

/* Flottenliste */
.schiffe__flotten{display:flex;flex-direction:column;gap:8px;min-height:0;min-width:0;overflow:hidden}
.schiffe__flotte{background:#ffffffde;border-radius:10px;padding:6px 8px;box-shadow:0 2px 0 #0f3d6322;min-width:0}
.schiffe__flotte-name{display:block;font:700 clamp(12px,1.7vmin,17px)/1.2 system-ui,sans-serif;color:#123b5c}
.schiffe__flotte-reihe{display:flex;flex-wrap:wrap;gap:4px 6px;margin-top:4px}
.schiffe__mini{height:clamp(10px,2.3vmin,22px);width:calc(var(--len) * clamp(10px,2.3vmin,22px))}
.schiffe__mini--weg{opacity:.3;filter:grayscale(1)}

/* Bewegung aus */
html[data-activity-animations=off] .schiffe__fx{display:none}
html[data-activity-animations=off] .schiffe__meer,html[data-activity-animations=off] .schiffe__schiff--sinkt,html[data-activity-animations=off] .schiffe__schiff--neu{animation:none}
@media(prefers-reduced-motion:reduce){.schiffe__fx{display:none}.schiffe__meer,.schiffe__schiff--sinkt,.schiffe__schiff--neu{animation:none}}

/* CVI und Kontrast: schwarzes Meer, weiße Linien, gelbe Treffer */
[data-theme=cvi] .schiffe__meer,[data-theme=contrast] .schiffe__meer{background:#000!important;border-color:#fff!important;animation:none;box-shadow:none}
[data-theme=cvi] .schiffe__meer--orange,[data-theme=contrast] .schiffe__meer--orange{border-style:dashed!important}
[data-theme=cvi] .schiffebrett .schiffe__feld,[data-theme=contrast] .schiffebrett .schiffe__feld{border-color:#ffffff8c!important}
[data-theme=cvi] .schiffe__kopf,[data-theme=contrast] .schiffe__kopf{background:#000;color:#ffdf00}
[data-theme=cvi] .schiffebrett button.schiffe__zeilenwahl,[data-theme=contrast] .schiffebrett button.schiffe__zeilenwahl{background:#000!important;color:#ffdf00!important;border-color:#ffdf00!important}
[data-theme=cvi] .schiffe__kopf.is-gewaehlt,[data-theme=contrast] .schiffe__kopf.is-gewaehlt{background:#ffdf00;color:#000}
[data-theme=cvi] .schiffe__marke--treffer,[data-theme=contrast] .schiffe__marke--treffer{width:70%;height:70%;border-radius:50%;background:radial-gradient(circle,#ffdf00 0 40%,#000 42% 52%,#ffdf00 54% 70%,#ffdf0000 72%)}
[data-theme=cvi] .schiffe__marke--wasser,[data-theme=contrast] .schiffe__marke--wasser{background:radial-gradient(circle,#ffffff00 46%,#fff 48% 64%,#ffffff00 66%)}
[data-theme=cvi] .schiffe__schiff,[data-theme=contrast] .schiffe__schiff{filter:drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1px #fff)}
[data-theme=cvi] .schiffe__schiff--wrack,[data-theme=contrast] .schiffe__schiff--wrack{filter:grayscale(1) brightness(.6) drop-shadow(0 0 1.5px #fff);opacity:1}
[data-theme=cvi] .schiffe__titel,[data-theme=contrast] .schiffe__titel{color:#fff}
[data-theme=cvi] .schiffe__flotte,[data-theme=contrast] .schiffe__flotte{background:#000;border:2px solid #fff;box-shadow:none}
[data-theme=cvi] .schiffe__flotte-name,[data-theme=contrast] .schiffe__flotte-name{color:#fff}
[data-theme=cvi] .schiffe__vorhang,[data-theme=contrast] .schiffe__vorhang{background:#000;border:3px solid #fff;box-shadow:none}
[data-theme=cvi] .schiffebrett .schiffe__feld.brettspiel__tipp,[data-theme=contrast] .schiffebrett .schiffe__feld.brettspiel__tipp{box-shadow:inset 0 0 0 5px #ffdf00!important;background:#ffdf0040!important}
