/* Agency: TCG — visual polish. Keep game rules and tabletop geometry intact. */
.match-fit-169 .match-right-rail.reactions-aligned-323 {
  height: var(--match-rail-height-323) !important;
  min-height: 0 !important;
  grid-template-rows: minmax(0, 1fr) auto !important;
}
/* Redraws must not make the browser pick a different scroll anchor. */
html:has(.online-match-shell), .online-match-shell { overflow-anchor: none; scroll-behavior: auto; }

/* Learn to Play uses Photoshop-style black-and-white selection borders. */
.learn-highlight-v2 { outline: none !important; }
.learn-marching-ants-v2 { position: absolute; z-index: 10; pointer-events: none; overflow: visible; }
.learn-marching-ants-v2 rect { fill: none; stroke-width: 2px; }
.learn-marching-ants-v2 .selection-white { stroke: #fff; }
.learn-marching-ants-v2 .selection-black { stroke: #111; stroke-dasharray: 4 4; animation: learn-marching-ants 700ms linear infinite; }
@keyframes learn-marching-ants { to { stroke-dashoffset: -8; } }
@media (prefers-reduced-motion: reduce) {
  .learn-marching-ants-v2 .selection-black { animation: none; }
}

/* Native select behavior, with a consistently inset disclosure arrow. */
select:not([multiple]):not([size]), select[size="1"] {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 44px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235e5852' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 16px 16px !important;
}
@media (forced-colors: active) {
  select:not([multiple]):not([size]), select[size="1"] {
    appearance: auto;
    -webkit-appearance: auto;
    background-image: none !important;
  }
}

.game-modal.confirmation-modal { width: min(480px, 100%); }
.confirmation-copy { color: #423c36; font-size: 16px; line-height: 1.6; margin: 16px 0 24px; }
.confirmation-actions { justify-content: flex-end; gap: 12px; }
.confirmation-actions button { min-height: 44px; }
.meeting-note-move { display: flex; align-items: flex-start; gap: 10px; }
.meeting-note-system-label + .meeting-note-move { margin-top: 8px; }
body.dragging-card #hand-hover-portal,
body.dragging-card #campaign-hover-portal { display: none !important; }
.meeting-note-move > p { min-width: 0; margin: 0; }
.meeting-note-card {
  appearance: none; border: 0; padding: 0; background: transparent;
  flex: 0 0 36px; width: 36px; border-radius: 3px; cursor: pointer;
  box-shadow: 0 2px 5px rgba(39,29,24,.15);
}
.meeting-note-card img { display: block; width: 100%; height: auto; border-radius: inherit; }
.meeting-note-card:focus-visible { outline: 2px solid #655f59; outline-offset: 3px; }
.meeting-note-card-preview { position: fixed; z-index: 12000; pointer-events: none; border-radius: 8px; box-shadow: 0 16px 48px rgba(39,29,24,.3); }
.meeting-note-card-preview img { display: block; width: 100%; height: auto; border-radius: inherit; }
.game-modal.meeting-note-card-modal { width: min(440px, 100%); }
.meeting-note-inspected-card { display: block; width: min(320px, 100%); max-height: 65vh; object-fit: contain; margin: 18px auto 0; border-radius: 6px; }

/* Draw interface marks, rather than relying on a font's baseline/bearings. */
.ui-icon { display: block; flex: none; pointer-events: none; }
.modal-x {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  z-index: 2;
}
.meeting-note-reaction-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
}
.game-modal:has(> .modal-x) > h2,
.rules-modal-content > h2,
.discard-browser-content > h2 { padding-right: 42px; }
body.game-overlay-open { overflow: hidden; }
.game-overlay { grid-template-columns: minmax(0, 1fr); }
.game-modal { min-width: 0; width: min(980px, 100%); overscroll-behavior: contain; }
.discard-browser-modal { width: min(1240px, 100%); }

/* Rules: the old dark-theme list color survived the switch to light panels. */
.rules-modal { width: min(820px, 100%); max-width: 100%; }
.rules-modal-content > h2 { line-height: 1.08; }
.rules-section { border-color: rgba(23,21,18,.17); padding-block: 22px; }
.rules-section h3 { font-size: .875rem; line-height: 1.4; }
.rules-modal .rules-section p,
.rules-modal .rules-section li {
  color: #514b46 !important;
  font-size: 1rem;
  line-height: 1.65;
}
.rules-section p + p { margin-top: 12px; }
.rules-section li + li { margin-top: 8px; }
.rules-section li::marker { color: #514b46; }

/* A stable header avoids a layout jump while the logo image loads. */
.site-redesign-130 .online-logo { aspect-ratio: 2095 / 1534; object-fit: contain; }
.site-redesign-130 .online-panel { width: min(1180px, 100%); }
.site-redesign-130 .online-head { flex-wrap: wrap; }
.site-redesign-130 .alpha-chip { max-width: 100%; white-space: normal; line-height: 1.45; }
.site-redesign-130 .solo-mode-card,
.site-redesign-130 .solo-mode-controls,
.site-redesign-130 .selection-grid > *,
.site-redesign-130 .field { min-width: 0; }
.site-redesign-130 .field label { font-size: .75rem; line-height: 1.4; }
.site-redesign-130 .field input:not([type="radio"]),
.site-redesign-130 .field select { min-height: 46px; font-size: 1rem; }
.site-redesign-130 .mode-card p,
.site-redesign-130 .solo-mode-copy p,
.site-redesign-130 .home-rules-card p { font-size: .875rem; line-height: 1.55; }
.site-redesign-130 .multi-bot-setup-note,
.site-redesign-130 .agency-name-count-331 { font-size: .75rem; line-height: 1.45; color: #655f59; }
.site-redesign-130 .agency-name-count-331 { margin-top: 0; font-variant-numeric: tabular-nums; }
.site-redesign-130 .setup-back { min-height: 40px; font-size: .75rem; }
.site-redesign-130 :is(.primary-btn, .secondary-btn) {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1.25;
}
.site-redesign-130 .solo-difficulty-option span { text-align: center; }
.site-redesign-130 .solo-difficulty-option input:focus-visible + span {
  outline: 2px solid #171512;
  outline-offset: 3px;
}
.site-redesign-130 :is(button, input, select):focus-visible,
.game-modal :is(button, input, select):focus-visible,
.match-redesign-130 button:focus-visible {
  outline: 2px solid #171512;
  outline-offset: 3px;
}

/* Align counterpart fields and actions even when names have a counter. */
@media (min-width: 761px) {
  .site-redesign-130 .setup-primary-grid .mode-card {
    display: grid;
    grid-template-rows: auto auto minmax(3.1em, auto) auto 1fr auto;
    align-content: start;
  }
  .site-redesign-130 .setup-primary-grid .field { align-content: start; padding-bottom: 25px; position: relative; }
  .site-redesign-130 .setup-primary-grid .agency-name-count-331 { position: absolute; right: 0; bottom: 0; }
  .site-redesign-130 .setup-primary-grid .action-row { align-self: end; }
}

/* Keep the three home tiles on a common typographic grid. */
@media (min-width: 901px) {
  .game-mode-choice-grid .game-mode-choice {
    display: grid;
    grid-template-rows: auto 124px minmax(54px, auto) minmax(34px, auto);
    align-content: start;
    align-items: end;
  }
  .game-mode-choice-grid .game-mode-choice-kicker { align-self: start; margin-bottom: 0; }
  .game-mode-choice-grid .game-mode-choice > strong { margin-top: 24px; }
  .game-mode-choice-grid .game-mode-choice > span:not(.game-mode-choice-kicker),
  .game-mode-choice-grid .game-mode-choice > em { align-self: start; }
}
.game-mode-choice em { font-size: .75rem; line-height: 1.45; }
.leaderboard-name-33 { font-size: .8125rem; }
.leaderboard-rank-33 { font-size: .75rem; color: #aaa9a2; }
.leaderboard-score-33 { font-variant-numeric: tabular-nums; }
.leaderboard-score-33 small { font-size: .625rem; color: #aaa9a2; }
.leaderboard-heading-33 > span { font-size: .625rem; color: #aaa9a2; }

/* Give enlarged Campaign titles their full column; never split ordinary words. */
.presentation-viewer-modal {
  display: block;
  overflow: auto !important;
}
.presentation-viewer-content { min-height: 100%; grid-template-rows: auto 1fr auto; }
.presentation-viewer-modal .network-slot.campaign-stack {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 18px;
}
.presentation-viewer-modal .campaign-stack-info .stack-label {
  font-size: 1rem;
  line-height: 1.3;
  word-break: normal;
  overflow-wrap: break-word;
}
.presentation-viewer-modal .stack-cards { width: 180px; max-width: 100%; }
.presentation-viewer-modal .stack-card { width: 180px; max-width: 100%; }
.presentation-viewer-modal .network-slot { min-height: 440px; }
.presentation-viewer-meta { font-size: .8125rem; line-height: 1.5; }
.presentation-viewer-note { font-size: .75rem; line-height: 1.5; }
.presentation-viewer-score { align-self: flex-start; }
.presentation-viewer-header h2 { overflow-wrap: anywhere; line-height: 1.08; }
.presentation-viewer-header > div:first-child { min-width: 0; }

@media (max-width: 860px) {
  .site-redesign-130 .solo-mode-card { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .site-redesign-130 { padding-inline: 16px; }
  .site-redesign-130 .online-head,
  .site-redesign-130 .online-body { padding-inline: 0; }
  .site-redesign-130 .home-rules-card { align-items: flex-start; flex-direction: column; }
  .site-redesign-130 .home-rules-card .secondary-btn { align-self: stretch; }
  .site-redesign-130 .alpha-chip { font-size: .625rem; }
  .game-overlay { padding: 16px; }
  .game-modal { max-width: 100%; max-height: calc(100dvh - 32px); }
  .rules-modal { padding: 24px 20px 28px; }
  .rules-modal-content > h2 { font-size: 1.75rem; }
  .presentation-viewer-modal .network-slot { min-height: 440px; }
  .presentation-viewer-header { gap: 16px; }
  .presentation-viewer-score { justify-self: start; }
}
@media (prefers-reduced-motion: reduce) {
  .game-mode-choice { transition: none; }
  .game-mode-choice:hover { transform: none; }
}
