.game-screen { max-width: 1600px; padding: 10px; gap: 0; }
.game-main { display: flex; gap: 18px; width: 100%; align-items: stretch; justify-content: center; }
.board-area { display: flex; flex-direction: column; flex-shrink: 0; max-height: 85vh; }

.turn-banner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 14px; font-size: 0.8rem; font-weight: 600;
  /* margin-left lives on parent .play-board-header — see layout.css. */
  border-radius: 6px 6px 0 0;
  letter-spacing: 0.02em;
  min-height: 36px; box-sizing: border-box;
}
.turn-banner-offline { display: none; }
.turn-banner-your-turn       { background: var(--accent-green); color: #0f2010; }
.turn-banner-opponent-turn   { background: var(--bg-card); color: var(--text-muted); }
.turn-banner-you-respond     { background: var(--accent-red); color: #fff; }
.turn-banner-opponent-responds { background: #7a5c00; color: #ffe680; }
.tb-label    { font-weight: 700; }
.tb-sublabel { font-size: 0.72rem; opacity: 0.85; font-weight: 400; }
/* Pills reserve full size via min-width + line-height so empty→filled doesn't change banner height. */
.tb-timers       { display: inline-flex; align-items: center; gap: 6px; margin-left: 10px; font-variant-numeric: tabular-nums; }
.tb-turn-timer,
.tb-resp-timer   {
  font-family: var(--font-mono, monospace); font-weight: 700; font-size: 0.85rem;
  padding: 2px 8px; border-radius: 10px; background: rgba(0,0,0,0.22);
  letter-spacing: 0.02em;
  min-width: 42px; text-align: center;
  line-height: 1.2;
  display: inline-block;
}
.tb-resp-timer   { background: rgba(255,255,255,0.18); }
.gameover-forfeit-note {
  margin: 4px 0 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
}

/* position:fixed so overlay survives #app innerHTML rebuilds. */
#reconnect-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.78);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(2px);
}
.reconnect-card {
  background: var(--bg-card);
  border: 2px solid var(--accent-gold);
  border-radius: 12px;
  padding: 32px 40px;
  text-align: center;
  min-width: 320px;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.reconnect-spinner {
  width: 48px; height: 48px;
  border: 4px solid color-mix(in srgb, var(--accent-gold) 25%, transparent);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: battlefield-spin 0.9s linear infinite;
  margin: 0 auto 16px;
}
.reconnect-title    { color: var(--accent-gold); margin-bottom: 8px; font-size: 1.15rem; }
.reconnect-sub      { color: var(--text-secondary); font-size: 0.88rem; margin-bottom: 12px; line-height: 1.45; }
.reconnect-attempt  { color: var(--text-muted); font-size: 0.78rem; margin-bottom: 18px; font-family: var(--font-mono, monospace); }
@media (prefers-reduced-motion: reduce) {
  .reconnect-spinner { animation: none; border-top-color: var(--accent-gold); }
}
.tb-opp-dc {
  font-family: var(--font-mono, monospace); font-weight: 700; font-size: 0.85rem;
  padding: 2px 10px; border-radius: 10px; background: rgba(122, 92, 0, 0.55);
  color: var(--accent-gold); letter-spacing: 0.02em;
  min-width: 70px; text-align: center; line-height: 1.2; display: inline-block;
}
.tb-timer-paused   { opacity: 0.5; text-decoration: line-through; }
.tb-timer-warning  { color: var(--accent-gold); background: rgba(0,0,0,0.35); }
.tb-timer-critical { color: #fff; background: var(--accent-red); animation: tb-critical-pulse 0.9s ease-in-out infinite; }
.tb-ai-opp {
  font-weight: 700; font-size: 0.72rem;
  padding: 2px 8px; border-radius: 10px;
  background: rgba(154, 166, 255, 0.15);
  color: #cfd4ff;
  text-transform: uppercase; letter-spacing: 0.04em;
  line-height: 1.2; display: inline-flex; align-items: center; gap: 4px;
}
@keyframes tb-critical-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.65; } }
@media (prefers-reduced-motion: reduce) { .tb-timer-critical { animation: none; } }
/* Drops top radius when banner is above; handles both direct-sibling + wrapped-header shapes. */
.turn-banner:not(.turn-banner-offline) + .player-bar,
.play-board-header + .player-bar { border-radius: 0; }

.player-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 14px; background: var(--bg-card); font-size: 0.95rem;
  margin-left: var(--board-label-width, 16px);
  border-radius: 6px 6px 0 0;
}
/* No .player-bar prefix so .group-status-bar inherits the same accent. */
.active.p1-bar,
.active.p2-bar { border-left: 3px solid; }
.active.p1-bar { border-left-color: var(--p1-color); }
.active.p2-bar { border-left-color: var(--p2-color); }

.pb-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.pb-dot-p1 { background: var(--p1-color); }
.pb-dot-p2 { background: var(--p2-color); }
.pb-name { font-weight: 600; color: var(--text-primary); }
.pb-left { display: flex; align-items: center; gap: 10px; }
.pb-right { margin-left: auto; font-size: 0.78rem; text-align: right; }
.pb-table { border-collapse: collapse; font-size: 0.82rem; }
.pb-table td { padding: 1px 3px; vertical-align: middle; white-space: nowrap; }
.pb-moves-cell { padding-right: 8px; }
.pb-player-cell { font-weight: 600; }
.pb-badges-cell { white-space: nowrap; min-width: 90px; }
.pb-row-current td { color: var(--text-primary); }
.pb-row-current .pb-val { color: var(--text-primary); font-weight: 700; }
.pb-row-enemy td { color: var(--text-muted); }
.pb-row-enemy .pb-val { color: var(--text-muted); font-weight: 600; }
.pb-row-enemy .pool-badge { opacity: 0.5; }
.mp-icon {
  display: inline-flex; align-items: center;
  vertical-align: middle;
  margin-right: 0.3em;
  line-height: 1;
}
.mp-icon .unit-pip { width: 1em; height: 1em; border-width: 1px; flex-shrink: 0; }
.mp-icon .unit-emoji { display: none; }
.pb-val { display: inline-flex; align-items: center; }
html[data-board-style="classic"] .mp-icon .unit-emoji { display: inline; font-size: 0.9em; }

.game-buttons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  padding-top: 4px;
}
.game-buttons .btn { flex: 1 1 0; justify-content: center; min-width: 0; }
.game-buttons .btn-draw { color: var(--text-muted); border-color: var(--border-color); }
.game-buttons .btn-draw:hover { color: var(--accent-gold); border-color: var(--accent-gold); }
.pb-turn { font-size: 0.72rem; color: var(--text-primary); background: var(--bg-card); padding: 2px 8px; border-radius: 4px; font-weight: 500; }
.pb-moves { color: #fff; font-weight: 700; font-size: 0.82rem; background: var(--accent-green); padding: 2px 10px; border-radius: 4px; margin-right: 6px; }
.pb-div { opacity: 0.3; margin: 0 3px; font-size: 0.7rem; }

.game-panel { width: 260px; flex-shrink: 0; display: flex; flex-direction: column; gap: 8px; max-height: 85vh; overflow-y: auto; transition: width 0.18s ease; }
.left-col-wrap { display: flex; flex-direction: column; transition: width 0.18s ease; }
.left-col-wrap > .settings-row { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; padding: 6px 10px; margin-bottom: 0px; grid-template-columns: 1fr 1fr; }
.left-panel { padding-top: 8px; flex: 1; min-height: 0; }
.right-panel { width: 360px; display: flex; flex-direction: column; overflow: hidden; max-height: 85vh; transition: width 0.18s ease; }

.play-panel-toggle {
  width: 28px; height: 28px;
  padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1;
  flex: 0 0 auto;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.play-panel-toggle:hover {
  background: var(--bg-hover);
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}
.play-panel-toggle-left  { align-self: flex-end; }
.play-panel-toggle-right { align-self: flex-start; }

.left-col-wrap.is-collapsed .left-panel { width: 32px; padding: 6px 2px 0; overflow: hidden; }
.left-col-wrap.is-collapsed .left-panel > *:not(.play-panel-toggle) { display: none; }

.right-panel.is-collapsed { width: 32px; padding: 6px 2px 0; overflow: hidden; }
.right-panel.is-collapsed > *:not(.play-panel-toggle) { display: none; }

@media (max-width: 1100px) {
  .play-panel-toggle { display: none; }
  .left-col-wrap.is-collapsed .left-panel,
  .right-panel.is-collapsed { width: auto; padding: 8px; overflow: visible; }
  .left-col-wrap.is-collapsed .left-panel > *:not(.play-panel-toggle),
  .right-panel.is-collapsed > *:not(.play-panel-toggle) { display: revert; }
}

.actions-card { background: var(--bg-card); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 4px; flex-shrink: 1; min-height: 0; overflow-y: auto; }
.a-bonus { font-size: 0.65rem; font-weight: 700; color: var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 15%, transparent); padding: 1px 5px; border-radius: 8px; margin-left: 4px; }
.pool-badge { font-size: 0.6rem; font-weight: 700; padding: 1px 5px; border-radius: 8px; margin-left: 3px; vertical-align: middle; }
.pool-avail { color: var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 18%, transparent); border: 1px solid color-mix(in srgb, var(--accent-gold) 30%, transparent); }
.pool-spent { color: var(--text-muted); background: rgba(128,128,128,0.10); border: 1px solid rgba(128,128,128,0.2); opacity: 0.5; }
.btn-action .a-icon { font-size: 1rem; width: 20px; text-align: center; }
.btn-action .a-cost { margin-left: auto; font-size: 0.72rem; color: var(--text-muted); }

.action-group { margin-bottom: 4px; }
.action-group-hdr {
  width: 100%; text-align: left; padding: 6px 10px; font-size: 0.78rem; font-weight: 600;
  background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 6px; cursor: pointer; color: var(--text-secondary);
  display: flex; justify-content: space-between; align-items: center;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.action-group-hdr:hover { background: var(--bg-hover); color: var(--text-primary); }
.action-group-body { padding: 3px 0 0 0; display: flex; flex-direction: column; gap: 3px; }
.ag-arrow { font-size: 0.65rem; opacity: 0.6; }
.ap-item { padding: 5px 4px; font-size: 0.8rem; border-bottom: 1px solid var(--border-color); line-height: 1.5; }
.ap-item:last-child { border-bottom: none; }
.ap-label { font-weight: 700; color: var(--text-primary); margin-right: 4px; }
.ap-desc { color: var(--text-muted); }
.ui-spec-badge {
  font-size: 0.7rem; font-weight: 700; color: var(--accent-gold);
  background: color-mix(in srgb, var(--accent-gold) 15%, transparent); border: 1px solid color-mix(in srgb, var(--accent-gold) 25%, transparent);
  border-radius: 8px; padding: 1px 7px; margin-left: 6px; vertical-align: middle;
}
.target-hint { padding: 8px; text-align: center; font-size: 0.8rem; color: var(--accent-green); background: var(--bg-card); border-radius: var(--border-radius); }

.log-card { background: var(--bg-card); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; flex: 1; overflow: hidden; min-height: 250px; }
.log-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; flex-shrink: 0; }
.log-header h4 { margin: 0; }
.log-scroll { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; flex: 1; min-height: 0; font-size: 0.85rem; background: var(--bg-input); border-radius: var(--border-radius); padding: 8px; }
.log-entry { padding: 3px 8px; background: var(--bg-card); border-radius: 3px; border-left: 3px solid transparent; }
.log-p0 { border-left-color: var(--p1-color); }
.log-p1 { border-left-color: var(--p2-color); }

.copy-toast { position: absolute; top: 100%; right: 0; margin-top: 4px; background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border); padding: 4px 12px; border-radius: 4px; font-size: 0.75rem; white-space: nowrap; opacity: 0; transition: opacity 0.3s; pointer-events: none; z-index: 9999; }
.copy-toast.show { opacity: 1; }

.coin-toast-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding-bottom: 10vh; background: rgba(0,0,0,0.5); z-index: 10000; opacity: 0; transition: opacity 0.3s; }
.coin-toast-overlay.show { opacity: 1; }

.notification-toast {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translate(-50%, -120%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid color-mix(in srgb, var(--accent-green) 65%, var(--border-color));
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 10001;
  pointer-events: none;
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.2s ease;
  max-width: calc(100vw - 32px);
}
.notification-toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.notification-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent-green);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  flex: 0 0 auto;
}
.notification-toast-msg {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (prefers-reduced-motion: reduce) {
  .notification-toast { transition: opacity 0.2s ease; transform: translate(-50%, 0); }
}
.coin-toast-card { background: var(--bg-card); border: 2px solid var(--accent-green); border-radius: 12px; padding: 28px 48px; text-align: center; }
.coin-toast-icon { font-size: 2.5rem; margin-bottom: 8px; }
.coin-toast-msg { font-size: 1.3rem; color: var(--text-primary); font-weight: 600; }

/* position:fixed (not absolute) so overlay isn't clipped by .app-content's
   overflow-x:hidden. z-index 1100 beats sidebar (50), mobile-nav (500),
   user-menu (1000); sits below focus-exit chip (1200) and coin-toast (10000). */
.popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.55); display: flex; align-items: center; justify-content: center; z-index: 1100; }
.popup-card { background: var(--bg-card); border: 2px solid var(--accent-gold); border-radius: 10px; padding: 18px 24px; min-width: 340px; max-width: 420px; text-align: center; box-shadow: 0 8px 32px rgba(0,0,0,0.4); position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.popup-drag-handle { font-size: 0.7rem; color: var(--text-muted); cursor: move; text-align: left; margin-bottom: 8px; user-select: none; padding: 2px 0; letter-spacing: 0.08em; opacity: 0.6; }
.popup-drag-handle:hover { opacity: 1; color: var(--accent-gold); }
.popup-card h3 { color: var(--accent-gold); margin-bottom: 10px; font-size: 1.1rem; }
.popup-card p { font-size: 0.88rem; color: var(--text-secondary); margin-bottom: 6px; }
.defend-table { width: 100%; border-collapse: collapse; background: rgba(0,0,0,0.2); border-radius: 6px; margin: 8px 0; font-size: 0.85rem; }
.defend-table td { padding: 5px 10px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.defend-table tr:last-child td { border-bottom: none; }
.defend-table td:first-child { color: var(--text-secondary); text-align: left; }
.defend-table td:nth-child(2) { text-align: right; color: var(--text-primary); }
.popup-buttons { display: flex; gap: 8px; margin-top: 14px; justify-content: center; flex-wrap: wrap; }
.chase-coords { font-size: 0.7rem; opacity: 0.75; background: rgba(0,0,0,0.3); border-radius: 3px; padding: 1px 4px; font-family: monospace; }

.popup-waiting {
  position: absolute;
  top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  background: rgba(26, 24, 22, 0.92);
  border: 1px solid var(--accent-gold);
  border-radius: 10px;
  padding: 10px 16px;
  z-index: 50;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  min-width: 280px;
  max-width: calc(100% - 32px);
}
.popup-waiting-spinner {
  width: 22px; height: 22px;
  border: 2px solid color-mix(in srgb, var(--accent-gold) 25%, transparent);
  border-top-color: var(--accent-gold);
  border-radius: 50%;
  animation: battlefield-spin 0.9s linear infinite;
  flex-shrink: 0;
}
.popup-waiting-text { text-align: left; font-size: 0.85rem; color: var(--text-primary); line-height: 1.35; }
.popup-waiting-text strong { color: var(--accent-gold); }
.popup-waiting-sub { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }
@media (prefers-reduced-motion: reduce) {
  .popup-waiting-spinner { animation: none; border-top-color: var(--accent-gold); }
}

.acpop-root { position: absolute; pointer-events: none; z-index: 80; width: 0; height: 0; }
.acpop-btn {
  position: absolute; transform: translate(-50%, -50%); width: 46px; height: 46px;
  border-radius: 50%; background: rgba(26, 24, 22, 0.93); border: 2px solid color-mix(in srgb, var(--accent-gold) 55%, transparent);
  color: var(--text-primary); cursor: pointer; pointer-events: auto;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; transition: background 0.12s, border-color 0.12s, transform 0.1s; font-family: var(--font);
}
.acpop-btn:hover { background: var(--bg-hover); border-color: var(--accent-gold); transform: translate(-50%, -50%) scale(1.15); z-index: 2; }
.acpop-btn.acpop-active { background: var(--accent-gold); border-color: var(--accent-gold); color: #1a1816; }
.acpop-btn.acpop-active:hover { transform: translate(-50%, -50%) scale(1.12); }
.acpop-icon { font-size: 1.1rem; line-height: 1; }
.acpop-lbl { font-size: 0.44rem; letter-spacing: 0.02em; opacity: 0.8; text-transform: uppercase; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-card { background: var(--bg-card); border-radius: 12px; padding: 24px 28px; min-width: 320px; max-width: 380px; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,0.5); }
.modal-card h3 { color: var(--text-primary); margin-bottom: 8px; font-size: 1.15rem; }
.modal-card p { color: var(--text-secondary); font-size: 0.9rem; margin-bottom: 16px; }
.modal-buttons { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

.modal-prompt .modal-prompt-icon {
  display: inline-block;
  margin-right: 4px;
  font-size: 1.05em;
  vertical-align: baseline;
}
.modal-input-wrap {
  margin: 0 0 16px;
}
.modal-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg-input, var(--bg-card));
  border: 1px solid var(--border-color, rgba(255,255,255,0.12));
  border-radius: 8px;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  outline: none;
}
.modal-input::placeholder { color: var(--text-muted); opacity: 0.7; }
.modal-input:focus {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-gold) 25%, transparent);
}
.modal-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.modal-prompt-error {
  margin: -8px 0 14px;
  padding: 8px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-red);
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.35);
  border-radius: 6px;
  text-align: left;
  line-height: 1.35;
}
.modal-buttons .btn.is-busy {
  opacity: 0.7;
  cursor: progress;
}

.stats-card { background: var(--bg-card); border-radius: 8px; padding: 20px; min-width: 340px; }
.stats-table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.stats-table th, .stats-table td { padding: 6px 12px; text-align: center; border-bottom: 1px solid var(--bg-card); font-size: 0.85rem; }
.stats-table th { color: var(--accent-green); font-weight: 600; }
.stats-table td { color: var(--text-secondary); }
.stats-table td:first-child { text-align: left; color: var(--text-muted); }
.stats-table .stat-loss { color: var(--accent-red); font-weight: 600; }

.ai-confirm-prompt {
  display: flex; align-items: center; gap: 6px; margin-left: 8px;
  padding: 3px 8px; background: color-mix(in srgb, var(--accent-gold) 10%, transparent); border: 1px solid color-mix(in srgb, var(--accent-gold) 30%, transparent);
  border-radius: 6px; animation: fadeIn 0.15s ease;
}
.ai-confirm-text { font-size: 0.78rem; color: var(--accent-gold); font-weight: 600; white-space: nowrap; }
.ai-confirm-yes { padding: 2px 10px !important; font-size: 0.72rem !important; min-width: 0 !important; }
.ai-confirm-no { padding: 2px 10px !important; font-size: 0.72rem !important; min-width: 0 !important; background: transparent !important; border-color: var(--text-muted) !important; color: var(--text-muted) !important; }
.ai-confirm-no:hover { border-color: var(--accent-red) !important; color: var(--accent-red) !important; }

@media (max-width: 600px) {
  /* Mobile popup: fixed full-viewport above bottom-nav (500), below focus-exit (1200). */
  .popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0, 0, 0, 0.78);
    border-radius: 0;
    padding: 16px;
  }
  .popup-card {
    position: static;
    transform: none;
    top: auto; right: auto; left: auto;
    min-width: 0;
    width: 100%;
    max-width: 420px;
    padding: 16px 18px;
  }
  .popup-buttons { flex-direction: column; gap: 6px; }
  .popup-buttons .btn { width: 100%; }
  .defend-table td { padding: 4px 6px; font-size: 0.8rem; }
  .ai-confirm-prompt { margin-left: 0; width: 100%; justify-content: space-between; }
  .coin-toast-card { padding: 20px 28px; }
  .coin-toast-icon { font-size: 2rem; }
  .coin-toast-msg { font-size: 1.1rem; }
  .acpop-btn { width: 40px; height: 40px; }
  .acpop-icon { font-size: 0.95rem; }
  .acpop-lbl { font-size: 0.38rem; }
}

.rematch-offered {
  margin: 16px auto;
  max-width: 420px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 12px color-mix(in srgb, var(--accent-gold) 15%, transparent);
  animation: fadeIn 0.2s ease;
}
.rematch-offered strong { color: var(--accent-gold); }
.rematch-offered-buttons {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}
.rematch-status {
  margin: 14px auto;
  max-width: 360px;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  font-size: 0.92rem;
}
@media (max-width: 600px) {
  .rematch-offered-buttons { flex-direction: column; }
  .rematch-offered-buttons .btn { width: 100%; }
}

.ai-mode-panel {
  /* Reconcile() defers re-render while _aiPanelIsInteracting is true
     (action-bridge.js) so the dropdown stays clickable across AI-vs-AI ticks. */
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 0.82rem;
  color: var(--text-primary);
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  box-sizing: border-box;
}
.ai-mode-panel .ai-mode-select {
  flex: 1 1 0;
  min-width: 0;
}
.ai-mode-header {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-gold);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.ai-mode-badge {
  font-size: 0.55rem;
  background: color-mix(in srgb, var(--accent-gold) 20%, transparent);
  color: var(--accent-gold);
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.ai-mode-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.ai-mode-pick-label {
  color: var(--text-muted);
  font-weight: 600;
}
@media (max-width: 600px) {
  .ai-mode-panel {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
  }
}