* { box-sizing: border-box; margin: 0; padding: 0; font-family: var(--font-ui); }
    html { overflow-x: clip; font-size: 16px; }
    button, input, select, textarea { font-family: inherit; }
    input[type="number"],
    input[type="text"].qty-input,
    .qty-input {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums lining-nums;
    }
    body {
      background: var(--bg);
      color: var(--text);
      overflow-x: clip;
      font-size: var(--text-base);
      font-weight: var(--weight-medium);
      line-height: var(--leading-normal);
      letter-spacing: var(--tracking-normal);
      -webkit-font-smoothing: antialiased;
      font-feature-settings: "kern" 1, "liga" 1;
      --card-bg: var(--surface-raised);
      --btn-bg: var(--surface);
      --primary: var(--accent);
      --muted: var(--text-muted);
    }
    #main { width: 100%; max-width: 1300px; margin: 0 auto; padding: 20px; }
    h1 {
      font-family: var(--font-display);
      font-size: var(--text-2xl);
      font-weight: var(--weight-bold);
      line-height: var(--leading-tight);
      letter-spacing: var(--tracking-wide);
      margin-bottom: 20px;
      padding-bottom: 10px;
      color: var(--text-heading, var(--text));
      border-bottom: 1px solid var(--border);
    }
    h2, h3,
    .sect-title,
    .modal-title,
    .tavern-panel-label,
    .battle-calc-header,
    .townhall-admin-panel__title,
    .feedback-panel__title {
      font-family: var(--font-hud);
      letter-spacing: var(--tracking-hud);
    }
    .h1-title { font-weight: var(--weight-bold); }
    .h1-subtitle { font-size: 0.4em; color: var(--text-faint); vertical-align: middle; margin-left: 0.28em; }
    .h1-version { font-size: 0.35em; color: var(--text-subtle); vertical-align: middle; margin-left: 10px; font-weight: normal; }

    .game-container { display: flex; gap: 20px; align-items: flex-start; }
    .game-left { flex: 1; min-width: 0; }
    .game-right { width: 340px; max-width: 100%; flex-shrink: 0; min-width: 0; }
    .sect {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      padding: 15px;
      margin-bottom: 15px;
      box-shadow: var(--shadow-sm);
    }
    .sect-title {
      font-family: var(--font-hud);
      font-size: var(--text-sm); font-weight: var(--weight-semibold);
      color: var(--text-heading, var(--text-muted)); display: block; margin-bottom: 10px;
      letter-spacing: var(--tracking-hud); text-transform: uppercase;
    }

    /* Упорядоченные метрики в модалках (банк, ратуша и т.п.) */
    .info-stats {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
      gap: 8px 12px;
      margin: 0 0 10px;
    }
    .info-stats--2 { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
    .info-stats--wide { grid-template-columns: 1fr; }
    .info-stat {
      display: flex;
      flex-direction: column;
      gap: 2px;
      min-width: 0;
      padding: 8px 10px;
      background: var(--surface-raised, #f7f7f7);
      border: 1px solid var(--border, #eee);
      border-radius: var(--radius, 4px);
    }
    .info-stat__label {
      font-size: var(--text-2xs);
      font-weight: var(--weight-semibold);
      letter-spacing: var(--tracking-wide);
      text-transform: uppercase;
      color: var(--text-muted, #888);
      line-height: var(--leading-tight);
    }
    .info-stat__value {
      font-size: var(--text-md);
      font-weight: var(--weight-semibold);
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums lining-nums;
      color: var(--text, #222);
      line-height: var(--leading-tight);
      word-break: break-word;
    }
    .info-stat__value small,
    .info-stat__value .info-stat__sub {
      display: block;
      margin-top: 2px;
      font-size: var(--text-sm);
      font-weight: var(--weight-normal);
      font-family: var(--font-ui);
      color: var(--text-muted, #666);
    }
    .info-hint {
      font-size: var(--text-base);
      color: var(--text-muted, #666);
      line-height: 1.45;
      margin: 0 0 8px;
    }
    .info-hint code,
    .info-hint b { color: var(--text, #333); }
    .info-status {
      font-size: var(--text-md);
      margin: 4px 0 0;
    }
    .info-status--ok { color: var(--success); font-weight: var(--weight-semibold); }
    .info-status--wait { color: var(--text-muted); }
    .type-value, .type-timer, .type-coord, .type-army {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums lining-nums;
      font-weight: var(--weight-medium);
      font-feature-settings: "tnum" 1, "lnum" 1, "zero" 0;
    }
    .type-timer-active { font-weight: var(--weight-semibold); color: var(--info); }
    .type-deficit { font-weight: var(--weight-bold); color: var(--danger); }
    .type-surplus { font-weight: var(--weight-medium); color: var(--success); }
    .type-alert { font-weight: var(--weight-bold); color: var(--warning-text); }
    .info-panel-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }
    .info-panel-head .sect-title { margin-bottom: 0; }
    .info-panel-head__meta {
      font-size: var(--text-base);
      color: var(--text-muted, #888);
    }
    .info-actions { margin-top: 8px; }
    .info-ban {
      display: none;
      margin: 0 0 10px;
      padding: 8px 10px;
      border: 1px solid #e0a0a0;
      border-radius: var(--radius, 4px);
      background: rgba(200, 40, 40, 0.06);
      color: #a00;
      font-size: var(--text-base);
    }
    #generalSection.info-panel--general,
    #thiefSection.info-panel--thief {
      background: var(--surface, #fff);
      border: 1px solid var(--border, #eee);
      border-radius: var(--radius, 6px);
      padding: 12px;
      margin-bottom: 15px;
      box-shadow: var(--shadow-sm);
    }
    #thiefSection.info-panel--thief {
      background: var(--surface-raised, #fffaf3);
      border-color: #f0e0c8;
    }
    .thief-neighbor-list { margin-top: 6px; }
    .thief-neighbor-row {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      flex-wrap: wrap;
      padding: 6px 0;
      border-bottom: 1px solid var(--border, #eee);
    }
    .thief-neighbor-row:last-child { border-bottom: none; }
    .resource-bar,
    .game-stat-line {
      display: flex; flex-wrap: wrap; gap: 10px;
      font-family: var(--font-mono);
      font-size: var(--text-md); font-weight: var(--weight-medium); line-height: var(--leading-normal);
      font-variant-numeric: tabular-nums lining-nums;
    }
    .global-stats-box,
    .market-price-box {
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums lining-nums;
      font-weight: var(--weight-medium);
    }
    .city-meta.game-stat-line {
      margin-top: 8px;
      font-family: var(--font-mono);
      font-size: var(--text-md);
      line-height: var(--leading-normal);
      font-weight: var(--weight-medium);
      color: var(--text);
    }
    .game-stat-line.ui-empty { font-weight: 400; color: var(--text-subtle); }
    .tavern-panel-label {
      font-family: var(--font-hud);
      font-size: var(--text-sm); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-hud);
      text-transform: uppercase;
      color: var(--text-heading, var(--text-subtle)); margin-bottom: 6px;
    }
    .game-container #gameHeaderRow button,
    .game-container #cityPanelMount button,
    .game-container #adminPanelMount button {
      border: 1px solid var(--border-strong);
      background: var(--surface-raised);
      color: var(--text-muted);
      box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    }
    .game-container #gameHeaderRow button:hover:not(:disabled),
    .game-container #cityPanelMount button:hover:not(:disabled),
    .game-container #adminPanelMount button:hover:not(:disabled) {
      background: var(--btn-ghost-hover-bg);
      color: var(--btn-ghost-hover-text);
      border-color: var(--border-strong);
    }
    .game-container #gameHeaderRow button.primary,
    .game-container #cityPanelMount button.primary {
      background: var(--accent);
      border-color: var(--accent-hover);
      color: var(--btn-primary-text);
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    }
    .game-container #gameHeaderRow button.primary:hover:not(:disabled),
    .game-container #cityPanelMount button.primary:hover:not(:disabled) {
      background: var(--accent-hover);
      color: var(--btn-primary-text);
    }
    .game-container #adminPanelMount button.btn-end-game {
      background: var(--danger);
      border-color: var(--danger);
      color: #ffffff;
      font-weight: 600;
      box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    }
    .game-container #adminPanelMount button.btn-end-game:hover:not(:disabled) {
      background: #c82333;
      border-color: #bd2130;
      color: #ffffff;
    }
    .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
    .row--top { align-items: flex-start; gap: 20px; }

    button {
      padding: 6px 12px; border: none; border-radius: var(--radius);
      background: transparent; cursor: pointer; font-size: var(--text-md); color: var(--text-muted);
      transition: background 0.15s, color 0.15s;
    }
    button:hover:not(:disabled) { background: var(--btn-ghost-hover-bg); color: var(--btn-ghost-hover-text); }
    button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
    button.primary { background: var(--accent); color: var(--btn-primary-text); box-shadow: var(--shadow-sm); }
    button.primary:hover:not(:disabled) { background: var(--accent-hover); }
    button:disabled { opacity: 0.4; cursor: not-allowed; }

    .log-container {
      height: 400px; overflow-y: auto; font-size: var(--text-md); line-height: var(--leading-normal);
      background: var(--log-bg); border: 1px solid var(--border); border-radius: var(--radius-modal);
      padding: 4px 8px;
    }
    .log-entry { padding: 4px 0; border-bottom: 1px solid var(--log-entry-border); }
    .war-log-table-wrap { overflow-x: auto; width: 100%; -webkit-overflow-scrolling: touch; }
    .war-log-table {
      border-collapse: collapse; font-size: var(--text-sm); line-height: var(--leading-dense);
      min-width: 1280px; width: max-content;
    }
    .war-log-table th, .war-log-table td {
      border: 1px solid var(--border); padding: 5px 7px;
      vertical-align: top; text-align: left;
    }
    .war-log-table thead th {
      position: sticky; top: 0; z-index: 2;
      background: var(--panel-bg, var(--log-bg));
      font-weight: normal; white-space: nowrap; font-size: var(--text-xs);
    }
    .war-log-table tbody tr:nth-child(even) { background: rgba(127,127,127,0.06); }
    .war-log-table .war-army {
      color: var(--text-subtle); font-size: var(--text-xs); display: block; margin-top: 2px;
      font-family: var(--font-mono); font-variant-numeric: tabular-nums;
    }
    .war-log-empty { padding: 12px; color: var(--text-subtle); font-size: var(--text-md); }
    .war-log-compact { font-size: var(--text-base); line-height: 1.4; font-weight: normal; }
    .war-log-compact .log-turn { font-weight: normal; }
    #warLog.log-container { padding: 4px 8px; overflow-y: auto; }
    #fullWarLogBody { padding: 0 4px 8px; }
    .log-turn { font-weight: var(--weight-semibold); color: var(--text-subtle); font-size: var(--text-sm); margin-right: 5px; font-family: var(--font-ui); font-variant-numeric: tabular-nums; letter-spacing: normal; }
    .victory { color: var(--success); }
    .loss { color: var(--danger); }
    .notice { color: var(--info); }

    .modal {
      display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
      background: var(--modal-overlay); z-index: 1000; overflow-y: auto;
    }
    .modal-content {
      background: var(--modal-bg); color: var(--text);
      margin: 40px auto; padding: 30px;
      width: min(600px, calc(100vw - 24px)); max-width: 600px;
      border-radius: var(--radius-modal); border: 1px solid var(--border);
      position: relative;
      box-shadow: var(--shadow-lg);
    }
    .modal-content--wide { width: min(1100px, calc(100vw - 24px)); max-width: 1100px; }
    .modal-content--lg { width: min(800px, calc(100vw - 24px)); max-width: 800px; }
    .modal-content--leaders { width: min(96vw, 720px); max-width: 720px; margin: 20px auto; padding: 24px 28px; }
    .modal-content--war-log { width: min(96vw, 1400px); max-width: 1400px; }
    #adminCountryEditModal { z-index: 1101; }
    .modal-body { max-height: 70vh; overflow-y: auto; font-size: var(--text-base); line-height: var(--leading-normal); }
    .modal-body p, .modal-body span { font-size: var(--text-base); margin-bottom: 4px; }
    .modal-body button { font-size: var(--text-base); padding: 4px 10px; }
    .modal-body .sect-title { font-size: var(--text-sm); }
    .modal-body .capture-info { font-size: var(--text-sm); }
    .modal-header {
      display: flex; justify-content: space-between; align-items: center;
      margin-bottom: 20px; padding-bottom: 10px;
      border-bottom: 1px solid var(--modal-header-border);
    }
    .modal-title { font-family: var(--font-hud); font-size: var(--text-lg); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-hud); }
    .close { color: var(--close); font-size: 24px; cursor: pointer; }
    .close:hover { color: var(--close-hover); }

    .leaderboard-table { width: 100%; border-collapse: collapse; margin-top: 0; }
    .leaderboard-table th, .leaderboard-table td {
      text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: var(--text-md);
    }
    .leaderboard-table th { font-weight: var(--weight-semibold); color: var(--text-subtle); text-transform: uppercase; font-size: var(--text-xs); letter-spacing: var(--tracking-wide); }
    .leaderboard-table td { font-variant-numeric: tabular-nums; }
    .leaderboard-table th.num, .leaderboard-table td.num { text-align: right; }
    .leaderboard-table tbody tr:last-child td { border-bottom: none; }
    .leaderboard-table tbody tr.leaders-row--self { background: var(--strip-bg); }
    .leaderboard-table tbody tr.leaders-row--self td { font-weight: 600; }

    .leaders-panel { display: flex; flex-direction: column; gap: 12px; }
    .leaders-accordion {
      display: flex; flex-direction: column; gap: 8px;
    }
    .leaders-accordion-item {
      border: 1px solid var(--border); border-radius: var(--radius);
      background: var(--surface-raised); overflow: hidden;
    }
    .leaders-accordion-summary {
      display: flex; align-items: center; justify-content: space-between; gap: 12px;
      padding: 12px 14px; cursor: pointer; user-select: none;
      font-weight: 700; font-size: var(--text-base); color: var(--text-subtle);
      letter-spacing: 0.02em; line-height: var(--leading-tight); list-style: none;
    }
    .leaders-accordion-summary::-webkit-details-marker { display: none; }
    .leaders-accordion-summary::marker { content: ''; display: none; }
    .leaders-accordion-item[open] > .leaders-accordion-summary {
      border-bottom: 1px solid var(--border); background: var(--surface);
    }
    .leaders-accordion-title { flex: 1; min-width: 0; }
    .leaders-accordion-chevron {
      flex-shrink: 0; color: var(--text-faint); font-size: var(--text-base);
      transition: transform 0.2s ease;
    }
    .leaders-accordion-item:not([open]) .leaders-accordion-chevron { transform: rotate(-90deg); }
    .leaders-accordion-body .leaders-table-wrap {
      border: none; border-radius: 0; background: transparent;
    }
    .leaders-section-title {
      margin: 0 0 10px 0; font-size: var(--text-base); font-weight: 700;
      color: var(--text-subtle); letter-spacing: 0.02em; line-height: var(--leading-tight);
    }
    .leaders-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-raised); }
    .leaders-table-wrap .leaderboard-table { margin: 0; }
    .leaders-table-wrap .leaderboard-table thead th { background: var(--surface); border-bottom: 1px solid var(--border-strong); }
    .leaders-table--main .leaders-rank { width: 2.5em; color: var(--text-faint); font-weight: 600; }
    .leaders-name-cell { min-width: 140px; word-break: break-word; }
    .leaders-badges { font-size: var(--text-base); opacity: 0.9; white-space: nowrap; }
    .leaders-self { font-weight: 600; }
    .leaders-vs { display: block; margin: 3px 0; color: var(--text-faint); font-size: var(--text-xs); font-style: italic; text-align: left; }
    .leaders-battle-cell { min-width: 160px; line-height: var(--leading-normal); }
    .leaders-battle-side { display: block; }
    .leaders-grid {
      display: grid; grid-template-columns: repeat(2, minmax(280px, 1fr)); gap: 22px 28px;
    }
    .leaders-accordion .leaders-table-wrap .leaderboard-table thead th {
      position: sticky; top: 0; z-index: 1;
    }
    #leadersModal .modal-title { font-size: var(--text-lg); font-weight: var(--weight-semibold); }
    #leadersModal .modal-body {
      max-height: min(88vh, 920px); overflow-y: auto; font-size: var(--text-base); line-height: var(--leading-normal);
    }
    #leadersModal .modal-body p,
    #leadersModal .modal-body span:not(.leaders-badges):not(.leaders-vs) { font-size: inherit; }
    #leadersBody { max-height: none; overflow: visible; }
    #leadersModal .leaderboard-table th,
    #leadersModal .leaderboard-table td {
      padding: 9px 12px; font-size: var(--text-base); line-height: var(--leading-normal);
    }
    #leadersModal .leaderboard-table th {
      font-size: var(--text-xs); padding-top: 10px; padding-bottom: 10px; white-space: nowrap;
    }
    #leadersModal .leaderboard-table tbody tr:nth-child(even):not(.leaders-row--self) { background: var(--strip-bg); }
    #leadersModal .leaders-rank { width: 2.75em; padding-right: 8px; }
    #leadersModal .leader-country-name { line-height: 1.35; }

    .science-bar { background: var(--science-track); height: 6px; border-radius: var(--radius); margin: 8px 0; overflow: hidden; }
    .science-progress { height: 100%; background: var(--science-fill); width: 0%; transition: width 0.3s; }

    .start-screen { text-align: center; padding: 60px 20px; }
    .start-hero-text {
      font-size: 48px; line-height: 1; margin: 0 auto 6px; opacity: 0.88;
    }
    .start-hero-caption {
      margin: 0 auto 18px; font-size: var(--text-lg); font-style: italic; color: var(--text-muted);
    }
    .start-input {
      padding: 10px; font-size: var(--text-base); border: 1px solid var(--input-border);
      border-radius: var(--radius); margin-bottom: 15px; width: 250px; text-align: center;
      background: var(--input-bg); color: var(--text);
    }
    .start-input--block { display: block; margin: 0 auto 12px auto; width: min(320px, 90%); }
    .start-button { padding: 8px 28px; font-size: var(--text-lg); }
    .start-label { display: block; margin: 0 auto 16px auto; font-size: var(--text-md); color: var(--text-muted); max-width: 320px; text-align: left; }
    .start-error { color: var(--danger); margin-top: 12px; font-size: var(--text-md); }
    .start-hero { width: 260px; max-width: 90%; border-radius: 10px; margin-bottom: 20px; opacity: 0.92; }

    .world-map-container {
      margin: 20px 0; padding: 15px; background: var(--surface-raised);
      border: 1px solid var(--border); border-radius: var(--radius);
      overflow-x: auto; width: 100%; max-width: 100%; scroll-behavior: auto;
      overflow-anchor: none; -webkit-overflow-scrolling: touch;
      cursor: grab;
    }
    .world-map-container.world-map-container--dragging {
      cursor: grabbing;
      user-select: none;
      -webkit-user-select: none;
    }
    .world-map-container.world-map-container--dragging * {
      user-select: none;
      -webkit-user-select: none;
    }
    #worldMapCollapsible, #squadsPanelMount { overflow-anchor: none; }
    /* Карта, открытая пользователем: не даём inline-стилям/перерисовке схлопнуть панель */
    #worldMapCollapsible[data-user-expanded="true"] {
      display: block !important;
    }
    #worldMapToggleIcon[data-map-expanded="true"] {
      transform: rotate(180deg) !important;
    }
    .world-map-grid { display: flex; flex-direction: row; gap: 4px; width: max-content; }
    .map-cell {
      width: var(--map-cell-w, 115px); min-width: var(--map-cell-w, 115px); min-height: 70px; height: auto;
      border: 1px solid var(--map-cell-border); border-radius: var(--radius);
      padding: 5px 4px; font-size: var(--text-xs); position: relative;
      background: var(--map-cell-bg); color: var(--text); flex-shrink: 0;
      display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start;
      transition: box-shadow 0.15s ease, border-color 0.15s ease, background-color 0.15s ease;
    }
    /* Окраска сектора по типу объекта (важнее базового --map-cell-bg) */
    .map-cell.map-cell--swamp {
      background-color: var(--map-swamp-bg);
      box-shadow: inset 3px 0 0 var(--map-swamp-label);
    }
    .map-cell.map-cell--garrison {
      background-color: var(--map-garrison-bg);
      box-shadow: inset 3px 0 0 var(--map-barbarian);
    }
    .map-cell.map-cell--swamp.map-cell--garrison {
      background-color: var(--map-garrison-bg);
      box-shadow: inset 3px 0 0 var(--map-barbarian);
    }
    .map-cell:hover { box-shadow: var(--shadow-sm); }
    .map-cell.map-cell--swamp:hover {
      box-shadow: var(--shadow-sm), inset 3px 0 0 var(--map-swamp-label);
    }
    .map-cell.map-cell--garrison:hover,
    .map-cell.map-cell--swamp.map-cell--garrison:hover {
      box-shadow: var(--shadow-sm), inset 3px 0 0 var(--map-barbarian);
    }
    .map-cell-label { font-weight: bold; margin-bottom: 4px; }
    .map-cell-content { text-align: center; }
    .map-cell-nation {
      font-size: var(--text-xs);
      font-weight: 700;
      line-height: 1.35;
      color: var(--text-subtle);
    }
    .map-cell-squad {
      font-size: var(--text-2xs);
      font-weight: 400;
      line-height: 1.35;
    }
    .map-cell-squads {
      font-size: var(--text-2xs);
      font-weight: 400;
      line-height: 1.4;
      word-wrap: break-word;
      overflow-wrap: anywhere;
      white-space: normal;
      max-width: 100%;
    }
    .map-squad-name {
      cursor: help;
      font-weight: 600;
    }
    .map-castle-name {
      cursor: help;
      font-weight: 600;
    }
    .map-squad-icon {
      display: inline-flex;
      align-items: center;
      vertical-align: middle;
      line-height: 1;
    }
    .map-squad-icon .lt-ico,
    .map-squad-icon svg {
      display: block;
      vertical-align: middle;
    }
    .capture-info { background: transparent; padding: 6px 0; margin: 6px 0; font-size: var(--text-base); }
    .global-stats-box { padding: 10px 0; font-size: var(--text-base); line-height: 1.5; margin-bottom: 15px; }

    .squad-management-box .squad-row {
      background: var(--surface-raised); border: 1px solid var(--border);
      padding: 10px; margin-bottom: 10px; border-radius: var(--radius);
      overflow-x: auto;
      font-family: var(--font-mono);
      font-variant-numeric: tabular-nums lining-nums;
    }
    .squad-management-box .squad-row button {
      padding: 4px 10px; font-size: var(--text-base); font-family: var(--font-ui);
    }
    .squad-attack-wrap { position: relative; display: inline-block; vertical-align: middle; }
    .squad-attack-menu {
      display: none; position: absolute; right: 0; top: 100%; z-index: 60;
      min-width: 12em; margin-top: 2px; padding: 4px 0;
      background: var(--surface-raised, #fff); border: 1px solid var(--border, #ccc);
      border-radius: var(--radius, 4px); box-shadow: 0 4px 12px rgba(0,0,0,.15);
    }
    .squad-attack-wrap.open .squad-attack-menu { display: flex; flex-direction: column; }
    .squad-attack-menu .squad-attack-item {
      display: block; width: 100%; text-align: left; white-space: nowrap;
      padding: 5px 10px; font-size: var(--text-base); border: none; border-radius: 0;
      background: transparent; box-shadow: none;
    }
    .squad-attack-menu .squad-attack-item:hover:not(:disabled) { background: var(--accent-muted, #e8f4fc); }
    .squad-develop-oil-btn {
      display: inline-flex; align-items: center; justify-content: center;
      padding: 4px 6px; line-height: 1; vertical-align: middle;
      min-width: 28px; min-height: 28px;
    }
    .squad-develop-oil-btn img,
    .squad-develop-oil-btn svg {
      display: block; width: 18px; height: 18px;
    }
    .squad-sector-loc-btn {
      font-size: var(--text-sm); padding: 2px 4px; margin: 0 2px;
      color: var(--info); background: transparent;
      border: none; box-shadow: none; outline: none;
      cursor: pointer; font-weight: 600; vertical-align: middle;
      line-height: 1.2;
    }
    .squad-sector-loc-btn:hover {
      background: transparent;
      color: var(--accent-hover);
      text-decoration: underline;
    }
    .squad-sector-loc-btn:focus-visible {
      outline: 1px dotted var(--text-subtle);
      outline-offset: 2px;
    }
    body.theme-bw .squad-sector-loc-btn,
    body.theme-bw .squad-sector-loc-btn:hover:not(:disabled) {
      background: transparent;
      border: none;
      box-shadow: none;
    }
    .country-header-loc-btn {
      font-size: 1.2em; padding: 0; margin: 0;
      background: transparent; border: none; box-shadow: none; outline: none;
      cursor: pointer; font-weight: bold; vertical-align: baseline;
      line-height: 1.2;
      color: var(--text-subtle);
    }
    .game-container #gameHeaderRow button.country-header-loc-btn,
    .game-container #gameHeaderRow button.country-header-loc-btn:hover:not(:disabled) {
      background: transparent;
      border: none;
      box-shadow: none;
      color: var(--text-subtle);
    }
    .country-header-loc-btn:hover {
      background: transparent;
      text-decoration: underline;
      color: var(--text-subtle);
    }
    .country-header-loc-btn:focus-visible {
      outline: 1px dotted var(--text-subtle);
      outline-offset: 2px;
    }
    body.theme-bw .country-header-loc-btn,
    body.theme-bw .country-header-loc-btn:hover:not(:disabled),
    body.theme-bw .game-container #gameHeaderRow button.country-header-loc-btn,
    body.theme-bw .game-container #gameHeaderRow button.country-header-loc-btn:hover:not(:disabled) {
      background: transparent;
      border: none;
      box-shadow: none;
    }
    .squad-sector-strip {
      display: inline-flex; align-items: center; gap: 3px;
      margin-left: 6px; padding: 1px 6px; font-size: var(--text-sm); font-weight: 700;
      letter-spacing: 0.05em; font-family: var(--font-mono);
      background: var(--strip-bg); border-radius: var(--radius); vertical-align: middle;
    }
    .squad-sector-strip .sector-strip-cell { min-width: 0.85em; text-align: center; }
    .squad-sector-strip .sector-strip-center { font-weight: var(--weight-bold); }
    .squad-sector-strip .sector-strip-empty { color: var(--strip-empty); font-weight: var(--weight-normal); }
    .squad-sector-strip .sector-strip-enemy { color: var(--strip-enemy) !important; font-weight: var(--weight-bold); }
    .squad-sector-strip .sector-strip-friendly { color: var(--strip-friendly) !important; font-weight: var(--weight-bold); }
    .squad-moves { font-weight: bold; padding: 2px 0; background: transparent; border: none; }
    .market-price-box { padding: 10px 0; margin-bottom: 12px; font-size: var(--text-base); line-height: 1.8; }

    .qty-input {
      width: 70px; padding: 4px 6px; border: 1px solid var(--input-border);
      border-radius: var(--radius); background: var(--input-bg); color: var(--text);
      font-family: var(--font-mono); font-size: var(--text-sm);
      font-variant-numeric: tabular-nums lining-nums;
    }
    .qty-input--wide { max-width: 110px; font-size: var(--text-sm); }
    .qty-input--flex { flex: 1; font-size: var(--text-sm); }
    .barracks-train-btn {
      background: transparent; border: none; box-shadow: none;
      padding: 2px 6px; font-size: var(--text-md); color: var(--text-muted);
    }
    .barracks-train-btn:hover:not(:disabled) { background: var(--btn-ghost-hover-bg); color: var(--btn-ghost-hover-text); }
    body.theme-bw .barracks-train-btn {
      background: transparent; border: none; box-shadow: none; font-weight: inherit;
    }
    body.theme-bw .barracks-train-btn:hover:not(:disabled) {
      background: var(--btn-ghost-hover-bg); color: var(--btn-ghost-hover-text);
    }

    .season-badge { display: inline-block; padding: 2px 8px; border-radius: var(--radius-pill); font-size: var(--text-base); font-weight: 600; margin-left: 8px; }
    .season-summer { background: var(--season-summer-bg); color: var(--season-summer-text); }
    .season-winter { background: var(--season-winter-bg); color: var(--season-winter-text); }

    .siege-banner {
      display: flex; align-items: flex-start; gap: 8px;
      padding: 5px 10px 5px 8px; margin: 0 0 8px 0;
      font-size: var(--text-base); line-height: 1.35;
      border-left: 2px solid var(--siege-accent);
      background: var(--siege-banner-bg); color: var(--text-muted);
    }
    .siege-banner-label {
      flex-shrink: 0; margin-top: 1px; font-size: var(--text-2xs); font-weight: 600;
      text-transform: uppercase; letter-spacing: 0.45px; color: var(--siege-label);
      padding: 1px 5px; border-radius: 2px; background: var(--siege-label-bg);
    }
    .siege-banner-body { flex: 1; min-width: 0; }
    .siege-banner-title { font-weight: 500; color: var(--siege-title); font-size: var(--text-base); }
    .siege-banner-hint { font-size: var(--text-sm); color: var(--text-subtle); margin-top: 1px; }

    .rank-1 { background: #adb5bd; }
    .rank-2 { background: #6c757d; }
    .rank-3 { background: #fd7e14; }
    .rank-4 { background: #dc3545; }
    .tank-icon { width: 18px; height: 18px; object-fit: contain; vertical-align: middle; display: inline-block; }

    .tavern-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
    .tavern-question { padding: 5px 0; margin-bottom: 0; font-size: var(--text-sm); line-height: 1.45; border-bottom: 1px solid var(--tavern-divider); }
    .tavern-answer-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
    .tavern-reward { padding: 3px 0; font-size: var(--text-sm); margin-top: 3px; color: var(--reward-text); }
    .tavern-wrong { padding: 3px 0; font-size: var(--text-sm); margin-top: 3px; color: var(--wrong-text); }
    .tavern-scout { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
    .tavern-scout-hint { font-size: var(--text-sm); color: var(--text-subtle, var(--text-muted)); }
    .tavern-chat-log {
      max-height: 140px; overflow-y: auto; background: var(--chat-log-bg);
      border-radius: var(--radius-modal); padding: 6px 8px; margin-bottom: 6px;
      font-size: var(--text-sm); line-height: 1.4;
    }
    .tavern-chat-msg { margin-bottom: 4px; word-break: break-word; }
    .tavern-chat-time { color: var(--text-faint); font-size: var(--text-xs); }
    .tavern-chat-label { font-size: var(--text-md); font-weight: 600; color: var(--text-subtle); margin-bottom: 6px; letter-spacing: 0.35px; }
    .tavern-chat-empty { color: var(--text-subtle); font-size: var(--text-sm); }
    .tavern-chat-input-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
    .tavern-chat-dir { color: var(--text-subtle); font-size: var(--text-xs); }
    .tavern-chat-pending { opacity: 0.75; }
    .tavern-chat-msg--priv { background: color-mix(in srgb, var(--accent, #c9a227) 8%, transparent); }

    .feedback-panel {
      margin-top: 8px; padding: 10px 12px; background: var(--surface);
      border: 1px solid var(--border); border-radius: var(--radius);
      font-size: var(--text-base);
    }
    .feedback-panel__title { font-weight: 600; margin-bottom: 8px; color: var(--text-subtle); }
    .feedback-panel__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 8px; }
    .feedback-panel__cats label { font-size: var(--text-sm); margin-right: 8px; cursor: pointer; }
    .feedback-panel textarea {
      width: 100%; min-height: 72px; resize: vertical; box-sizing: border-box;
      font-family: inherit; font-size: var(--text-base); padding: 6px 8px;
      border: 1px solid var(--border); border-radius: var(--radius-modal);
    }
    .feedback-panel input[type="url"], .feedback-panel input[type="text"].feedback-url-input {
      width: 100%; box-sizing: border-box; font-size: var(--text-sm); padding: 5px 8px;
      border: 1px solid var(--border); border-radius: var(--radius-modal); margin-bottom: 8px;
    }
    .feedback-my-list, .feedback-inbox-list {
      max-height: 220px; overflow-y: auto; margin-top: 8px;
      background: var(--chat-log-bg); border-radius: var(--radius-modal); padding: 6px 8px;
    }
    .feedback-entry {
      padding: 6px 0; border-bottom: 1px solid var(--tavern-divider); word-break: break-word;
    }
    .feedback-entry:last-child { border-bottom: none; }
    .feedback-entry--unread { background: rgba(255, 200, 50, 0.08); margin: 0 -4px; padding: 6px 4px; border-radius: 4px; }
    .feedback-entry__meta { font-size: var(--text-xs); color: var(--text-faint); margin-bottom: 3px; }
    .feedback-entry__text { font-size: var(--text-sm); line-height: 1.4; }
    .feedback-entry__actions { margin-top: 5px; display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
    .feedback-entry__actions button { font-size: var(--text-xs); padding: 2px 6px; }
    .feedback-entry__reply { margin-top: 4px; font-size: var(--text-xs); color: var(--reward-text); }
    .feedback-unread-badge {
      display: inline-block; min-width: 16px; padding: 0 5px; margin-left: 4px;
      background: #c00; color: #fff; border-radius: 10px; font-size: var(--text-xs); font-weight: bold;
    }
    .feedback-filter-row select { font-size: var(--text-sm); padding: 3px 6px; }

    .text-muted { color: var(--text-subtle); }
    .text-danger { color: var(--danger); }
    .text-warning-hint { color: #cc8800; font-size: var(--text-base); }
    .ui-empty { padding: 10px; color: var(--text-subtle); font-size: var(--text-base); }
    .country-card {
      background: var(--surface-raised); border: 1px solid var(--border);
      padding: 12px; margin-bottom: 12px; border-radius: var(--radius);
      border-left: 4px solid var(--border-strong);
    }
    .country-card strong {
      color: var(--text-subtle);
    }
    .country-card-meta { font-size: var(--text-base); margin-top: 5px; }
    .country-card-actions { margin-top: 8px; display: flex; gap: 6px; }
    .btn-sm { font-size: var(--text-base); padding: 4px 8px; }
    .leaderboard-col { flex: 1; min-width: 150px; }
    .leaderboard-col ol {
      padding-left: 1.2em;
      color: var(--text-muted);
    }
    .leaderboard-col .leader-country-name {
      font-weight: 600;
      color: var(--text-subtle);
    }
    .p2p-table { width: 100%; border-collapse: collapse; font-size: var(--text-base); }
    .p2p-table thead tr { background: var(--surface); text-align: left; }
    .p2p-table th, .p2p-table td { padding: 4px 6px; }
    .p2p-table tbody tr { border-top: 1px solid var(--border); }
    .p2p-table .num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

@media (max-width: 960px) {
      #main { padding: 12px 14px; }
      h1 { font-size: var(--text-xl); }
      .game-container { flex-direction: column; }
      .game-right { width: 100%; }
      .log-container { height: min(400px, 50vh); }
      :root { --map-cell-w: 100px; }
      .leaders-grid { grid-template-columns: 1fr; gap: 20px; }
    }
    @media (max-width: 640px) {
      #main { padding: 10px 12px; }
      h1 { font-size: var(--text-lg); margin-bottom: 12px; }
      .modal-content, .modal-content--wide, .modal-content--lg, .modal-content--leaders {
        margin: 16px auto; padding: 16px;
        width: calc(100vw - 20px); max-width: none;
      }
      .world-map-container { margin: 12px 0; padding: 10px; }
      :root { --map-cell-w: clamp(72px, 26vw, 96px); }
      .leaderboard-col { min-width: 120px; }
      .leaders-grid { grid-template-columns: 1fr; }
    }
    .battle-calc-section {
      background: var(--surface-raised, #f9f9f9);
      border: 1px solid var(--border, #eee);
      border-radius: var(--radius, 4px);
      margin-bottom: 10px;
    }
    .battle-calc-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 10px 12px; cursor: pointer; user-select: none;
      font-weight: 600; font-size: var(--text-lg);
    }
    .battle-calc-body { padding: 0 12px 12px; font-size: var(--text-base); }
    .battle-calc-grid {
      display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
    }
    @media (max-width: 640px) { .battle-calc-grid { grid-template-columns: 1fr; } }
    .battle-calc-col {
      border: 1px solid var(--border, #e0e0e0);
      border-radius: var(--radius, 4px);
      padding: 8px; background: var(--surface, #fff);
    }
    .battle-calc-col h4 { margin: 0 0 8px; font-size: var(--text-md); font-weight: 600; }
    .battle-calc-row {
      display: flex; align-items: center; gap: 6px; margin-bottom: 5px; flex-wrap: wrap;
    }
    .battle-calc-row label { min-width: 52px; font-size: var(--text-sm); color: var(--text-muted, #666); }
    .battle-calc-row input.qty-input { width: 64px; }
    .battle-calc-row input.bc-str-input { width: 48px; }
    .battle-calc-art { font-size: var(--text-sm); margin: 4px 0; }
    .battle-calc-art label { display: inline-flex; align-items: center; gap: 4px; margin-right: 8px; }
    .battle-calc-art select { font-size: var(--text-sm); padding: 1px 2px; }
    .battle-calc-tools { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
    .battle-calc-result {
      margin-top: 10px; padding: 10px; border-radius: var(--radius, 4px);
      background: var(--accent-muted, #eef6fc); border: 1px solid var(--border, #cde);
      line-height: 1.55;
    }
    .battle-calc-result .bc-outcome-win { color: var(--success, #1a7f37); font-weight: 700; }
    .battle-calc-result .bc-outcome-loss { color: var(--danger, #c00); font-weight: 700; }
    .battle-calc-details { margin-top: 6px; font-size: var(--text-sm); color: var(--text-muted, #555); }

    .townhall-admin-panel {
      margin-top: 16px;
      padding: 12px;
      border: 2px solid var(--accent, #6b4fa0);
      border-radius: var(--radius, 6px);
      background: var(--surface-raised, #f5f0fa);
    }
    .townhall-admin-panel__header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      margin-bottom: 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid var(--border, #ddd);
    }
    .townhall-admin-panel__title {
      font-weight: 700;
      font-size: var(--text-lg);
    }
    .townhall-admin-panel__badge {
      font-size: var(--text-sm);
      color: var(--text-muted, #888);
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .townhall-admin-impersonate {
      margin-bottom: 10px;
      padding: 8px 10px;
      border: 1px solid #c90;
      border-radius: var(--radius, 4px);
      background: rgba(204, 153, 0, 0.08);
      font-size: var(--text-md);
    }
    .townhall-admin-block {
      margin-bottom: 10px;
      border: 1px solid var(--border, #e0e0e0);
      border-radius: var(--radius, 4px);
      background: var(--surface, #fff);
      overflow: hidden;
    }
    .townhall-admin-block:last-child { margin-bottom: 0; }
    .townhall-admin-block__title {
      padding: 8px 12px;
      font-weight: 600;
      font-size: var(--text-md);
      background: var(--surface-raised, #f9f9f9);
      border-bottom: 1px solid var(--border, #eee);
    }
    .townhall-admin-block__body {
      padding: 10px 12px;
      font-size: var(--text-base);
    }
    .townhall-admin-bot-list {
      margin-top: 8px;
      max-height: 180px;
      overflow: auto;
    }
    .townhall-admin-brain-status {
      font-size: var(--text-sm);
      color: var(--text-muted, #888);
    }
    .townhall-admin-brain-panel {
      margin-top: 8px;
      max-height: 480px;
      overflow: auto;
      font-size: var(--text-base);
    }
    #townhallAdminPanel .battle-calc-section {
      margin-bottom: 10px;
      border-color: var(--border, #e0e0e0);
      background: var(--surface, #fff);
    }

    .lobby-map-ico--siege .lobby-map-ico-siege {
      filter: drop-shadow(0 0 1px #fff4d0) drop-shadow(0 0 2px rgba(138, 28, 18, 0.45));
    }
