/* Page-specific states; shared Rally layout lives in Shared/rally/rally.css. */
#setup-errors { margin: 16px 0 0; }
#copy-status { max-width: 260px; }
#app-container.study-shell { padding-top: 24px; padding-bottom: 32px; }
.setup-panel { max-width: 680px; margin: 0 auto; }
#host-view { grid-template-rows: minmax(0, 1fr) auto; padding-top: 1.75rem; }
.choice:has(input:disabled) { opacity: .5; cursor: default; }
#service-status { margin: 0; max-width: 32ch; text-align: right; }
#game-view[hidden] { display: none !important; }
.setup-panel .create-action .helper { font-size: .75rem; }

/* Match the Local header without importing the other teacher-tool layouts. */
.rally-page .teacher-header {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: center;
  gap: 12px;
  /* Header row centered ~51px from the top (44px on phones), like the rest of TNQ */
  margin-top: 4px;
  margin-bottom: 16px;
}
.rally-page .brand-mark {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}
.rally-page .brand-mark img { width: 40px; height: 40px; }
.rally-page .brand-mark h1 { margin: 0; font-size: 1.35rem; font-weight: 700; }
.rally-page .floating-btn, .rally-page .theme-toggle {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--color-text-primary);
  cursor: pointer;
}
.rally-page .floating-btn:hover { transform: translateY(-1px); opacity: .85; }
.rally-page .theme-toggle svg { width: 22px; height: 22px; }
.setup-panel .duration-notes { justify-content: flex-end; }
.setup-actions { align-items: flex-start; }
@media (max-width: 767px) {
  #app-container.study-shell { padding-top: 12px; }
  .rally-page .teacher-header { grid-template-columns: 44px minmax(0, 1fr) 44px; gap: 6px; margin-top: 10px; margin-bottom: 8px; }
  .rally-page .brand-mark { gap: 6px; }
  .rally-page .brand-mark img { width: 32px; height: 32px; }
  .rally-page .brand-mark h1 { font-size: 1rem; }
  .rally-page .floating-btn, .rally-page .theme-toggle { width: 44px; height: 44px; }
}
.player-name[data-edit-name] { cursor: text; }
.player-name[data-edit-name]:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 3px; border-radius: 3px; }
.rally-roster-name-input { box-sizing: border-box; width: 100%; min-width: 0; padding: 0; margin: 0; border: 0; border-bottom: 1px solid var(--color-primary); border-radius: 0; background: transparent; color: inherit; font: inherit; line-height: inherit; outline-offset: 3px; }
#start-live:disabled { opacity: .45; cursor: not-allowed; }
#start-live.is-starting { position: relative; opacity: 1; cursor: wait; }
#start-live.is-starting > span { visibility: hidden; }
#start-live.is-starting::after { content: ''; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: rally-start-spin .65s linear infinite; }
@keyframes rally-start-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { #start-live.is-starting::after { animation: none; } }
.rally-timer-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.rally-timer-grid label, #final-timer-field { display: flex; flex-direction: column; gap: 6px; font-size: .85rem; }
.rally-timer-grid input, #final-timer-field input { width: 100%; min-width: 0; padding: 9px; border-radius: var(--border-radius-button); background: var(--color-bg); color: var(--color-text-primary); border: 1px solid var(--color-border); }
#final-timer-field { margin-top: 12px; }
.rally-discussion-fields, .rally-timer-grid { margin-top: 12px; }
.rally-discussion-fields > label { display: block; font-size: .85rem; margin-bottom: 6px; }
#media-estimate:empty, #options-status:empty, #media-previews:empty { display: none; }
