/* SvS map (events/static/events/js/svs-grid.js) */
.svs-grid { width: 100%; max-width: 760px; display: block; margin: 0 auto; user-select: none; }
.svs-cell { fill: var(--wos-surface, #1c2433); stroke: rgba(140, 160, 200, .25); stroke-width: 1; }
.svs-cell.is-clickable { cursor: pointer; }
.svs-ghost-city { stroke-width: 2.5; stroke-dasharray: 4 3; }
.svs-ghost-city.is-ok { fill: rgba(105, 219, 124, .55); stroke: #2b8a3e; }
.svs-ghost-city.is-bad { fill: rgba(250, 82, 82, .5); stroke: #c92a2a; }
.svs-ghost-label { font-size: 10px; font-weight: 700; text-anchor: middle; fill: var(--bs-body-color, #f1f3f5);
                   paint-order: stroke; stroke: var(--bs-body-bg, #111827); stroke-width: 3px; }
.svs-ghost-problem { font-size: 8px; text-anchor: middle; fill: #ff8787; paint-order: stroke; stroke: var(--bs-body-bg, #111827); stroke-width: 3px; }
.svs-cell.is-clickable:hover { fill: rgba(77, 171, 247, .35); }
.svs-city { stroke: rgba(0, 0, 0, .55); stroke-width: 1.5; }
.svs-city.is-clickable { cursor: pointer; }
.svs-city.is-mine { stroke: #fff; stroke-width: 3; }
.svs-cell.is-turret { fill: none; stroke: none; }
.svs-cell.is-no-build { fill: rgba(232, 89, 12, .18); stroke: rgba(232, 89, 12, .35); }
.svs-turret { fill: #495057; stroke: #f59f00; stroke-width: 2; }
.svs-march-label { font-size: 9px; font-weight: 600; text-anchor: middle; fill: var(--bs-secondary-color, #adb5bd); }
.svs-zone-label { font-size: 11px; text-anchor: middle; fill: #fa5252; font-weight: 700; }
.svs-cell-label { font-size: 7px; text-anchor: middle; fill: #111; font-weight: 700; }
.svs-castle { fill: rgba(232, 89, 12, .35); stroke: #e8590c; stroke-width: 2; }
.svs-landmark-label { font-size: 10px; text-anchor: middle; fill: var(--bs-body-color, #dee2e6); font-weight: 700; }
.svs-landmark-label.is-turret { font-size: 8px; fill: #f59f00; }
.svs-compass { font-size: 14px; font-weight: 700; text-anchor: middle; fill: var(--bs-secondary-color, #868e96); }
/* "You're here" on the published plan (the player picked under "Who are you?") */
.svs-you-ring { fill: none; stroke: #e8d170; stroke-width: 5; animation: svs-you-pulse 1.6s ease-in-out infinite; }
.svs-you-bubble { fill: #e8d170; stroke: rgba(26, 20, 5, .6); stroke-width: 2; }
.svs-you-label { font-size: 22px; font-weight: 800; text-anchor: middle; fill: #1a1405; }
@keyframes svs-you-pulse { 50% { stroke-opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .svs-you-ring { animation: none; } }

/* Pet schedule bars (editor and published plan) */
.svs-pet-row { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.svs-pet-name { width: 170px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svs-pet-track { position: relative; flex: 1; height: 22px; background: var(--wos-surface); border-radius: 4px; }
.svs-pet-axis { background: none; }
.svs-tick { position: absolute; transform: translateX(-50%); font-size: .7rem; color: var(--bs-secondary-color); }
.svs-pet-bar { position: absolute; top: 2px; bottom: 2px; border-radius: 4px; font-size: .7rem; padding-left: 4px; color: #fff; overflow: hidden; white-space: nowrap; }
.svs-pet-bar.is-main { background: #3b5bdb; }
.svs-pet-bar.is-counter { background: #e8590c; }
.svs-pet-gap { position: absolute; top: 2px; bottom: 2px; background: repeating-linear-gradient(45deg, #f59f00 0 4px, transparent 4px 8px); border-radius: 4px; }
/* Player tags readable in both themes */
.svs-tag { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .8rem; background: var(--wos-surface);
           color: var(--bs-body-color); border: 1px solid var(--wos-border); }

/* ================= Published plan (svs/plan_view.html), in the look of the Foundry share page ================= */
/* Ink on the team colour: --wos-ice is light in dark mode and dark in light mode, so the surface colour reads on it in both. */
.svs-page { --svs-main: var(--wos-ice, #2a7fb0); --svs-counter: #e8590c; --svs-main-ink: var(--wos-surface, #fff); }
.svs-page .min-w-0 { min-width: 0; }
.svs-hero-actions { position: relative; z-index: 1; display: flex; gap: 6px; flex-wrap: wrap; }
.svs-hero-btn { color: #eef6fc; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); border-radius: 999px; }
.svs-hero-btn:hover, .svs-hero-btn:focus { color: #1a1405; background: var(--wos-gold, #e8d170); border-color: var(--wos-gold, #e8d170); }
.svs-draft { padding: 2px 10px; border-radius: 999px; background: rgba(232, 209, 112, .22); border: 1px solid rgba(232, 209, 112, .6); color: #ffe999; font-weight: 600; }
@media (max-width: 575px) { .svs-hero-actions { width: 100%; } .svs-hero-btn { flex: 1; } }

/* Who are you? */
.svs-mine.is-chosen { border-color: rgba(232, 209, 112, .6); box-shadow: 0 0 0 2px rgba(232, 209, 112, .25), var(--wos-shadow, none); }
.svs-me-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.svs-me-pick > select, .svs-me-pick > .select2-container { flex: 0 1 340px; min-width: 0; max-width: 100%; }
#svs-me-orders:not(:empty) { margin-top: 12px; }
.svs-page .fv-mine-team { --team-color: var(--svs-main); border-left: 5px solid var(--team-color); }
.svs-page .fv-mine-team.is-counter { --team-color: var(--svs-counter); }
.svs-page .fv-mine-facts { margin-bottom: 4px; }
.svs-page .fv-fact { flex-wrap: wrap; max-width: 100%; }
.svs-page .fv-fact.is-place { border-color: rgba(64, 192, 87, .55); }
.svs-page .fv-fact.is-place i { color: #40c057; }
.svs-page .fv-fact.is-pet { border-color: rgba(124, 199, 236, .5); }
.svs-page .fv-fact.is-pet i { color: var(--fp-blue); }
.svs-mine-block + .svs-mine-block { margin-top: 8px; }

/* Jump links (sticky) and name search */
.svs-nav .fv-tab { text-decoration: none; }
@media (max-width: 575px) {
    .svs-nav .fv-tab { flex-direction: column; gap: 2px; font-size: .74rem; padding: 6px 2px; }
    .svs-nav .fv-tab-count { display: none; }
}
.svs-find { max-width: 420px; }
.svs-section { scroll-margin-top: 70px; margin-bottom: 18px; }
.svs-panel-body { padding: 12px; }
.svs-heading { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 800; margin: 6px 0 10px; color: var(--wos-heading); }
.svs-heading i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: .9rem; color: #1a1405;
                 background: linear-gradient(135deg, #f6e49a, #d9b94a); }
.svs-heading.is-main i { color: var(--svs-main-ink); background: var(--svs-main); }
.svs-heading.is-counter i { color: #fff; background: var(--svs-counter); }
.svs-heading.is-counter { margin-top: 18px; }
.svs-heading-sub { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fp-muted); }
.svs-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--fp-muted); margin-bottom: 4px; }

/* Orders */
.svs-orders { display: grid; gap: 12px; }
@media (min-width: 992px) { .svs-orders:has(> :nth-child(2)) { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.svs-rules { border-left: 5px solid #e35d5d; }
.svs-rules .fv-section-title i { color: #e35d5d; }

/* Team and alliance cards */
.svs-teams { display: grid; gap: 12px; }
@media (min-width: 992px) { .svs-teams { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.svs-team { --team-color: var(--svs-main); --team-ink: var(--svs-main-ink); border-left: 5px solid var(--team-color); }
.svs-team.is-counter { --team-color: var(--svs-counter); --team-ink: #fff; }
.svs-team-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px;
                 border-bottom: 1px solid var(--fp-border); background: var(--fp-soft); }
.svs-team-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.svs-page .fv-role.is-main { background: rgba(124, 199, 236, .18); color: var(--svs-main); }
.svs-page .fv-role.is-counter { background: rgba(232, 89, 12, .16); color: var(--svs-counter); }
.svs-page .fv-role.is-joiner { background: var(--fp-soft); color: var(--fp-muted); border: 1px solid var(--fp-border); }
.svs-pill { display: inline-flex; align-items: center; font-size: .78rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
            background: var(--fp-panel); border: 1px solid var(--fp-border); color: var(--wos-text); }
.svs-pill i { color: var(--wos-gold-text); }
.svs-leader { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin-bottom: 10px; border-radius: 10px;
              background: linear-gradient(135deg, rgba(232, 209, 112, .2), rgba(232, 209, 112, .05)); border: 1px solid rgba(232, 209, 112, .45); }
.svs-leader > i { color: var(--wos-gold-text); font-size: 1.1rem; }
.svs-leader .svs-label { margin-bottom: 0; }
.svs-side { margin-bottom: 8px; }
.svs-side .fv-setup-head { flex-wrap: wrap; gap: 4px; }
/* Troop ratio: thin bar + legend (svs/_ratio_bar.html, and the player's own orders) */
.svs-ratio { display: grid; gap: 6px; }
.svs-ratio-track { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--fp-border); }
.svs-ratio-track span { background: var(--troop); min-width: 4px; }
.svs-ratio-legend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.svs-ratio-legend > span { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 3px 6px;
                           border-radius: 8px; font-size: .78rem; white-space: nowrap; color: var(--wos-text);
                           background: color-mix(in srgb, var(--troop) 14%, transparent); border: 1px solid color-mix(in srgb, var(--troop) 45%, transparent); }
.svs-ratio-legend strong { font-variant-numeric: tabular-nums; }
.svs-ratio-name { color: var(--troop); font-weight: 700; text-transform: uppercase; font-size: .68rem; letter-spacing: .04em; }
.svs-ratio-legend > span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--troop); flex: none; }
.svs-ratio-legend > span:has(.troop-icon)::before { display: none; }
.svs-mine-block .svs-ratio { max-width: 360px; margin-bottom: 6px; }
/* A narrow column (a rule card on half a screen, a phone): the tag takes two lines, icon and name above the number,
   instead of the number running past the tag's edge. The number itself is never split. */
.svs-ratio-legend > span, .svs-ratio-chip { flex-wrap: wrap; row-gap: 0; white-space: normal; text-align: center; line-height: 1.25; padding-inline: 4px; }
.svs-ratio-legend strong, .svs-ratio-chip strong { white-space: nowrap; }
/* One column per troop: its share on top, its heroes under it (svs/_troop_columns.html) */
.svs-troop-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; align-items: start; }
.svs-troop-col { display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-width: 0; }
.svs-ratio-chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; padding: 3px 6px;
                  border-radius: 8px; font-size: .78rem; white-space: nowrap; color: var(--wos-text);
                  background: color-mix(in srgb, var(--troop) 14%, transparent); border: 1px solid color-mix(in srgb, var(--troop) 45%, transparent); }
.svs-ratio-chip strong { font-variant-numeric: tabular-nums; }
.svs-ratio-chip:not(:has(.troop-icon))::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--troop); flex: none; }
.svs-troop-col .fv-hero-chip { min-width: 0; font-size: .82rem; padding: 2px 8px 2px 3px; }
@media (max-width: 575px) {
    .svs-troop-col .fv-hero-chip { gap: 4px; font-size: .74rem; padding: 2px 6px 2px 2px; }
    .svs-troop-col .hero-avatar { width: 20px; height: 20px; }
    .svs-ratio-chip { padding: 3px 4px; font-size: .74rem; }
}
.svs-hero-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svs-troop-col .hero-avatar { flex: none; }
.svs-or { text-align: center; font-size: .7rem; line-height: 1; color: var(--fp-muted); }
.svs-mine-block .svs-troop-cols { max-width: 420px; }
.fv-troop .troop-icon { margin-right: 2px; }
.svs-xy { font-size: .78rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; padding: 1px 8px; border-radius: 6px;
          background: var(--fp-panel); border: 1px solid var(--fp-border); color: var(--fp-blue); }
.svs-pets { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 8px 0; }
.svs-pets .svs-label { margin-bottom: 0; }
.svs-pet-chip { display: inline-flex; align-items: center; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px;
                background: rgba(124, 199, 236, .14); border: 1px solid rgba(124, 199, 236, .45); color: var(--fp-blue); }
.svs-joiners { list-style: none; counter-reset: joiner; padding: 0; margin: 0 0 4px; display: grid; gap: 4px; }
.svs-joiners li { counter-increment: joiner; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 6px 8px 6px 34px;
                  position: relative; border-radius: 8px; border: 1px solid var(--fp-border); font-size: .88rem; }
.svs-joiners li::before { content: counter(joiner); position: absolute; left: 8px; top: 50%; margin-top: -9px; width: 18px; height: 18px;
                          border-radius: 50%; display: grid; place-items: center; font-size: .68rem; font-weight: 800;
                          background: var(--team-color, var(--svs-main)); color: var(--team-ink, #fff); }
.svs-joiners li.is-empty { border-style: dashed; color: var(--fp-muted); }
.svs-joiner-name { font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.svs-joiner-heroes { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; flex: 1 1 auto; }
.svs-joiner-hero { display: inline-flex; align-items: center; gap: 4px; font-size: .82rem; }
.svs-stars { color: var(--wos-gold-text); font-weight: 700; }
.svs-alliance-name { display: flex; align-items: center; gap: 8px; font-weight: 800; min-width: 0; overflow-wrap: anywhere; }
.svs-abbr { flex: 0 0 auto; display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 6px; border-radius: 10px; font-size: .75rem;
            font-weight: 800; color: #1a1405; background: linear-gradient(135deg, #f6e49a, #d9b94a); }
.svs-alliance .fv-setups { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 576px) and (max-width: 991px) { .svs-alliance .fv-setups { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Map and coordinates */
.svs-map { display: grid; gap: 12px; padding: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 992px) { .svs-map:has(.svs-coords) { grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr); } }
.svs-march { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .875rem; margin-bottom: 8px; }
.svs-coords { min-width: 0; }
.svs-coords ul { max-height: 460px; overflow-y: auto; display: grid; gap: 3px; }
.svs-coords li { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 8px; background: var(--fp-soft); font-size: .85rem; }
.svs-coords-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.svs-march-s { font-size: .75rem; color: var(--fp-muted); min-width: 30px; text-align: right; font-variant-numeric: tabular-nums; }

/* Pets on a phone: a narrower name column */
@media (max-width: 575px) { .svs-page .svs-pet-name { width: 96px; } .svs-tick { font-size: .6rem; } }

/* Find / Who are you? highlight */
.svs-find-hit { background: rgba(232, 209, 112, .22) !important; outline: 2px solid var(--wos-gold, #e8d170); outline-offset: 1px; border-radius: 6px; }

/* How long a player said they play (the event form): next to the rally leader and the joiners */
.svs-dur { display: inline-block; font-size: .72rem; font-weight: 600; padding: 0 6px; border-radius: 6px; margin-left: 4px;
           white-space: nowrap; vertical-align: middle; background: rgba(128,128,128,.22); }
.svs-dur.is-full_time { background: rgba(25,135,84,.28); }
.svs-dur.is-first_half, .svs-dur.is-second_half, .svs-dur.is-4_h { background: rgba(255,193,7,.3); }
.svs-dur.is-min_points, .svs-dur.is-2_h, .svs-dur.is-l_2_h { background: rgba(220,53,69,.3); }
.svs-dur.is-slots { background: rgba(255,193,7,.3); }
