/* De to nye spilleborde. Sidens top og almindelige knapper kommer fra games.css. */
.duel-setup {
  position: relative;
  overflow: hidden;
}
.duel-start-copy {
  max-width: 640px;
  position: relative;
  z-index: 1;
}
.duel-start-copy h2 {
  font:
    500 30px/1.2 Georgia,
    serif;
  margin: 12px 0;
}
.duel-start-copy > p:last-child {
  color: #bfd3c6;
  line-height: 1.7;
  font-size: 14px;
}
.duel-lobby {
  max-width: 440px;
  margin-top: 26px;
  position: relative;
  z-index: 1;
}
.duel-lobby--multi {
  max-width: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.duel-form {
  display: grid;
  gap: 10px;
  align-content: end;
  min-width: 0;
}
.duel-form h3 {
  margin: 0 0 10px;
  font-size: 18px;
}
.duel-form input {
  width: 100%;
}
.duel-form label {
  display: grid;
  gap: 6px;
}
.duel-form .abc-button {
  width: 100%;
  margin-top: 8px;
  min-height: 48px;
}
.duel-join-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.duel-start-art {
  position: absolute;
  right: 35px;
  bottom: 35px;
  width: 37%;
  pointer-events: none;
  opacity: 0.8;
  transform: rotate(-9deg);
}
.duel-lobby--multi ~ .duel-start-art {
  display: none;
}
.start-fleet {
  display: grid;
  gap: 8px;
  filter: drop-shadow(0 6px 6px #0006);
}
.start-fleet > span {
  height: 42px;
  display: block;
}
.start-fleet > span:nth-child(2) {
  width: 85%;
  margin-left: 12%;
}
.start-fleet > span:nth-child(3),
.start-fleet > span:nth-child(4) {
  width: 65%;
  margin-left: 30%;
}
.start-fleet > span:last-child {
  width: 50%;
  margin-left: 45%;
}
.start-discs {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 18px;
  background: #3d7464;
  border-radius: 16px;
}
.start-discs i {
  aspect-ratio: 1;
  border-radius: 50%;
  background: #0d2e26;
  box-shadow: inset 0 3px 5px #0006;
}
.start-discs .gold {
  background: #edcf8a;
}
.start-discs .red {
  background: #d95861;
}
#duel-error {
  color: #ffd3c7;
  background: #85393140;
  border: 1px solid #e58a7966;
  padding: 14px 18px;
  border-radius: 12px;
  line-height: 1.6;
}
.duel-room-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 18px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: #c7d9cc;
}
.duel-players {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.duel-player {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  background: #ffffff08;
  border: 1px solid #ffffff20;
  border-radius: 14px;
  min-width: 0;
}
.duel-player.is-turn {
  border-color: #edcf8a;
  background: #edcf8a0c;
}
.duel-player strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
}
.duel-player small {
  display: block;
  margin-top: 4px;
  color: #bdd2c4;
  font-size: 12px;
}
.duel-player-dot {
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff55;
  border-radius: 50%;
  flex: none;
}
.duel-player-dot.player-0 {
  background: #e3656d;
}
.duel-player-dot.player-1 {
  background: #edcf8a;
}
.duel-status {
  background: #ffffff08;
  border: 1px solid #ffffff20;
  border-radius: 14px;
  padding: 15px 18px;
  margin-bottom: 20px;
  line-height: 1.65;
  font-size: 14px;
}
.duel-wait {
  text-align: center;
  padding: 50px 20px !important;
}
.duel-wait-icon {
  font-size: 60px;
  color: #edcf8a;
}
.duel-wait p {
  max-width: 440px;
  margin: 14px auto;
}
.duel-result {
  text-align: center;
}
.duel-result h2 {
  font:
    500 30px Georgia,
    serif;
}
.duel-result .abc-button {
  min-width: 180px;
}
.duel-busy
  :is(
    .duel-form button,
    .connect-column,
    .duel-cell,
    .fleet-choice,
    #fleet-ready,
    #fleet-random,
    #fleet-clear,
    #fleet-rotate
  ) {
  pointer-events: none;
}
.duel-busy #duel-status {
  opacity: 0.75;
}
#duel-rules {
  width: min(600px, calc(100% - 30px));
  max-height: 85vh;
  padding: 28px;
  color: #edf5e9;
}
#duel-rules::backdrop {
  background: #000a;
  backdrop-filter: blur(4px);
}
#duel-rules h2 {
  padding-right: 25px;
  font:
    500 28px Georgia,
    serif;
}
#duel-rules p {
  line-height: 1.75;
  font-size: 14px;
}
#duel-close-help {
  position: absolute;
  right: 12px;
  top: 12px;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Fire på stribe: syv separate kolonneknapper oven over brættet. */
.connect-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(240px, 1fr);
  gap: 28px;
  align-items: start;
}
.connect-board-wrap {
  padding: 0 14px 22px;
  position: relative;
  max-width: 680px;
}
.connect-buttons {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 0 16px 8px;
}
.connect-column {
  border: 1px solid #ffffff20;
  background: #ffffff08;
  color: #edcf8a;
  border-radius: 10px;
  padding: 5px 0;
  cursor: pointer;
  min-height: 44px;
}
.connect-column span {
  display: block;
  font-size: 23px;
  line-height: 1.1;
}
.connect-column small {
  font:
    11px system-ui,
    sans-serif;
}
.connect-column:hover:not(:disabled) {
  background: #edcf8a26;
  border-color: #edcf8a;
}
.connect-column:disabled {
  opacity: 0.3;
  cursor: default;
}
.connect-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 16px;
  border-radius: 19px;
  border: 1px solid #ffffff30;
  background: linear-gradient(135deg, #417e6e, #245448);
  box-shadow:
    0 9px 0 #142f28,
    0 20px 40px #0004,
    inset 0 1px 0 #ffffff50;
}
.connect-slot {
  padding: 6%;
  aspect-ratio: 1;
  background: #08291f;
  border-radius: 50%;
  box-shadow:
    inset 0 4px 6px #0008,
    0 1px 0 #ffffff30;
}
.connect-slot > span {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.connect-slot.disc-0 > span {
  background: radial-gradient(circle at 35% 25%, #f89698, #d34e59 70%);
  box-shadow:
    inset 0 0 0 4px #f8989b55,
    0 3px 3px #0007;
}
.connect-slot.disc-1 > span {
  background: radial-gradient(circle at 35% 25%, #ffecb0, #d5ab53 70%);
  box-shadow:
    inset 0 0 0 4px #fff2b955,
    0 3px 3px #0007;
}
.connect-slot.last-disc > span {
  outline: 2px solid #fff9;
  outline-offset: -7px;
}
.connect-slot.is-winning > span {
  outline: 4px solid #fff;
  outline-offset: -4px;
  filter: brightness(1.16);
}
.connect-feet::before,
.connect-feet::after {
  content: "";
  position: absolute;
  bottom: 0;
  width: 21%;
  height: 16px;
  border-radius: 8px;
  background: #608d71;
  box-shadow: 0 4px 0 #162e24;
}
.connect-feet::before {
  left: 1%;
}
.connect-feet::after {
  right: 1%;
}
.connect-guide {
  margin-top: 54px !important;
}
.connect-guide h2 {
  font:
    500 32px Georgia,
    serif;
  margin: 15px 0;
}
.connect-guide p {
  font-size: 14px;
}
.connect-example {
  display: flex;
  gap: 9px;
  margin: 25px 0;
}
.connect-example i {
  width: 35px;
  height: 35px;
  background: #edcf8a;
  border: 3px solid #fff3;
  border-radius: 50%;
}
#connect-count {
  border-top: 1px solid #ffffff20;
  padding-top: 18px;
  font-size: 12px;
  color: #bcd0c0;
}
/* Havkort: markører ligger over skibsmodellerne. Ingen animationer blinker under spillet. */
.sea-placement {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr);
  gap: 24px;
  align-items: start;
}
.sea-battle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.abc-game .sea-panel,
.abc-game .fleet-controls {
  margin: 0;
}
.sea-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.sea-heading h2 {
  margin: 6px 0 0;
  font:
    500 25px/1.2 Georgia,
    serif;
}
.sea-heading > span {
  color: #c3d9d2;
  font-size: 12px;
  white-space: nowrap;
}
.sea-map {
  --sea-label: 20px;
  width: 100%;
}
.sea-numbers {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  padding-left: var(--sea-label);
  margin-bottom: 6px;
  color: #9abcb9;
  font-size: 10px;
  text-align: center;
}
.sea-map-row {
  display: flex;
}
.sea-letters {
  display: grid;
  grid-template-rows: repeat(10, minmax(0, 1fr));
  flex: 0 0 var(--sea-label);
  color: #9abcb9;
  font-size: 10px;
  align-items: center;
}
.sea-grid {
  position: relative;
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  aspect-ratio: 1;
  background: #102f38;
  border: 1px solid #70959480;
  border-radius: 5px;
  overflow: hidden;
}
.sea-cell {
  aspect-ratio: 1;
  width: 100%;
  min-width: 0;
  border: 0;
  border-right: 1px solid #8fb9be25;
  border-bottom: 1px solid #8fb9be25;
  padding: 0;
  border-radius: 0;
  background: #22505a30;
  position: relative;
  cursor: crosshair;
  touch-action: manipulation;
}
.sea-cell:nth-child(even) {
  background: #39667117;
}
.sea-cell:disabled {
  opacity: 1;
  cursor: default;
}
.sea-cell:hover:not(:disabled),
.sea-cell.preview {
  background: #76bc974a;
}
.sea-cell.invalid {
  background: #cc6e624d;
}
.sea-cell:focus-visible {
  z-index: 6;
  outline-offset: -3px !important;
}
.sea-cell::after {
  position: absolute;
  z-index: 4;
  inset: 26%;
  border-radius: 50%;
  pointer-events: none;
}
.sea-cell.is-hit::after {
  content: "";
  background: #f27f6f;
  border: 2px solid #ffd2b8;
  box-shadow: 0 0 0 3px #d7464030;
}
.sea-cell.is-miss::after {
  content: "";
  inset: 40%;
  background: #d6e6df;
}
.sea-cell.is-last {
  box-shadow: inset 0 0 0 2px #edcf8a;
}
.sea-ships {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}
.fleet-silhouette {
  position: absolute;
  display: block;
  padding: 2px;
  filter: drop-shadow(0 2px 1px #0008);
}
.fleet-silhouette.is-selected {
  filter: drop-shadow(0 0 3px #f1d28c);
}
.fleet-silhouette.is-sunk {
  opacity: 0.65;
}
.ship-model {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
}
.ship-hull {
  fill: #aebdb5;
  stroke: #e4e7ca;
  stroke-width: 3;
}
.ship-deck {
  fill: #718a81;
  stroke: #c2cfc1;
  stroke-width: 2;
}
.ship-tower {
  fill: #536e67;
  stroke: #d1d9b9;
  stroke-width: 2;
}
.ship-turret {
  fill: #9eada0;
  stroke: #e0e2be;
  stroke-width: 2;
}
.ship-guns,
.ship-line {
  fill: none;
  stroke: #e3e1c6;
  stroke-width: 5;
  stroke-linecap: round;
}
.ship-runway {
  stroke: #e3dfb0;
  stroke-width: 3;
  stroke-dasharray: 15 8;
}
.ship-plane {
  fill: none;
  stroke: #e7e6d1;
  stroke-width: 4;
  stroke-linecap: round;
}
.ship-window {
  fill: #314d57;
  stroke: #9ec7c4;
  stroke-width: 2;
}
.ship-fin {
  fill: #668b8c;
  stroke: #bad9d0;
  stroke-width: 2;
}
.sub-hull {
  fill: #78999a;
  stroke: #c2dbd1;
}
.fleet-controls > h2 {
  font:
    500 28px Georgia,
    serif;
  margin: 10px 0;
}
.fleet-controls .hint {
  font-size: 13px;
  line-height: 1.65;
}
.fleet-picker {
  display: grid;
  gap: 7px;
  margin: 20px 0;
}
.fleet-map-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
}
.fleet-map-tools p {
  margin: 0;
  color: #d8e4d8;
  font-size: 12px;
  line-height: 1.5;
}
.abc-game .fleet-map-tools .abc-button {
  font-size: 12px;
  padding: 10px 12px;
  flex: none;
}
.fleet-choice {
  display: grid;
  grid-template-columns: 110px 1fr;
  align-items: center;
  gap: 15px;
  padding: 10px 12px;
  border: 1px solid #ffffff20;
  border-radius: 12px;
  background: #ffffff05;
  color: #eff1df;
  cursor: pointer;
  text-align: left;
  min-height: 61px;
}
.fleet-choice .ship-model {
  height: 29px;
}
.fleet-choice strong {
  display: block;
  font:
    650 13px system-ui,
    sans-serif;
}
.fleet-choice small {
  display: block;
  margin-top: 4px;
  color: #b9ccc0;
  font:
    11px system-ui,
    sans-serif;
}
.fleet-choice.is-selected {
  border-color: #edcf8a;
  background: #edcf8a12;
}
.fleet-choice:hover {
  background: #ffffff0c;
}
.fleet-tools {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.abc-game .fleet-tools .abc-button {
  font-size: 12px;
  padding: 10px 12px;
}
.abc-game #fleet-ready {
  width: 100%;
  margin-top: 4px;
}
.fleet-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 9px;
  margin: 18px 0 0 20px;
}
.fleet-summary > span {
  text-align: center;
  min-width: 0;
}
.fleet-summary .ship-model {
  height: 22px;
}
.fleet-summary small {
  display: block;
  font-size: 9px;
  color: #c3d4ca;
  margin-top: 6px;
}
.fleet-summary .is-sunk {
  opacity: 0.35;
}
.fleet-summary .is-sunk small {
  text-decoration: line-through;
}
@media (max-width: 850px) {
  .sea-placement {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 0.9fr);
    gap: 16px;
  }
  .fleet-choice {
    grid-template-columns: 85px 1fr;
    gap: 10px;
  }
  .sea-battle {
    gap: 14px;
  }
  .sea-heading h2 {
    font-size: 21px;
  }
  .connect-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(200px, 1fr);
    gap: 14px;
  }
}
@media (max-width: 700px) {
  .sea-placement,
  .sea-battle,
  .connect-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sea-placement .sea-panel {
    max-width: 560px;
    width: 100%;
    margin-inline: auto;
  }
  .fleet-controls {
    width: 100%;
  }
  .fleet-choice {
    grid-template-columns: 110px 1fr;
  }
  .connect-board-wrap {
    width: 100%;
    margin-inline: auto;
  }
  .connect-guide {
    margin-top: 0 !important;
  }
  .connect-guide .connect-example {
    display: none;
  }
  .connect-guide h2 {
    font-size: 26px;
  }
  .duel-start-art {
    opacity: 0.2;
    width: 50%;
  }
  .duel-lobby {
    max-width: none;
  }
  .duel-lobby--multi {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
  .duel-lobby--multi .duel-form + .duel-form {
    border-top: 1px solid #ffffff20;
    padding-top: 22px;
  }
}
@media (max-width: 450px) {
  .duel-players {
    gap: 8px;
  }
  .duel-player {
    padding: 12px 10px;
    gap: 8px;
  }
  .duel-player strong {
    font-size: 12px;
  }
  .duel-player small {
    font-size: 10px;
  }
  .duel-room-bar {
    font-size: 10px;
  }
  .duel-status {
    font-size: 13px;
  }
  .duel-start-copy h2 {
    font-size: 27px;
  }
  .duel-start-art {
    right: -20px;
    bottom: 20px;
    width: 60%;
  }
  .connect-board-wrap {
    padding: 0 3px 18px;
  }
  .connect-board {
    gap: 5px;
    padding: 10px;
    border-radius: 12px;
  }
  .connect-buttons {
    padding: 0 10px 6px;
    gap: 5px;
  }
  .connect-column span {
    font-size: 20px;
  }
  .connect-slot.disc-0 > span,
  .connect-slot.disc-1 > span {
    box-shadow: inset 0 0 0 2px #fff3;
  }
  .connect-slot.last-disc > span {
    outline-offset: -4px;
  }
  .abc-game .sea-panel {
    padding: 14px 10px;
  }
  .sea-heading {
    gap: 8px;
  }
  .sea-heading h2 {
    font-size: 23px;
  }
  .sea-heading .abc-eyebrow {
    font-size: 9px;
  }
  .fleet-summary {
    gap: 5px;
    margin-left: 16px;
  }
  .fleet-summary small {
    font-size: 8px;
  }
  .sea-map {
    --sea-label: 16px;
  }
  .sea-numbers,
  .sea-letters {
    font-size: 9px;
  }
  .sea-cell.is-hit::after {
    border-width: 1px;
    inset: 23%;
  }
  .fleet-silhouette {
    padding: 1px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .connect-slot.last-disc > span {
    animation: duel-drop 0.23s ease-out;
  }
  @keyframes duel-drop {
    from {
      transform: translateY(-30px);
      opacity: 0.3;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}
