.coin-flip-screen  { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 40px; }
.coin-flip-center  { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.coin-flip-coin    {
  position: relative; width: 140px; height: 140px;
  transform-style: preserve-3d;
  perspective: 600px;
}
.coin-face         {
  position: absolute; inset: 0;
  width: 140px; height: 140px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 3.2rem; font-weight: 700;
  backface-visibility: hidden;
  box-shadow: 0 6px 28px rgba(0,0,0,0.45), inset 0 0 0 3px rgba(0,0,0,0.1);
}
.coin-face-head    { background: var(--accent-gold); color: #1a1a1a; }
.coin-face-tail    { background: #c0c0c0; color: #1a1a1a; transform: rotateY(180deg); }
.coin-result-win   { animation: coin-flip-win 1.2s ease-out forwards; }
.coin-result-lose  { animation: coin-flip-lose 1.2s ease-out forwards; }
@keyframes coin-flip-win {
  0%   { transform: rotateY(0)       scale(0.4); }
  60%  { transform: rotateY(1440deg) scale(1.15); }
  100% { transform: rotateY(1440deg) scale(1); }
}
@keyframes coin-flip-lose {
  0%   { transform: rotateY(0)       scale(0.4); }
  60%  { transform: rotateY(1620deg) scale(1.15); }
  100% { transform: rotateY(1620deg) scale(1); }
}
.coin-flip-title   { margin: 0; font-size: 1.5rem; }
.coin-flip-sub     { margin: 0; color: var(--text-muted); font-size: 0.95rem; max-width: 420px; }
@media (prefers-reduced-motion: reduce) {
  .coin-flip-coin, .coin-result-win, .coin-result-lose { animation: none !important; transform: none !important; }
}

.map-select-waiting { min-height: 100vh; display: flex; align-items: center; justify-content: center; }

/* Shared waiting card: map-select waiter + recruit/deploy submitted states. */
.battlefield-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 70vh;
  padding: 24px 16px;
  width: 100%;
}
/* Recruit/deploy submitted states pull the card up close to the readiness-bar
   — the 70vh + center align were sized for the map-select waiter alone. */
.online-recruit .battlefield-center,
.online-deploy .battlefield-center {
  min-height: 0;
  align-items: flex-start;
  padding: 16px 16px 24px;
}
.battlefield-waiting-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 32px 40px;
  max-width: 460px;
  width: 100%;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.30);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}
.battlefield-waiting-card h2 {
  margin: 4px 0 0;
  color: var(--text-primary);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.battlefield-waiting-sub {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.5;
}
.battlefield-waiting-small {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
  letter-spacing: 0.02em;
}
.battlefield-waiting-note {
  margin: 8px 0 0;
  padding: 6px 14px;
  display: inline-block;
  background: color-mix(in srgb, var(--accent-gold) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent-gold) 35%, transparent);
  border-radius: 999px;
  color: var(--accent-gold);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.battlefield-waiting-actions {
  margin-top: 14px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

.battlefield-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--bg-hover);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: battlefield-spin 0.9s linear infinite;
  flex-shrink: 0;
}
@keyframes battlefield-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .battlefield-spinner { animation: none; }
}

@media (max-width: 600px) {
  .battlefield-waiting-card { padding: 24px 22px; }
  .battlefield-waiting-card h2 { font-size: 1.15rem; }
  .battlefield-center { min-height: 60vh; padding: 16px 10px; }
}

.setup-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  list-style: none;
  margin: 0 auto 18px;
  padding: 8px 12px;
  max-width: 520px;
}
.setup-step {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.setup-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1.5px solid var(--border-color);
  background: var(--bg-card);
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}
.setup-step.is-current {
  color: var(--accent-gold);
  font-weight: 700;
}
.setup-step.is-current .setup-step-num {
  border-color: var(--accent-gold);
  background: color-mix(in srgb, var(--accent-gold) 18%, transparent);
  color: var(--accent-gold);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-gold) 12%, transparent);
}
.setup-step.is-done {
  color: var(--text-secondary);
}
.setup-step.is-done .setup-step-num {
  border-color: var(--accent-green);
  background: rgba(46, 139, 87, 0.18);
  color: var(--accent-green);
}
.setup-step-connector {
  flex: 0 0 36px;
  height: 1.5px;
  background: var(--border-color);
  border-radius: 1px;
}
.setup-step-connector.is-done { background: var(--accent-green); opacity: 0.65; }
@media (max-width: 600px) {
  .setup-stepper { gap: 4px; padding: 6px 8px; max-width: 100%; }
  .setup-step-label { display: none; }
  .setup-step-connector { flex-basis: 18px; }
}

.online-recruit          { display: flex; flex-direction: column; gap: 0; }

.readiness-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.88rem;
}
/* Submitted: bar sits alone above the centred "Waiting…" card — cap width
   so they read as a single visual cluster. */
.readiness-bar.is-submitted {
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}
.readiness-opp-indicator {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto;
  min-width: 0;
}
.readiness-opp-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}
.readiness-opp-dot.is-ready {
  background: #6fcf8a;
  box-shadow: 0 0 8px color-mix(in srgb, #6fcf8a 60%, transparent);
}
.readiness-opp-dot.is-waiting {
  background: var(--accent-gold);
  animation: readiness-opp-pulse 1.6s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .readiness-opp-dot.is-waiting { animation: none; }
}
@keyframes readiness-opp-pulse {
  0%, 100% { opacity: 0.55; }
  50%      { opacity: 1; }
}
.readiness-opp-name {
  color: var(--text-secondary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 12em;
}
.readiness-opp-status {
  color: var(--text-muted);
  font-size: 0.78rem;
}
@media (max-width: 480px) {
  .readiness-opp-status { display: none; }
}
.readiness-tag           {
  display: inline-block;
  padding: 3px 10px; border-radius: 10px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.02em;
}
/* Matches mobile-points-sticky exactly: bg-card surface + gold border +
   gold text. Single visual language for "live progress". */
.readiness-tag.progress  {
  background: var(--bg-card);
  color: var(--accent-gold);
  border: 1px solid var(--accent-gold);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
}
.readiness-tag.waiting { background: #3a3000; color: var(--accent-gold); }
.readiness-tag.ready   { background: #1a4a2e; color: #6fcf8a; }

.readiness-tag.progress .readiness-points,
.readiness-tag.progress .readiness-points.is-full {
  color: var(--accent-gold);
  font-weight: 700;
  font-size: 1rem;
  margin-right: 2px;
}

/* Legacy wrapper — pre-2026-05-04 the pill rendered as label + time pair;
   now single time-only span with label in `title` tooltip. Kept for
   backwards-compat in case any older snapshot path still emits the wrapper. */
.readiness-phase-timer {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}
.phase-countdown-row {
  display: flex;
  justify-content: center;
  margin: 0;
}
.phase-countdown-row .ready-phase-timer { margin-left: 0; }
.setup-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}
.setup-header-row > .setup-stepper { margin: 0; }
/* Body class toggled by IntersectionObserver in screen-helpers.js's
   watchProgressPillVisibility() so the floating mobile-points-sticky
   badge hides when the in-bar progress pill is on screen. */
@media (max-width: 640px) {
  body.progress-pill-visible .mobile-points-sticky { display: none; }
}
.ready-phase-label {
  color: var(--text-muted); font-size: 0.72rem; letter-spacing: 0.04em; text-transform: uppercase;
}
/* Label ("Phase ends in") is on `title` tooltip; visible chip is just the
   numeric countdown. cursor: help signals hover affordance. */
.ready-phase-timer {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--accent-gold);
  border: 1px solid color-mix(in srgb, var(--accent-gold) 55%, var(--border-color));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent-gold) 18%, transparent),
              0 2px 8px rgba(0, 0, 0, 0.25);
  letter-spacing: 0.03em;
  min-width: 3.6em; text-align: center; line-height: 1.2;
  display: inline-block;
  cursor: help;
}
.ready-phase-timer.tb-timer-warning  {
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-gold) 35%, transparent);
}
.ready-phase-timer.tb-timer-critical {
  color: #fff;
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-red) 35%, transparent);
  animation: tb-critical-pulse 0.9s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .ready-phase-timer.tb-timer-critical { animation: none; } }

.online-recruit-hint-row {
  display: flex; align-items: center; justify-content: center;
  padding: 10px 20px;
  background: var(--bg-card); border-top: 1px solid var(--bg-hover);
  border-radius: 6px 6px 0 0;
  margin-top: 12px;
  margin-bottom: 1.2em;
}
/* Shared by recruit + deploy. */
.online-recruit-footer {
  display: flex; align-items: center; justify-content: center;
  gap: 12px; padding: 12px 20px;
  margin-top: 8px;
  background: transparent;
}
.online-recruit-footer > .btn { min-width: 9em; }
.online-recruit-hint     { color: var(--text-muted); font-size: 0.85rem; text-align: center; }

/* Reused on both .online-recruit and .online-deploy — identical top strip. */
.online-recruit-top-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  /* Span full width. Without this, .screen{align-items:center} centers
     the row on the page; we want it pinned to the left edge. */
  width: 100%;
}
.online-recruit-top-col {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.online-recruit-top-row .ai-mode-panel,
.online-recruit-top-row .ai-mode-panel-mount { flex: 0 0 auto; }
.online-recruit-top-col .readiness-bar { border-bottom: none; }

.recruit-map-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  flex: 0 0 auto;
}
.recruit-map-chip-grid {
  width: 48px; height: 48px;
  flex: 0 0 auto;
  aspect-ratio: 1;
  border-radius: 4px;
  overflow: hidden;
}
.recruit-map-chip-label {
  display: flex;
  flex-direction: column;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--text-primary);
  min-width: 0;
}
.recruit-map-chip-eyebrow {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
@media (max-width: 480px) {
  .recruit-map-chip { display: none; }
}


.online-abandon-btn   {
  background: var(--accent-red, #c06060);
  color: #ffffff;
  border: 1px solid var(--accent-red, #c06060);
  font-weight: 700;
}
.online-abandon-btn:hover {
  background: #d77272;
  border-color: #d77272;
  color: #ffffff;
}
.online-abandon-btn:active {
  background: #a85050;
  border-color: #a85050;
}

.online-deploy { display: flex; flex-direction: column; }

.online-reveal-screen    { display: flex; flex-direction: column; align-items: center; padding: 20px; gap: 14px; min-height: 100vh; }
.online-reveal-header    { text-align: center; max-width: 720px; }
.online-reveal-header h2 { margin: 0 0 6px; }
.online-reveal-header p  { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.online-reveal-board     { display: flex; justify-content: center; }
.online-reveal-footer    { display: flex; gap: 10px; justify-content: center; margin-top: 10px; }
