.live-table { margin: 8px 0; color: #17394b; }
.live-table h2 { margin-bottom: 4px; }
.live-table p { margin: 4px 0 8px; }
.live-table-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; margin-top: 8px; }
.live-table-seat { margin: 0; min-width: 0; padding: 3px; border: 2px solid #819eaa; border-radius: 6px; background: #153b50; color: white; }
.live-table-seat.at-helm { border-color: #d9a83c; }
.live-table-seat video { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px; }
.live-table-seat figcaption { padding: 4px; font-size: .8rem; }
.live-table input { margin-top: 8px; }
@media (max-width:950px) {
 .live-table-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
 .live-table-seat:only-child { max-width: 220px; }
}
.watch-board { position: relative; width: min(100%, 620px); margin: 0 auto; }
.watch-board > img { display: block; width: 100%; transform: rotate(180deg); }
.watch-pieces { position: absolute; inset: 0; pointer-events: none; }
.watch-pieces img { position: absolute; width: clamp(28px, 7%, 52px); transform: translate(-50%, -65%); filter: drop-shadow(0 1px 2px #000); }
.watch-pieces img.at-helm { filter: drop-shadow(0 0 4px #ffd451) drop-shadow(0 0 4px #ffd451); }

@media (max-width:950px) {
 #play-layout:has(> #live-table-host:not([hidden])) > .board-panel { grid-row: 1; }
 #play-layout > #live-table-host:not([hidden]) { grid-row: 2; }
 #play-layout:has(> #live-table-host:not([hidden])) > #helm { grid-row: 3; }
 #play-layout > #live-table-host > .live-table { margin: 0; padding: 10px; }
 #play-layout:has(> #live-table-host:not([hidden])) #phone-board-controls.waiting-for-captain
  > :is(#phone-dice-area, .phone-actions, #phone-roll-summary) { display: none; }
}

.live-table-playing .live-table-seat,
.live-table-left-rail .live-table-seat {
 border-inline-start: 5px solid var(--seat-boat-color, #819eaa);
}
.live-table-playing .live-table-seat.at-helm,
.live-table-left-rail .live-table-seat.at-helm {
 outline: 2px solid #d9a83c;
 outline-offset: -2px;
}
.live-table-playing .live-table-seat button {
 background: transparent;
 border: 0;
 color: inherit;
 padding: 3px;
 text-align: start;
}

@media (min-width:1280px) {
 body.circular-board #play-layout:has(> .live-table-left-rail:not([hidden])) {
  --camera-column: clamp(185px, calc(22vw - 96px), 325px);
  grid-template-columns: var(--camera-column) minmax(0, 1fr) calc(var(--camera-column) + 16px) minmax(290px, 25%);
 }
 #play-layout > :is(.live-table-left-rail, #live-table-host) {
  position: sticky;
  top: 12px;
  max-height: calc(100dvh - 24px);
  overflow: auto;
 }
 #play-layout > .live-table-left-rail { grid-area: 1 / 1; display: grid; gap: 6px; }
 #play-layout:has(> .live-table-left-rail:not([hidden])) > .board-panel { grid-area: 1 / 2; }
 #play-layout:has(> .live-table-left-rail:not([hidden])) > #live-table-host { grid-area: 1 / 3; }
 #play-layout:has(> .live-table-left-rail:not([hidden])) > #helm { grid-area: 1 / 4; }
 .live-table-playing { padding: 8px; }
 .live-table-playing .live-table-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width:950px) {
 .live-table-playing .live-table-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
 .live-table-phone-camera:empty { display: none; }
 .live-table-phone-camera video {
  display: block;
  width: min(100%, 260px);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  margin-top: 6px;
  border-radius: 6px;
 }
}

.live-table-playing .live-table-controls {
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 gap: 4px;
 align-items: stretch;
}
.live-table-playing .live-table-controls > button {
 min-height: 44px;
 padding: 4px 3px;
 font-size: .8rem;
 line-height: 1.15;
}
.live-table-playing .live-table-controls > button:first-child {
 grid-column: 1 / -1;
}

.compact-live-turn #turn-pending { font-weight: 700; }
.compact-live-turn.compact-routine-action #turn-pending { display: none; }
.compact-live-turn.compact-routine-action #turn-action { font-weight: 750; }
#fleet-feed details > summary {
 overflow: hidden;
 text-overflow: ellipsis;
 white-space: nowrap;
}
#fleet-feed details[open] > summary:not([hidden]) { margin-bottom: 5px; }
@media (max-width:950px) {
 #phone-board-controls.compact-routine-action #phone-next-action-strip { display: none; }
 #phone-board-controls.compact-routine-action #phone-turn-action { font-weight: 750; }
}

.live-table-seat .live-table-video-preview {
 display: block;
 width: 100%;
 min-height: 0;
 padding: 0;
 border: 0;
 border-radius: 3px;
 background: transparent;
 cursor: zoom-in;
}
.live-table-enlarged {
 width: min(92vw, 800px);
 padding: 14px;
 border: 2px solid #d9a83c;
 border-radius: 12px;
 background: #fff7e4;
 color: #17394b;
}
.live-table-enlarged::backdrop { background: #102f42b3; }
.live-table-enlarged h2 { display: inline-block; margin: 0 12px 8px 0; }
.live-table-enlarged video {
 display: block;
 width: 100%;
 max-height: 72dvh;
 aspect-ratio: 16 / 9;
 object-fit: contain;
 margin-top: 8px;
 background: #102f42;
}
