/* Bedop's colony opening card. A stage card, not a modal: the pilot can still fly and fire during
   the last stand. The server owns the stage; this only draws it. */

.colony-card {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 44;
  width: min(390px, calc(100vw - 36px));
  background: linear-gradient(160deg, #10232a 0%, #071318 70%);
  border: 1px solid #2d5b61;
  box-shadow: 0 12px 40px #000b, inset 0 0 0 1px #ffffff08;
  color: #c9e7e5;
  padding: 12px 14px 14px;
  font-size: 14px;
}
.colony-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #52c7b4; }
.colony-head { display: flex; align-items: baseline; gap: 8px; }
.colony-head span { color: #6ed7c7; font-size: 12px; letter-spacing: .16em; }
.colony-head b { margin-left: 0; color: #7d9fa3; font-size: 12px; letter-spacing: .1em; font-weight: 400; }
.colony-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.colony-title { margin: 6px 0 3px; font-size: 17px; letter-spacing: .1em; color: #ecfffb; font-weight: 600; }
.colony-text { margin: 0 0 9px; color: #a7c5c6; line-height: 1.5; font-size: 14px; }
.colony-dots { display: flex; gap: 4px; margin: 2px 0 9px; }
.colony-dots i { display: block; height: 3px; flex: 1; background: #1d373c; }
.colony-dots i.on { background: #67e0ca; box-shadow: 0 0 8px #67e0ca88; }
.colony-dots i.done { background: #2c635c; }
.colony-progress { height: 3px; background: #122a2f; margin-bottom: 10px; }
.colony-progress i { display: block; height: 100%; background: linear-gradient(90deg, #2e9c8d, #9df7de); }
.colony-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.colony-btn { border: 1px solid #3b8078; background: #123b36; color: #d8fff5; padding: 7px 11px; font: inherit; font-size: 12px; letter-spacing: .1em; cursor: pointer; }
.colony-btn:hover { border-color: #74e4ca; background: #184940; }
.colony-btn.quiet { border-color: #304d54; background: #0b1b20; color: #8fb0b4; }
/* The guided opening: the one real control the next beat waits for blinks. The inset ring stays inside
   the scrolling card, so a phone's overflow does not clip the cue. */
.colony-btn.guide {
  border-color: #ffe08a;
  color: #fff7d6;
  box-shadow: inset 0 0 0 2px #ffe08a, 0 0 16px rgba(255, 180, 84, 0.5);
  animation: colonyGuide 0.9s step-end infinite;
}
@keyframes colonyGuide {
  0%, 49.9% {
    border-color: #ffe08a;
    color: #fff7d6;
    box-shadow: inset 0 0 0 2px #ffe08a, 0 0 16px rgba(255, 180, 84, 0.5);
  }
  50%, 100% {
    border-color: rgba(255, 180, 84, 0.18);
    color: #d8fff5;
    box-shadow: inset 0 0 0 2px rgba(255, 180, 84, 0.12), 0 0 0 rgba(255, 180, 84, 0);
  }
}
@media (prefers-reduced-motion: reduce) {
  .colony-btn.guide { animation: none; box-shadow: inset 0 0 0 2px #ffe08a; }
}
.colony-count { margin-left: auto; color: #ffb99d; font-size: 12px; letter-spacing: .08em; }
.colony-card[hidden] { display: none; }

@media (max-width: 760px) {
  .colony-card {
    left: 10px;
    right: 10px;
    bottom: 10px;
    width: auto;
    padding: 10px 12px 12px;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
  }
  /* D235: the phone dock owns the bottom 56 px + safe area. A stage card sits above it, never under
     it, so the NEXT line and the action buttons stay reachable on a phone. */
  body.phoneUi .colony-card {
    bottom: calc(var(--dock, 56px) + 10px);
    max-height: calc(100vh - var(--dock, 56px) - 20px);
  }
  .colony-text { font-size: 13px; }
  .colony-title { font-size: 15px; }
  body.phoneUi .colony-btn { min-height: 44px; }
}
.colony-next { margin-top: 8px; display: flex; gap: 8px; align-items: baseline; font-size: 12px; line-height: 1.4; color: #a9e6ff; border-top: 1px solid #1e3b44; padding-top: 7px; }
.colony-next b { color: #ffcf7a; letter-spacing: .12em; font-size: 12px; }
