/* Production web layout. Mobile keeps the established game UI; wider browsers
   use the same board and controls in a desktop workspace instead of stretching. */
html { overflow-x: clip; }
body { min-width: 0; overflow-x: clip; }
button, input, select, textarea { font: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible,
[tabindex]:focus-visible { outline: 3px solid #8fcaff; outline-offset: 3px; }

.launch-route-notice {
  position: relative;
  z-index: 2;
  max-width: 620px;
  margin: 18px auto 0;
  padding: 12px 14px;
  border: 1px solid #416b94;
  border-radius: 12px;
  background: #0b2039;
  color: #dbeeff;
  text-align: center;
  font-size: .9rem;
  line-height: 1.45;
}
.launch-route-notice.bad { border-color: #a8585d; background: #351b27; color: #ffd9db; }
.launch-route-notice.hidden { display: none; }

.friend-waiting-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.friend-waiting-actions button { min-height: 44px; flex: 1 1 170px; }

@media (min-width: 1024px) {
  .game { width: min(1380px, 100%); }
  .scorebar { width: 100%; max-width: none; margin-bottom: 14px; }
  .game-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(350px, 390px);
    gap: 16px;
    align-items: start;
  }
  .board-panel { width: 100%; margin: 0; padding: 14px; }
  .board-viewport {
    width: min(100%, 860px, calc(100dvh - 205px));
    min-width: 0;
  }
  .controls-panel {
    position: sticky;
    top: 12px;
    bottom: auto;
    width: 100%;
    margin: 0;
    padding: 18px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "owner" "rack" "summary" "actions" "message";
    gap: 12px;
    background: rgba(16, 36, 64, .97);
    box-shadow: 0 18px 48px rgba(0, 0, 0, .28);
  }
  .controls-panel .rack {
    max-width: none;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 7px;
  }
  .controls-panel .rack-tile { width: 100%; min-width: 0; }
  .controls-panel .action-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .controls-panel .mode-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 44px; }
  .launch-shell-card { width: min(1080px, 92vw); }
  #launchMenu .launch-menu-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .launch-route-notice { margin-top: 12px; font-size: .82rem; }
  .definition-modal-v2, .content-report-card, .match-result-card { max-width: 100%; }
}

@media (max-width: 360px) {
  .launch-shell-card { width: calc(100vw - 12px); }
  .launch-menu-button { min-width: 0; }
  .friend-waiting-actions { display: grid; grid-template-columns: 1fr; }
}
