:root {
  color-scheme: light;
  --ink: #1c1109;
  --muted: #422f1d;
  --line: #b79a75;
  --paper: #f3e4c8;
  --panel: #fff8e8;
  --accent: #7a2617;
  --accent-2: #2f5d50;
  --asset-bg: url("/assets/graphic/background/bg-tile.jpg");
  --asset-panel: url("/assets/graphic/screen/content_bg.png");
  --asset-table: url("/assets/graphic/background/table.jpg");
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #d7c29b var(--asset-bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
}

body.theme-dark {
  color-scheme: dark;
  --ink: #eadfca;
  --muted: #bcae99;
  --line: #6f604f;
  --paper: #201a15;
  --panel: #2c251e;
  --accent: #a94b34;
  --accent-2: #6ea58f;
  background: #18130f;
}

body.theme-dark .topbar {
  background: #100c09;
  border-bottom-color: #6f604f;
}

body.theme-dark input,
body.theme-dark select,
body.theme-dark textarea {
  color: var(--ink);
  background: #18130f;
  border-color: #6f604f;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 20px;
  background: #3a2418 url("/assets/graphic/background/navi.png") repeat-x;
  border-bottom: 3px solid #8d6a43;
}

.brand,
.link-button {
  color: #f8e7bd;
  font-weight: 700;
  text-decoration: none;
}

.link-button {
  background: transparent;
  border: 0;
  cursor: pointer;
}

.page {
  width: min(1180px, calc(100vw - 24px));
  margin: 24px auto;
}

body.home-page {
  background: #c6ad7f url("/assets/graphic/background/main.jpg");
}

body.home-page .topbar {
  min-height: 31px;
  padding: 0 18px;
  background: #2b160b url("/assets/graphic/background/navi.png") repeat-x;
  border-bottom: 1px solid #6f4520;
  box-shadow: 0 2px 10px rgba(36, 18, 7, .45);
}

body.home-page .brand {
  color: #f4dfaa;
  font-size: 12px;
}

body.home-page .page {
  width: min(1040px, calc(100vw - 28px));
  margin-top: 20px;
}

body.game-page {
  background-color: #c9b58d;
  background-image:
    url("/assets/graphic/background/body-medieval-original-v1.png"),
    url("/assets/graphic/background/body.jpg");
  background-position: center top, center top;
  background-repeat: no-repeat, repeat;
  background-size: cover, auto;
  background-attachment: fixed, scroll;
  min-height: 100vh;
  padding-bottom: 24px;
}

body.game-page::before,
body.game-page::after {
  content: "";
  position: fixed;
  top: 38px;
  bottom: 18px;
  z-index: -1;
  width: max(0px, calc((100vw - 940px) / 2));
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(79, 49, 22, .08), rgba(255, 246, 213, 0)),
    url("/assets/graphic/background/body-medieval-original-v1.png") center top / cover fixed no-repeat;
}

body.game-page::before {
  left: 0;
  border-right: 1px solid rgba(90, 55, 25, .38);
  box-shadow: inset -14px 0 24px rgba(70, 42, 18, .16);
}

body.game-page::after {
  right: 0;
  border-left: 1px solid rgba(90, 55, 25, .38);
  box-shadow: inset 14px 0 24px rgba(70, 42, 18, .16);
  transform: scaleX(-1);
}

body.game-page .topbar {
  min-height: 35px;
  padding: 0 calc((100vw - min(920px, calc(100vw - 18px))) / 2);
  background: #5b120d url("/assets/graphic/background/navi.png") repeat-x;
  border-top: 1px solid #220905;
  border-bottom: 3px solid #3a1e0f;
  box-shadow: 0 2px 4px rgba(38, 19, 6, .48);
  gap: 7px;
}

body.game-page .brand,
body.game-page .link-button {
  color: #f8e3ac;
  font-size: 12px;
}

.game-main-nav {
  display: flex;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.game-main-nav a {
  min-height: 24px;
  padding: 5px 10px 4px;
  color: #ffe9b7;
  text-decoration: none;
  text-shadow: 0 1px #1c0905;
  background:
    linear-gradient(#7e2619, #4a100c),
    url("/assets/graphic/background/navi.png") repeat-x;
  border: 1px solid #1e0905;
  border-radius: 2px;
  box-shadow:
    0 0 0 1px rgba(205, 148, 82, .35) inset,
    0 1px 2px rgba(0, 0, 0, .32);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.game-main-nav a:hover {
  color: #fff4d0;
  background: linear-gradient(#9b3422, #5b150f);
}

body.game-page .page {
  width: min(920px, calc(100vw - 18px));
  margin-top: 8px;
  padding: 7px 8px 18px;
  background: #ead8aa url("/assets/graphic/background/content.jpg") repeat;
  border: 1px solid #6f4a24;
  box-shadow:
    0 0 0 2px rgba(255, 239, 190, .42) inset,
    0 2px 9px rgba(49, 28, 10, .42);
}

body.game-page .panel {
  border-color: #8b5d2c;
  border-radius: 0;
  background: #f2dfae url("/assets/graphic/background/content.jpg") repeat;
  box-shadow:
    0 0 0 1px rgba(255, 248, 215, .6) inset,
    0 1px 3px rgba(59, 34, 12, .24);
}

body.game-page .screen-panel {
  padding: 12px 14px;
}

body.game-page .panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 24px;
  margin: -4px -6px 8px;
  padding: 3px 7px;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #a4773c;
  color: #1d1005;
}

body.game-page .panel-title-row h2,
body.game-page .panel-title-row h3 {
  margin: 0;
  font-size: 15px;
}

body.game-page button,
body.game-page .button-link {
  min-height: 24px;
  padding: 4px 9px;
  border-radius: 2px;
  color: #fff3d0;
  background: linear-gradient(#8b552a, #4e2813);
  border-color: #331506;
  box-shadow:
    0 1px rgba(255, 231, 173, .35) inset,
    0 1px 1px rgba(42, 21, 6, .28);
  font-size: 12px;
}

body.game-page input,
body.game-page select,
body.game-page textarea {
  min-height: 22px;
  padding: 2px 4px;
  border-radius: 0;
  border-color: #9f7744;
  background: #fff7dd;
  font-size: 12px;
}

body.game-page .stats,
body.game-page .main-building-summary,
body.game-page .building-detail-summary,
body.game-page .smith-summary,
body.game-page .market-summary,
body.game-page .place-summary,
body.game-page .academy-capacity-box,
body.game-page .merchant-capacity-box,
body.game-page .message-summary,
body.game-page .reports-summary,
body.game-page .tribe-summary,
body.game-page .player-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 0;
  margin: 6px 0 9px;
  background: #ead2a0 url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #b58a50;
}

body.game-page .stats div,
body.game-page .main-building-summary div,
body.game-page .building-detail-summary div,
body.game-page .smith-summary div,
body.game-page .market-summary div,
body.game-page .place-summary div,
body.game-page .message-summary div,
body.game-page .reports-summary div,
body.game-page .tribe-summary div,
body.game-page .player-stat-grid div,
body.game-page .academy-capacity-box > div,
body.game-page .merchant-capacity-box > div {
  display: grid;
  gap: 1px;
  min-height: 34px;
  padding: 4px 7px;
  background: transparent;
  border: 0;
  border-right: 1px solid rgba(132, 87, 38, .35);
  border-bottom: 1px solid rgba(222, 194, 139, .75);
  box-shadow: none;
}

body.game-page .stats strong,
body.game-page .main-building-summary strong,
body.game-page .building-detail-summary strong,
body.game-page .smith-summary strong,
body.game-page .market-summary strong,
body.game-page .place-summary strong,
body.game-page .message-summary strong,
body.game-page .reports-summary strong,
body.game-page .tribe-summary strong,
body.game-page .player-stat-grid strong {
  color: #221306;
  font-size: 16px;
  line-height: 1.1;
}

body.game-page .stats span,
body.game-page .main-building-summary span,
body.game-page .building-detail-summary span,
body.game-page .smith-summary span,
body.game-page .market-summary span,
body.game-page .place-summary span,
body.game-page .message-summary span,
body.game-page .reports-summary span,
body.game-page .tribe-summary span,
body.game-page .player-stat-grid span {
  color: #42280e;
  font-weight: 500;
  font-size: 11px;
}

.game-footer {
  position: fixed;
  right: 50%;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(920px, calc(100vw - 18px));
  min-height: 20px;
  padding: 2px 8px;
  color: #5e3516;
  background: #d8bc79 url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #7c5428;
  border-bottom: 0;
  box-shadow: 0 -1px 3px rgba(48, 27, 8, .25);
  transform: translateX(50%);
  font-size: 12px;
  line-height: 1.1;
}

.game-footer span {
  padding-right: 4px;
  font-weight: 700;
}

.game-footer a,
.game-footer .link-button {
  color: #6d330a;
  font-size: 12px;
  font-weight: 700;
}

.game-footer a::before {
  content: "-";
  margin-right: 8px;
  color: #7c5428;
}

.game-footer form {
  margin: 0;
}

.game-footer .link-button {
  padding: 0;
  min-height: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.layout-context-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 27px;
  margin-bottom: 7px;
  background: #d8bc79 url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #9b6b34;
  box-shadow: 0 0 0 1px rgba(255, 238, 188, .48) inset;
  font-size: 12px;
}

.layout-village-link {
  min-width: 0;
  padding: 4px 8px;
  border-right: 1px solid rgba(126, 83, 38, .55);
  font-weight: 700;
}

.layout-village-link a {
  color: #5b2c08;
  text-decoration: none;
}

.layout-village-link a::before {
  content: "\25C6";
  margin-right: 5px;
  color: #7b4b19;
}

.layout-resource-strip {
  display: flex;
  align-items: stretch;
}

.layout-resource-strip span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 25px;
  padding: 3px 7px;
  border-left: 1px solid rgba(255, 240, 197, .45);
  border-right: 1px solid rgba(126, 83, 38, .45);
  color: #2d1908;
  white-space: nowrap;
}

.layout-resource-strip img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.home-classic-shell {
  max-width: 1040px;
  margin: 0 auto;
}

.home-main-frame {
  border: 1px solid #7e5128;
  background: #f2e2bd url("/assets/graphic/background/content.jpg");
  box-shadow: 0 2px 7px rgba(55, 32, 12, .22);
}

.home-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  color: #f7e8bd;
  background: #5b351a url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #7e5128;
  font-size: 12px;
}

.home-title-bar span {
  color: #ead2a5;
  font-weight: 700;
}

.home-front-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 286px;
  gap: 12px;
  padding: 12px;
}

.home-news-panel,
.home-login-panel {
  border: 1px solid #b79561;
  background: #fff4d8 url("/assets/graphic/screen/content_bg.png");
}

.home-news-panel {
  min-height: 360px;
  padding: 14px;
}

.home-news-panel h1 {
  margin-bottom: 8px;
  color: #2d1909;
  font-size: 22px;
}

.home-lead {
  margin-bottom: 14px;
  color: #4e3319;
  font-weight: 700;
}

.home-world-table {
  margin: 0 0 12px;
}

.home-world-table th,
.home-world-table td {
  padding: 6px 8px;
  font-size: 12px;
}

.home-world-table strong,
.home-world-table small {
  display: block;
}

.home-world-table small {
  margin-top: 2px;
  color: #765b39;
}

.home-world-open {
  display: inline-flex;
  padding: 2px 6px;
  color: #f7ffe9;
  background: #537331;
  border: 1px solid #2f4c18;
  font-weight: 700;
}

.home-import-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.home-import-stats div {
  padding: 8px 9px;
  background: #f5e4bd url("/assets/graphic/background/table.jpg");
  border: 1px solid #c6a06a;
}

.home-import-stats dt {
  color: #6a4c2b;
  font-size: 11px;
  font-weight: 700;
}

.home-import-stats dd {
  margin: 2px 0 0;
  color: #2d1909;
  font-size: 20px;
  font-weight: 700;
}

.home-login-panel {
  padding: 12px 14px;
}

.home-login-panel h2 {
  margin: 0 -6px 10px;
  padding: 5px 7px;
  color: #2d1909;
  background: #d4b175 url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #a77c43;
  font-size: 16px;
}

.home-login-panel h2:not(:first-child) {
  margin-top: 14px;
}

.home-login-panel label {
  gap: 4px;
  margin-bottom: 8px;
  color: #2d1909;
  font-size: 12px;
}

.home-login-panel input,
.home-login-panel select {
  height: 28px;
  padding: 4px 6px;
  border-radius: 0;
  background: #fffdf4;
}

.home-login-panel button {
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 0;
  background: linear-gradient(#9b3a25, #6e1d12);
  font-size: 12px;
}

.home-winner-history {
  max-width: 1040px;
  margin: 12px auto 0;
  border-radius: 0;
}

.login-shell {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: stretch;
}

.intro,
.panel,
.world-grid article,
.village-head {
  background: var(--panel) var(--asset-panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  box-shadow: 0 1px 0 rgba(255,255,255,.45) inset;
}

.intro,
.panel {
  padding: 18px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0 0;
}

.stats div {
  border: 1px solid #d0b48d;
  background: #f9edcf;
  padding: 10px;
  border-radius: 4px;
}

.stats dt {
  color: var(--muted);
  font-size: 12px;
}

.stats dd {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 700;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  font-weight: 700;
}

hr {
  border: 0;
  border-top: 1px solid #d0b48d;
  margin: 18px 0;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #a88760;
  border-radius: 4px;
  padding: 9px 10px;
  font: inherit;
  background: #fffdf6;
}

button {
  border: 1px solid #5b1b10;
  border-radius: 4px;
  padding: 9px 12px;
  color: white;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #5b1b10;
  border-radius: 4px;
  padding: 9px 12px;
  color: white;
  background: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

td form {
  margin: 0;
}

.inline-form {
  display: flex;
  gap: 6px;
  align-items: center;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.amount-input {
  width: 74px;
  padding: 8px;
}

.command-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.unit-command-grid {
  grid-template-columns: repeat(5, minmax(110px, 1fr));
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.building-screen-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #d0b48d;
}

body.game-page .building-screen-head {
  align-items: flex-start;
  min-height: 92px;
  margin: 4px 0 8px;
  padding: 12px 12px 10px;
  border: 0;
}

.building-screen-head img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

body.game-page .building-screen-head > img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.building-screen-head h2 {
  margin: 0 0 3px;
}

body.game-page .building-screen-head h2 {
  margin-top: 6px;
  color: #111;
  font-size: 22px;
}

.building-screen-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

body.game-page .building-screen-head p {
  max-width: 680px;
  color: #221306;
  font-size: 13px;
  line-height: 1.25;
}

.building-action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
  padding: 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.building-action-row div {
  display: grid;
  gap: 3px;
}

.building-action-row span {
  color: var(--muted);
  font-size: 12px;
}

body.game-page .building-action-row {
  margin: 7px 0;
  padding: 5px 7px;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
  border-color: #b58a50;
}

body.game-page .building-action-row strong {
  color: #221306;
  font-size: 13px;
}

body.game-page .building-action-row span {
  color: #5f4324;
}

.building-requirement-table {
  margin: 10px 0;
}

.state-ok,
.state-bad {
  display: inline-flex;
  min-width: 68px;
  justify-content: center;
  padding: 2px 6px;
  border: 1px solid rgba(87, 63, 36, .35);
  font-size: 11px;
  font-weight: 700;
}

.state-ok {
  color: #27491f;
  background: #d7e5d8;
}

.state-bad {
  color: #7c2116;
  background: #ead0b5;
}

.building-requirement-inline {
  display: block;
  max-width: 220px;
  margin-top: 3px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.place-summary div,
.place-command-box {
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.place-summary div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

.place-summary strong {
  font-size: 18px;
}

.place-summary span {
  color: var(--muted);
  font-size: 12px;
}

.place-summary .watchtower-summary {
  background: rgba(52, 82, 32, .12);
  border-color: #8b9c55;
}

.place-summary .watchtower-summary span,
.command-head-stats .watchtower-stat,
.command-watchtower-tabs a,
.command-watchtower-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.place-summary .watchtower-summary img,
.command-head-stats .watchtower-stat img,
.command-watchtower-tabs img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.place-watchtower-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 6px 8px;
  color: #2d210c;
  background: #e8d4a4;
  border: 1px solid #7b8f43;
  box-shadow: 0 1px 0 rgba(255, 246, 206, .6) inset;
}

.place-watchtower-notice > img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.place-watchtower-notice div {
  display: grid;
  gap: 1px;
}

.place-watchtower-notice span {
  color: #5e4b20;
  font-size: 12px;
}

.place-watchtower-notice a {
  color: #304f19;
  font-weight: 700;
}

.place-command-layout {
  display: grid;
  grid-template-columns: minmax(220px, .8fr) minmax(0, 1.2fr);
  gap: 10px;
  margin-bottom: 12px;
}

.place-command-box {
  padding: 10px;
}

.place-target-grid {
  grid-template-columns: repeat(3, minmax(90px, 1fr));
}

.place-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.place-unit-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 8px;
}

.place-unit-presets button {
  padding: 5px 7px;
}

.place-unit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  gap: 6px;
  align-items: center;
  margin: 0;
  padding: 5px;
  background: rgba(255, 253, 246, .66);
  border: 1px solid rgba(160, 122, 77, .42);
  font-size: 12px;
}

.place-unit-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.place-unit-row img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.place-unit-row small {
  color: var(--muted);
}

.place-command-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.place-command-preview span {
  padding: 4px 7px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .42);
  color: #4b2e13;
  font-size: 12px;
  font-weight: 700;
}

.command-confirm-shell {
  max-width: 980px;
  margin: 0 auto;
}

.command-confirm-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.command-confirm-summary div {
  padding: 8px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .42);
}

.command-confirm-summary strong,
.command-confirm-summary span {
  display: block;
}

.command-confirm-summary span {
  margin-top: 2px;
  color: #6f5432;
  font-size: 12px;
  text-transform: uppercase;
}

.command-confirm-warnings {
  display: grid;
  gap: 6px;
  margin: 10px 0 12px;
}

.command-confirm-warning {
  margin: 0;
  padding: 7px 9px;
  border: 1px solid rgba(160, 122, 77, .48);
  background: rgba(255, 253, 246, .76);
  color: #4b2e13;
  font-weight: 700;
}

.command-confirm-warning.info {
  border-color: rgba(83, 123, 60, .55);
  background: rgba(231, 242, 218, .82);
}

.command-confirm-warning.warning {
  border-color: rgba(179, 129, 36, .58);
  background: rgba(255, 238, 188, .82);
}

.command-confirm-warning.danger {
  border-color: rgba(151, 58, 45, .62);
  background: rgba(246, 210, 199, .84);
}

.command-simulation {
  margin: 12px 0;
  padding: 10px;
  background: rgba(244, 231, 205, .62);
  border: 1px solid rgba(160, 122, 77, .42);
}

.command-simulation h3 {
  margin: 0 0 8px;
}

.command-simulation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 7px;
}

.command-simulation-grid div {
  padding: 7px;
  background: rgba(255, 253, 246, .78);
  border: 1px solid rgba(160, 122, 77, .34);
}

.command-simulation-grid strong,
.command-simulation-grid span {
  display: block;
}

.command-simulation-grid span {
  margin-top: 2px;
  color: #6f5432;
  font-size: 11px;
  text-transform: uppercase;
}

.simulator-form {
  display: grid;
  gap: 10px;
}

.simulator-settings {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.simulator-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.simulator-presets button {
  padding: 5px 7px;
}

.simulator-settings label {
  display: inline-grid;
  gap: 3px;
  min-width: 110px;
  color: #5a3a19;
  font-weight: 700;
}

.simulator-settings input,
.simulator-settings select,
.simulator-table input {
  width: 82px;
}

.simulator-settings select {
  width: 142px;
}

.simulator-result {
  margin-top: 12px;
}

.command-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}

.place-unit-summary-table {
  margin-top: 10px;
}

.place-unit-summary-table td {
  vertical-align: middle;
}

.place-unit-summary-table .asset-label {
  gap: 4px;
}

.place-unit-summary-table .asset-label img {
  width: 18px;
  height: 18px;
}

.place-unit-empty td {
  color: #756554;
  background: rgba(239, 224, 192, .46);
}

.place-unit-available td:first-child,
.place-unit-available td:nth-child(2) {
  font-weight: 700;
}

.unit-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.unit-chip-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 5px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .42);
  white-space: nowrap;
}

.unit-chip-row img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.place-table button {
  padding: 5px 8px;
}

.command-main-row.command-direction-saida > td {
  background: rgba(255, 246, 224, .74);
}

.command-main-row.command-direction-entrada > td {
  background: rgba(246, 222, 215, .76);
}

.command-main-row.command-direction-regresso > td {
  background: rgba(226, 238, 212, .76);
}

.command-detail-row td {
  padding-top: 3px;
  padding-bottom: 8px;
  background: rgba(238, 221, 184, .35);
  color: #5f4526;
  font-size: 12px;
}

.command-detail-row span,
.support-detail-row span {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 2px 5px;
  background: rgba(255, 253, 246, .7);
  border: 1px solid rgba(160, 122, 77, .34);
}

.place-command-details {
  display: block;
}

.place-command-details summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  list-style-position: inside;
}

.place-command-details summary strong {
  margin-right: 4px;
  color: #3f260f;
}

.place-command-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.place-command-detail-grid dl {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 3px 6px;
  margin: 0;
  padding: 7px;
  background: rgba(255, 253, 246, .62);
  border: 1px solid rgba(160, 122, 77, .34);
}

.place-command-detail-grid dt {
  color: #7a5b32;
  font-weight: 700;
}

.place-command-detail-grid dd {
  margin: 0;
  min-width: 0;
}

.place-command-detail-grid a {
  color: #5f3514;
  font-weight: 700;
}

.support-detail-row td {
  padding-top: 3px;
  padding-bottom: 8px;
  background: rgba(238, 221, 184, .28);
  color: #5f4526;
  font-size: 12px;
}

.command-summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.command-summary-tags span {
  display: inline-block;
  padding: 2px 5px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .34);
  color: #5f4526;
  font-size: 12px;
  white-space: nowrap;
}

.command-type-pill,
.command-direction-pill,
.command-time-box {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 6px;
  border: 1px solid rgba(87, 63, 36, .35);
  background: #f5e4bd;
  color: #3f260f;
  font-weight: 700;
  white-space: nowrap;
}

.command-type-pill img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.command-type-attack {
  background: #ead0b5;
  color: #6c2718;
}

.command-type-support,
.command-type-support_return {
  background: #d7e5d8;
  color: #27491f;
}

.command-type-transport {
  background: #e2d8c5;
}

.command-direction-pill {
  background: rgba(255, 253, 246, .78);
}

.command-time-box {
  display: inline-grid;
  gap: 1px;
  min-width: 108px;
}

.command-time-box small {
  color: var(--muted);
  font-weight: 400;
}

.command-label-form {
  gap: 4px;
  white-space: nowrap;
}

.command-label-form input[type="text"] {
  width: 118px;
  min-width: 0;
  padding: 5px 6px;
}

.compact-command-label-form {
  margin-top: 4px;
}

.compact-command-label-form input[type="text"] {
  width: 112px;
}

.compact-command-label-form button {
  padding: 4px 7px;
}

.support-return-form {
  display: grid;
  gap: 5px;
  justify-items: start;
}

.support-return-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-width: 260px;
}

.support-return-grid label {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 4px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .34);
}

.support-return-grid img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.support-return-grid input {
  width: 44px;
  min-width: 0;
  padding: 3px 4px;
}

.command-group-row td {
  padding: 7px 9px;
  background: linear-gradient(#c8a766, #a67c3a);
  color: #2b1a08;
  font-weight: 700;
  border-color: #8b672f;
}

.map-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.admin-log-filter {
  display: grid;
  grid-template-columns: repeat(7, minmax(92px, 1fr));
  gap: 8px;
  align-items: end;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid #c59c68;
  background: rgba(255, 253, 246, .46);
}

.admin-log-filter label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
}

.admin-log-filter input,
.admin-log-filter select {
  min-width: 0;
}

.admin-stats-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.admin-stats-panels h3 {
  margin: 0 0 6px;
  font-size: 14px;
}

.button-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #7b4f22;
  background: linear-gradient(#d7b779, #9d6b32);
  color: #fff9df;
  font-weight: 700;
  text-decoration: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}

.maintenance-card {
  display: grid;
  gap: 8px;
  align-content: start;
  padding: 10px;
  border: 1px solid #d0b48d;
  background: rgba(255, 253, 246, .54);
}

.maintenance-card h3 {
  margin: 0;
}

.danger-form {
  border: 1px solid #9b3326;
  background: rgba(117, 33, 22, .08);
  padding: 10px;
}

.danger-form button {
  border-color: #7a241b;
  background: linear-gradient(#c16446, #842f23);
}

.maintenance-notice {
  max-width: 720px;
}

.winner-history {
  margin-top: 14px;
}

.report-world-section {
  border-color: #b68a50;
  background: rgba(247, 231, 191, .62);
}

.tw-world-objective {
  display: grid;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid #b68a50;
  background: #f7e7bf var(--asset-panel);
  color: #3a2410;
}

.tw-world-objective strong {
  display: block;
  margin-bottom: 2px;
}

.objective-meter {
  height: 11px;
  border: 1px solid #8c6732;
  background: rgba(255, 253, 246, .75);
  overflow: hidden;
}

.objective-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(#78a650, #456e2f);
}

.map-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
  padding: 7px;
  border: 1px solid #c59c68;
  background: rgba(255, 253, 246, .42);
}

.map-filter-strip a {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 4px 7px;
  border: 1px solid rgba(132, 94, 50, .45);
  color: #3f2710;
  background: rgba(255, 248, 220, .75);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.map-filter-strip a.active {
  color: #f8edd0;
  border-color: #5f3a19;
  background: linear-gradient(#7f5426, #543214);
}

.map-filter-strip span {
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 9px;
  color: #3a2510;
  background: rgba(255, 255, 255, .72);
  text-align: center;
}

.map-filter-strip a.active span {
  color: #2b1b0d;
}

.tw-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 8px;
  align-items: start;
}

.tw-overview-main {
  min-width: 0;
}

.tw-overview-main .button-row {
  justify-content: flex-end;
  margin-bottom: 5px;
}

.tw-overview-sidebar {
  display: grid;
  gap: 8px;
}

.tw-overview-sidebar section {
  background: #f3dfad url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #8e622f;
  box-shadow: 0 1px rgba(255, 249, 223, .65) inset;
}

.tw-overview-sidebar h3 {
  margin: 0;
  padding: 5px 7px;
  color: #2f1908;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #8e622f;
  font-size: 13px;
  font-style: italic;
}

.tw-overview-sidebar p {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 4px 7px;
  border-bottom: 1px solid rgba(142, 98, 47, .38);
  color: #2f1908;
  font-size: 12px;
  line-height: 1.25;
}

.tw-overview-sidebar img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  flex: 0 0 auto;
}

.tw-overview-sidebar a {
  display: block;
  padding: 4px 7px 6px;
  color: #7a2617;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.tw-overview-sidebar a:hover {
  text-decoration: underline;
}

.tw-sidebar-muted {
  color: #755f42;
}

.village-visual {
  position: relative;
  width: min(100%, 600px);
  aspect-ratio: 600 / 450;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid #8a6a43;
  background: #6f8f5a;
}

.village-visual-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

.visual-building {
  position: absolute;
  display: block;
  z-index: 2;
  text-decoration: none;
}

.visual-building img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, .35));
}

.visual-building span {
  position: absolute;
  left: var(--label-x, 50%);
  top: var(--label-y, 8%);
  min-width: 22px;
  padding: 2px 5px;
  color: #f5f7e6;
  background: linear-gradient(#698a45, #3e602c);
  border: 1px solid #2b461f;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .45) inset, 0 1px 2px rgba(0, 0, 0, .45);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transform: translateX(-50%);
}

.visual-building:hover img {
  filter: drop-shadow(0 0 5px rgba(255, 239, 180, .95));
}

.village-visual.calibration-active {
  overflow: visible;
  margin-bottom: 14px;
}

.village-visual.calibration-active .visual-building {
  cursor: move;
  outline: 1px dashed rgba(255, 245, 160, .85);
  background: rgba(255, 245, 160, .08);
}

.village-visual.calibration-active .visual-building[data-level="0"] img {
  opacity: .62;
  filter: grayscale(.35) drop-shadow(1px 2px 1px rgba(0, 0, 0, .35));
}

.village-visual.calibration-active .visual-building.selected {
  outline: 2px solid #f1d26b;
  box-shadow: 0 0 0 2px rgba(75, 45, 15, .45);
}

.incoming-intel {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 20px;
  padding: 2px 5px;
  border: 1px solid #9b7c4e;
  background: #f3e3b8;
  color: #4d3418;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.incoming-intel img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.watchtower-eye-icon {
  position: relative;
  display: inline-block;
  width: 16px;
  height: 10px;
  flex: 0 0 16px;
  border: 1px solid #4c371e;
  border-radius: 50% 0 50% 0;
  background: #f8ecc8;
  transform: rotate(-45deg);
}

.watchtower-eye-icon::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 2px;
  width: 4px;
  height: 4px;
  border: 1px solid #4c371e;
  border-radius: 50%;
  background: #6f8b3a;
}

.incoming-intel .incoming-size-icon {
  width: 14px;
  height: 14px;
}

.incoming-intel strong {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.incoming-intel strong .incoming-noble-icon {
  width: 16px;
  height: 16px;
}

.incoming-intel-unknown {
  border-color: #a16c62;
  background: #ead4cc;
  color: #6f211a;
}

.incoming-intel-pending {
  border-color: #8b7446;
  background: #eee2bd;
  color: #574526;
}

.incoming-intel-small {
  border-color: #829658;
  background: #e0e8c5;
}

.incoming-intel-medium {
  border-color: #ad8b35;
  background: #f1df9e;
}

.incoming-intel-large {
  border-color: #a65645;
  background: #e9c1b4;
}

.incoming-intel strong {
  padding-left: 4px;
  border-left: 1px solid currentColor;
  color: #7b1710;
}

.visual-calibration-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
  padding: 8px;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #b8894f;
}

.visual-calibration-options label {
  display: grid;
  gap: 3px;
  font-weight: 700;
}

.visual-calibrator {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(6, minmax(80px, .7fr)) auto;
  gap: 8px;
  align-items: end;
  margin-top: 12px;
}

.visual-calibrator label {
  font-weight: 700;
}

.visual-calibrator input,
.visual-calibrator select,
.visual-calibrator textarea {
  width: 100%;
}

.visual-calibrator textarea {
  grid-column: 1 / -1;
  min-height: 170px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  resize: vertical;
}

.visual-calibrator .hint {
  grid-column: 1 / -1;
}

.preferences-form {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(140px, 180px) auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.map-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}

.map-nav a,
.map-nav strong {
  border: 1px solid #d0b48d;
  border-radius: 4px;
  padding: 7px 10px;
  background: #f9edcf;
  color: var(--ink);
  text-decoration: none;
}

.map-nav-classic {
  justify-content: center;
  margin: 4px 0 6px;
}

.map-nav-classic a,
.map-nav-classic strong {
  min-width: 32px;
  padding: 4px 8px;
  border-color: #8f6736;
  border-radius: 2px;
  background: linear-gradient(#f7e8bd, #cfa65d);
  box-shadow: inset 0 1px rgba(255, 255, 255, .45);
  text-align: center;
  font-weight: 700;
}

.map-classic-board {
  display: grid;
  grid-template-columns: minmax(520px, 1fr) 268px;
  gap: 7px;
  align-items: start;
  padding: 7px;
  border: 1px solid #8f6736;
  background: #d7ba76 var(--asset-table);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 210, .55),
    0 1px 2px rgba(74, 45, 18, .28);
}

.map-main-pane {
  min-width: 0;
}

.map-side-pane {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.map-classic-board .map-grid {
  overflow: hidden;
}

.map-context-details {
  margin-top: 5px;
  border-top: 1px solid rgba(143, 99, 44, .55);
}

.map-context-details > summary {
  padding: 5px 3px;
  color: #4c2d12;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.map-context-details[open] > summary {
  margin-bottom: 4px;
  background: rgba(220, 181, 111, .24);
}

.map-classic-board.dragging {
  cursor: grabbing;
}

.map-classic-board.is-loading .map-main-pane {
  position: relative;
}

.map-classic-board.is-loading .map-main-pane::after {
  content: "A carregar mapa...";
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(93, 59, 23, .5);
  background: rgba(234, 215, 173, .72);
  color: #4b2d12;
  font-weight: 700;
  text-shadow: 0 1px 0 rgba(255, 244, 199, .8);
}

.map-tactical-row {
  display: grid;
  grid-template-columns: minmax(120px, 180px) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin: 10px 0;
}

body.game-page .map-tactical-row {
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 8px;
}

body.game-page .map-tactical-row .map-mini {
  order: 2;
}

body.game-page .map-tactical-row .map-context {
  order: 1;
}

.map-mini {
  display: grid;
  grid-template-columns: repeat(var(--map-size), minmax(8px, 1fr));
  gap: 2px;
  align-content: start;
  padding: 8px;
  border: 1px solid #b58a55;
  background: #ead7ad var(--asset-table);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.map-mini-cell {
  aspect-ratio: 1;
  min-width: 8px;
  border: 1px solid rgba(62, 38, 16, 0.25);
  background: #f5ead2;
}

.map-mini-cell.center {
  outline: 2px solid #2f1c0c;
  outline-offset: 1px;
}

.map-mini-cell.own,
.map-legend .own {
  background: #d7ecd1;
}

.map-mini-cell.ally,
.map-legend .ally {
  background: #d8f0ec;
}

.map-mini-cell.nap,
.map-legend .nap {
  background: #efe4f7;
}

.map-mini-cell.enemy,
.map-legend .enemy {
  background: #f5d7d1;
}

.map-mini-cell.player,
.map-legend .player {
  background: #d6e3f5;
}

.map-mini-cell.barbarian,
.map-legend .barbarian {
  background: #ead3b0;
}

.map-mini-cell.empty,
.map-legend .empty {
  background: #f5ead2;
}

.map-mini-cell.terrain-forest,
.map-legend .terrain-forest {
  background: #52773c;
}

.map-mini-cell.terrain-hill,
.map-legend .terrain-hill {
  background: #8d8163;
}

.map-mini-cell.terrain-clay,
.map-legend .terrain-clay {
  background: #b88450;
}

.map-mini-cell.terrain-field,
.map-legend .terrain-field {
  background: #d2bd67;
}

.map-mini-cell.outside {
  background: #d5c6a9;
}

.map-mini-cell.filtered-out {
  opacity: .24;
  filter: grayscale(.45);
}

.map-continent-mini {
  display: grid;
  gap: 6px;
  padding: 7px;
  border: 1px solid #b58a55;
  background: #ead7ad var(--asset-table);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
}

.map-continent-mini-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.map-continent-mini-canvas {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid #8f6736;
  background:
    linear-gradient(rgba(36, 79, 28, .25) 1px, transparent 1px),
    linear-gradient(90deg, rgba(36, 79, 28, .25) 1px, transparent 1px),
    #6f8d43;
  background-size: 10% 10%;
}

.map-continent-viewport {
  position: absolute;
  z-index: 3;
  border: 2px solid #f7e35c;
  background: rgba(247, 227, 92, .12);
  box-shadow: 0 0 0 1px rgba(53, 32, 11, .65);
}

.map-continent-point {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(35, 27, 15, .65);
  border-radius: 50%;
  box-shadow: 0 1px 1px rgba(0, 0, 0, .32);
}

.map-continent-point.own {
  background: #4f8b52;
}

.map-continent-point.ally {
  background: #2f7d72;
}

.map-continent-point.nap {
  background: #7c5a9b;
}

.map-continent-point.enemy {
  background: #9c4d3e;
}

.map-continent-point.player {
  background: #4a6f9c;
}

.map-continent-point.barbarian {
  background: #9d6f33;
}

.map-continent-point.has-bonus,
.map-continent-point.bonus-wood,
.map-continent-point.bonus-stone,
.map-continent-point.bonus-iron,
.map-continent-point.bonus-farm,
.map-continent-point.bonus-storage,
.map-continent-point.bonus-balanced {
  border-color: #f2d176;
  box-shadow:
    0 0 0 1px rgba(54, 32, 11, .75),
    0 0 0 3px rgba(231, 193, 106, .5);
}

.map-continent-center-form {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 4px;
  align-items: end;
}

.map-continent-center-form label {
  margin: 0;
  font-size: 11px;
}

.map-continent-center-form input {
  width: 100%;
  min-width: 0;
}

.map-context {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #d0b48d;
  background: #f9edcf var(--asset-table);
}

.map-popup-compact {
  gap: 6px;
  padding: 7px;
  border-color: #8f6736;
  background: #ead7ad var(--asset-table);
  font-size: 12px;
}

.map-popup-compact.is-floating {
  position: fixed;
  z-index: 60;
  max-height: min(520px, calc(100vh - 16px));
  overflow: auto;
  border: 2px solid #5d3b17;
  box-shadow:
    0 5px 14px rgba(42, 25, 10, .42),
    inset 0 0 0 1px rgba(255, 249, 214, .55);
}

.map-popup-compact.is-floating .map-note-form,
.map-popup-compact.is-floating .map-note-delete-form,
.map-popup-compact.is-floating .map-popup-fill {
  display: none;
}

.map-popup-compact.is-floating::before {
  content: "";
  position: absolute;
  top: 17px;
  width: 12px;
  height: 12px;
  background: #ead7ad var(--asset-table);
  transform: rotate(45deg);
}

.map-popup-compact.is-floating[data-side="right"]::before {
  left: -8px;
  border-left: 2px solid #5d3b17;
  border-bottom: 2px solid #5d3b17;
}

.map-popup-compact.is-floating[data-side="left"]::before {
  right: -8px;
  border-top: 2px solid #5d3b17;
  border-right: 2px solid #5d3b17;
}

.map-popup-title {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(143, 103, 54, .55);
}

.map-popup-title img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

.map-popup-title h3 {
  margin: 0;
  overflow: hidden;
  color: #2f1c0c;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-context .map-popup-title h3 {
  margin: 0;
  font-size: 14px;
}

.map-popup-title span {
  color: #6b5131;
  font-size: 11px;
  font-weight: 700;
}

.map-popup-facts {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 0;
  margin: 0;
  border: 1px solid rgba(143, 103, 54, .38);
  background: rgba(255, 248, 220, .38);
}

.map-popup-facts dt,
.map-popup-facts dd {
  min-height: 20px;
  padding: 3px 5px;
  border-bottom: 1px solid rgba(143, 103, 54, .25);
}

.map-popup-facts dt {
  color: #5d3b17;
  font-weight: 700;
}

.map-popup-facts dd {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-popup-facts dt:last-of-type,
.map-popup-facts dd:last-of-type {
  border-bottom: 0;
}

.map-popup-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.map-popup-actions a,
.map-popup-fill button {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 2px 5px;
  border: 1px solid #5f3517;
  border-radius: 2px;
  background: linear-gradient(#8d5a2f, #4f2611);
  color: #fff2ca;
  box-shadow: inset 0 1px rgba(255, 255, 255, .22);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-decoration: none;
}

.map-popup-actions a:hover,
.map-popup-fill button:hover {
  color: #fffbe6;
  filter: brightness(1.08);
}

.map-popup-actions img {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  object-fit: contain;
}

.map-popup-fill {
  display: grid;
}

.map-popup-fill button {
  justify-content: center;
  width: 100%;
}

.map-context h3 {
  margin: 0;
  font-size: 16px;
}

.map-context dl {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 4px 10px;
  margin: 0;
}

.map-context dt {
  color: var(--muted);
  font-weight: 700;
}

.map-context dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.map-context-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.map-context-actions .button-link {
  justify-content: center;
  text-align: center;
}

@media (max-width: 899px) {
  .map-popup-compact.is-floating {
    position: static;
    width: auto !important;
    max-height: none;
  }

  .map-popup-compact.is-floating::before {
    content: none;
  }

  .map-popup-compact.is-floating .map-note-form,
  .map-popup-compact.is-floating .map-note-delete-form,
  .map-popup-compact.is-floating .map-popup-fill {
    display: grid;
  }
}

.map-note-form,
.map-relic-management,
.map-note-delete-form {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.map-note-form textarea {
  min-height: 44px;
  resize: vertical;
}

.map-relic-management[hidden],
.map-relic-management form[hidden] {
  display: none;
}

.map-notes-panel {
  margin: 10px 0;
  padding: 9px 10px;
  border: 1px solid #c59c68;
  background: #f9edcf var(--asset-table);
}

.farm-assist-panel {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid #b58a55;
  background: #f4e3bd var(--asset-table);
}

.farm-assist-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.farm-assist-head h3 {
  margin: 0 0 3px;
}

.farm-assist-head p {
  margin: 0;
  color: var(--muted);
}

.farm-assist-filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 0 0 8px;
}

.farm-assist-filter-strip a {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 3px 7px;
  border: 1px solid #ad8958;
  background: rgba(255, 248, 220, .62);
  color: var(--ink);
  text-decoration: none;
}

.farm-assist-filter-strip a.active {
  border-color: #6d4a24;
  background: #d7b676;
  font-weight: 700;
}

.farm-assist-filter-strip span {
  color: #6b5131;
}

.farm-assist-table td:last-child {
  min-width: 140px;
}

.farm-preset-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid #987447;
  background: rgba(255, 248, 220, .76);
  color: #4a3218;
  font-weight: 700;
  white-space: nowrap;
}

.farm-preset-chip img,
.farm-report-badge img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.farm-report-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 6px;
  border: 1px solid #987447;
  background: rgba(255, 248, 220, .76);
  color: #4a3218;
  font-weight: 700;
  white-space: nowrap;
}

.farm-report-full {
  border-color: #4d8b39;
  color: #315c21;
}

.farm-report-partial {
  border-color: #bd8a2e;
  color: #6b4818;
}

.farm-report-win {
  border-color: #6f8d43;
  color: #3f5b21;
}

.farm-report-loss {
  border-color: #a35242;
  color: #7b291c;
}

.map-notes-panel h3 {
  margin: 0 0 8px;
}

.map-note-list {
  display: grid;
  gap: 6px;
}

.map-note-list a {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  color: var(--ink);
  text-decoration: none;
  border: 1px solid rgba(160, 122, 77, .45);
  background: rgba(255, 253, 246, .62);
}

.map-note-list span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-note-list small {
  color: var(--muted);
}

.political-map-panel {
  margin: 10px 0;
  border: 1px solid #b58a55;
  background: #ead7ad var(--asset-table);
}

.political-map-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 10px;
  border-bottom: 1px solid #c59c68;
}

.political-map-head h3,
.political-map-head p {
  margin: 0;
}

.political-map-head p {
  color: var(--muted);
  font-size: 12px;
}

.political-map-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.political-map-stats b {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 3px;
  border: 1px solid rgba(62, 38, 16, .35);
  vertical-align: -1px;
}

.political-map-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #c59c68;
  background: rgba(255, 253, 246, .35);
}

.political-map-filters label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  margin: 0;
  padding: 4px 7px;
  border: 1px solid rgba(160, 122, 77, .45);
  background: rgba(255, 253, 246, .65);
  font-size: 12px;
  font-weight: 700;
}

.political-map-filters input {
  width: auto;
}

.political-map {
  position: relative;
  aspect-ratio: 2.6 / 1;
  min-height: 180px;
  overflow: hidden;
  background:
    linear-gradient(rgba(87, 120, 62, .12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(87, 120, 62, .12) 1px, transparent 1px),
    #d7c18e;
  background-size: 10% 10%;
}

.political-map-point {
  position: absolute;
  z-index: 2;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(41, 28, 14, .65);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
}

.political-map-point.filtered-out {
  display: none;
}

.political-map-crosshair {
  position: absolute;
  z-index: 1;
  background: rgba(47, 28, 12, .35);
  pointer-events: none;
}

.political-map-crosshair.x {
  top: 0;
  bottom: 0;
  width: 1px;
}

.political-map-crosshair.y {
  left: 0;
  right: 0;
  height: 1px;
}

.political-map-point.own,
.political-map-stats .own {
  background: #4f8b52;
}

.political-map-point.ally,
.political-map-stats .ally {
  background: #2f7d72;
}

.political-map-point.nap,
.political-map-stats .nap {
  background: #7c5a9b;
}

.political-map-point.enemy,
.political-map-stats .enemy {
  background: #9c4d3e;
}

.political-map-point.player,
.political-map-stats .player {
  background: #4a6f9c;
}

.political-map-point.barbarian,
.political-map-stats .barbarian {
  background: #9d6f33;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(var(--map-size), minmax(64px, 1fr));
  gap: 2px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid #b58a55;
  background: #7f9f55 url("/assets/graphic/background/content.jpg");
}

body.game-page .map-grid {
  grid-template-columns: repeat(var(--map-size), minmax(0, 1fr));
  gap: 1px;
  padding: 5px;
  background: #2f4a1e;
}

.map-cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 64px;
  overflow: hidden;
  padding: 4px;
  border: 1px solid rgba(79, 63, 34, .65);
  color: var(--ink);
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 244, 184, .34) 0 8%, transparent 9%),
    radial-gradient(circle at 76% 72%, rgba(69, 122, 48, .24) 0 15%, transparent 16%),
    linear-gradient(135deg, #91ad63, #c7b56f 58%, #7fa04f);
  font-size: 11px;
  line-height: 1.1;
  box-shadow: inset 0 0 10px rgba(53, 75, 34, .28);
}

body.game-page .map-cell {
  min-width: 0;
  min-height: 38px;
  aspect-ratio: auto;
  padding: 2px;
  border-radius: 0;
  border-color: rgba(35, 76, 24, .9);
  font-size: 10px;
}

.map-cell.edge-north::after,
.map-cell.edge-south::after,
.map-cell.edge-west::after,
.map-cell.edge-east::after {
  position: absolute;
  z-index: 4;
  color: #f7e8bd;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 1px #1c2d12;
  pointer-events: none;
}

.map-cell.edge-north::after {
  content: attr(data-x);
  top: 2px;
  right: 3px;
}

.map-cell.edge-west::after {
  content: attr(data-y);
  left: 3px;
  bottom: 3px;
}

.map-cell.filtered-out {
  opacity: .32;
  filter: grayscale(.45) saturate(.65);
}

.map-cell.filtered-out:hover,
.map-cell.filtered-out.selected {
  opacity: .82;
  filter: none;
}

.map-cell span {
  display: block;
  overflow-wrap: anywhere;
}

.map-cell-terrain {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(35deg, transparent 0 42%, rgba(190, 164, 99, .34) 43% 49%, transparent 50%),
    radial-gradient(circle at 18% 78%, rgba(76, 111, 51, .34) 0 10%, transparent 11%);
  opacity: .72;
}

.map-cell-terrain-sprite {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: auto;
  opacity: .96;
}

.map-cell.terrain-forest {
  background:
    radial-gradient(circle at 18% 28%, rgba(27, 67, 30, .58) 0 13%, transparent 14%),
    radial-gradient(circle at 74% 58%, rgba(36, 89, 39, .5) 0 18%, transparent 19%),
    linear-gradient(135deg, #4f7a3d, #7f9f55 58%, #385d2f);
}

.map-cell.terrain-forest .map-cell-terrain {
  background:
    radial-gradient(circle at 30% 32%, rgba(14, 51, 24, .42) 0 10%, transparent 11%),
    radial-gradient(circle at 64% 74%, rgba(17, 69, 30, .38) 0 13%, transparent 14%);
}

.map-cell.terrain-hill {
  background:
    radial-gradient(ellipse at 36% 38%, rgba(224, 209, 151, .42) 0 20%, transparent 21%),
    linear-gradient(135deg, #83785c, #b5a06c 52%, #6c7650);
}

.map-cell.terrain-hill .map-cell-terrain {
  background:
    linear-gradient(28deg, transparent 0 34%, rgba(96, 84, 60, .34) 35% 40%, transparent 41% 100%),
    linear-gradient(146deg, transparent 0 48%, rgba(236, 218, 158, .28) 49% 55%, transparent 56%);
}

.map-cell.terrain-clay {
  background:
    radial-gradient(circle at 72% 28%, rgba(245, 218, 146, .45) 0 16%, transparent 17%),
    linear-gradient(135deg, #b9834f, #d2b56f 58%, #8b6f42);
}

.map-cell.terrain-clay .map-cell-terrain {
  background:
    radial-gradient(ellipse at 26% 75%, rgba(114, 73, 42, .36) 0 18%, transparent 19%),
    linear-gradient(32deg, transparent 0 52%, rgba(88, 63, 38, .24) 53% 58%, transparent 59%);
}

.map-cell.terrain-field {
  background:
    linear-gradient(90deg, rgba(121, 143, 54, .28) 0 12%, transparent 13% 25%, rgba(121, 143, 54, .25) 26% 39%, transparent 40%),
    linear-gradient(135deg, #c9b75d, #dfcf83 52%, #9cab55);
}

.map-cell.terrain-field .map-cell-terrain {
  background:
    repeating-linear-gradient(22deg, rgba(102, 92, 38, .18) 0 3px, transparent 3px 8px);
}

.map-cell.terrain-grass {
  background:
    radial-gradient(circle at 28% 24%, rgba(255, 244, 184, .34) 0 8%, transparent 9%),
    radial-gradient(circle at 76% 72%, rgba(69, 122, 48, .24) 0 15%, transparent 16%),
    linear-gradient(135deg, #91ad63, #c7b56f 58%, #7fa04f);
}

.map-cell::before {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid transparent;
  pointer-events: none;
}

.map-cell-icon {
  position: absolute;
  left: 50%;
  top: 48%;
  width: 42px;
  height: 42px;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .45));
}

.map-cell.point-band-medium .map-cell-icon {
  width: 48px;
  height: 48px;
}

.map-cell.point-band-large .map-cell-icon {
  width: 54px;
  height: 54px;
}

.map-cell-coords,
.map-cell-name {
  position: relative;
  z-index: 2;
  padding: 1px 3px;
  background: rgba(255, 248, 220, .78);
  border: 1px solid rgba(97, 68, 33, .38);
}

.map-cell-coords {
  float: left;
  font-weight: 700;
}

.map-cell-name {
  position: absolute;
  right: 3px;
  bottom: 3px;
  left: 3px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-cell.has-note .map-cell-coords {
  padding-right: 17px;
}

.map-cell.has-command {
  box-shadow:
    inset 0 0 10px rgba(53, 75, 34, .28),
    inset 0 0 0 2px rgba(255, 239, 145, .42);
}

.map-cell-note {
  position: absolute;
  z-index: 3;
  top: 5px;
  right: 5px;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(64, 37, 13, .7);
  background: #f7d45e;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

.map-cell-command {
  position: absolute;
  z-index: 5;
  top: 17px;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #2f1c0c;
  background: linear-gradient(#f8df91, #b78334);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .48);
}

.map-cell-command img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.map-cell-command b {
  position: absolute;
  right: -3px;
  bottom: -4px;
  min-width: 11px;
  padding: 0 2px;
  border: 1px solid #2f1c0c;
  color: #fff5d0;
  background: #7b1b12;
  font-size: 8px;
  line-height: 10px;
}

.map-cell.command-incoming_attack .map-cell-command {
  background: linear-gradient(#e6b5a5, #8e251b);
}

.map-cell.command-outgoing_attack .map-cell-command {
  background: linear-gradient(#f8d790, #9f5c1a);
}

.map-cell.command-incoming_support .map-cell-command,
.map-cell.command-outgoing_support .map-cell-command {
  background: linear-gradient(#cfe5ab, #5c842f);
}

.map-cell.command-transport .map-cell-command {
  background: linear-gradient(#e8d59a, #92723a);
}

.map-cell.command-returning .map-cell-command {
  background: linear-gradient(#d7d5d0, #6f6a63);
}

.map-cell.has-faith {
  box-shadow:
    inset 0 0 10px rgba(53, 75, 34, .28),
    inset 0 0 0 2px rgba(93, 74, 158, .38);
}

.map-cell.has-command.has-faith {
  box-shadow:
    inset 0 0 10px rgba(53, 75, 34, .28),
    inset 0 0 0 2px rgba(255, 239, 145, .42),
    inset 0 0 0 4px rgba(93, 74, 158, .22);
}

.map-cell.has-bonus {
  box-shadow:
    inset 0 0 10px rgba(53, 75, 34, .28),
    inset 0 0 0 2px rgba(214, 154, 45, .48);
}

.map-cell.has-watchtower {
  box-shadow:
    inset 0 0 10px rgba(53, 75, 34, .28),
    inset 0 0 0 2px rgba(68, 118, 150, .48);
}

.map-cell.has-command.has-bonus,
.map-cell.has-faith.has-bonus,
.map-cell.has-command.has-watchtower,
.map-cell.has-faith.has-watchtower,
.map-cell.has-bonus.has-watchtower {
  box-shadow:
    inset 0 0 10px rgba(53, 75, 34, .28),
    inset 0 0 0 2px rgba(255, 239, 145, .42),
    inset 0 0 0 4px rgba(68, 118, 150, .24);
}

.map-cell-faith {
  position: absolute;
  z-index: 5;
  left: 4px;
  bottom: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid #2f1c0c;
  background: linear-gradient(#f6efd0, #9a8fcb);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .48);
}

.map-cell-faith img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.map-cell-faith.faith-first_church {
  background: linear-gradient(#fff7c8, #b99b4b);
}

.map-cell-bonus {
  position: absolute;
  z-index: 5;
  left: 4px;
  top: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1px solid #2f1c0c;
  background: linear-gradient(#e7c16a, #81541e);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .48);
}

.map-cell-bonus img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.map-cell-watchtower {
  position: absolute;
  z-index: 6;
  right: 4px;
  bottom: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border: 1px solid #2f1c0c;
  background: linear-gradient(#d5edf5, #5c8195);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .48);
}

.map-cell-watchtower img {
  width: 13px;
  height: 13px;
  object-fit: contain;
}

.map-cell.selected {
  outline: 2px solid #2f1c0c;
  outline-offset: -2px;
}

.map-cell.own {
  border-color: #4f8b52;
}

.map-cell.current {
  outline: 2px solid #f7e35c;
  outline-offset: -3px;
}

.map-cell.own::before {
  border-color: rgba(79, 139, 82, .82);
}

.map-cell.ally {
  border-color: #2f7d72;
}

.map-cell.ally::before {
  border-color: rgba(47, 125, 114, .82);
}

.map-cell.nap {
  border-color: #7c5a9b;
}

.map-cell.nap::before {
  border-color: rgba(124, 90, 155, .82);
}

.map-cell.enemy {
  border-color: #9c4d3e;
}

.map-cell.enemy::before {
  border-color: rgba(156, 77, 62, .86);
}

.map-cell.player {
  border-color: #4a6f9c;
}

.map-cell.player::before {
  border-color: rgba(74, 111, 156, .82);
}

.map-cell.barbarian {
  border-color: #9d6f33;
}

.map-cell.barbarian::before {
  border-color: rgba(157, 111, 51, .82);
}

.map-cell.empty {
  border-color: #c8ad83;
  color: #7d6b55;
}

.map-cell.outside {
  background: #8f846f;
  border-color: #b7a485;
  color: #8a7b63;
  box-shadow: none;
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.map-legend b {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 4px;
  border: 1px solid #8d6a43;
  vertical-align: -2px;
}

.map-legend b.faith {
  background: #9a8fcb;
}

.hint,
.notice {
  color: var(--muted);
  font-size: 12px;
}

.split-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  gap: 8px;
  align-items: center;
  font-weight: 700;
}

.check-row input {
  width: auto;
}

.tribe-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.tribe-empty-head,
.tribe-box {
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.tribe-empty-head {
  display: grid;
  gap: 3px;
  margin-bottom: 12px;
  padding: 10px;
}

.tribe-empty-head span {
  color: var(--muted);
  font-size: 12px;
}

.tribe-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.tribe-summary div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.tribe-summary strong {
  font-size: 18px;
}

.tribe-summary span {
  color: var(--muted);
  font-size: 12px;
}

.tribe-action-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tribe-box {
  padding: 10px;
}

.tribe-box h3 {
  margin-bottom: 10px;
}

.tribe-table button {
  padding: 5px 8px;
}

.message-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

body.game-page .messages-classic-page .message-summary,
body.game-page .reports-classic-page .reports-summary {
  display: none;
}

.message-summary div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.message-summary strong {
  font-size: 18px;
}

.message-summary span {
  color: var(--muted);
  font-size: 12px;
}

.message-compose-grid {
  display: grid;
  grid-template-columns: minmax(160px, .8fr) minmax(220px, 1.2fr);
  gap: 10px;
}

body.game-page .message-compose-panel {
  display: none;
}

body.game-page .messages-classic-page.message-compose-active .message-compose-panel {
  display: block;
}

.message-tabs,
.message-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

body.game-page .message-tabs {
  gap: 0;
  margin: 0 0 6px;
  border: 1px solid #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

body.game-page .message-tabs .button-link {
  border: 0;
  border-right: 1px solid #d9bd84;
  box-shadow: none;
  color: #6f2417;
  background: transparent;
}

.message-toolbar {
  margin-bottom: 10px;
}

.message-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid #d0b48d;
  background: #f9edcf var(--asset-table);
}

body.game-page .message-search-form {
  justify-content: flex-end;
  margin: -34px 0 8px auto;
  padding: 0;
  border: 0;
  background: transparent;
}

body.game-page .message-search-form label {
  min-width: 210px;
}

body.game-page .message-search-form label {
  font-size: 0;
}

body.game-page .message-search-form input {
  font-size: 12px;
}

.message-search-form label {
  display: grid;
  gap: 2px;
  min-width: min(100%, 320px);
  margin: 0;
}

.message-box-pill,
.message-state-new,
.message-state-read {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(87, 63, 36, .35);
  background: #f5e4bd;
  color: #3f260f;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.message-state-new {
  background: #5d7f42;
  border-color: #34511f;
  color: #fff8d6;
}

.message-state-read {
  color: var(--muted);
}

.message-table button {
  padding: 5px 8px;
}

body.game-page .message-table th,
body.game-page .message-table td {
  vertical-align: middle;
}

body.game-page .message-table th:nth-child(2),
body.game-page .message-table td:nth-child(2),
body.game-page .message-table th:nth-child(4),
body.game-page .message-table td:nth-child(4),
body.game-page .message-table th:nth-child(6),
body.game-page .message-table td:nth-child(6),
body.game-page .message-table th:nth-child(7),
body.game-page .message-table td:nth-child(7) {
  display: none;
}

body.game-page .message-body-row {
  display: none;
}

.message-body-row td {
  padding: 8px 10px;
  background: rgba(255, 253, 246, .72);
  color: #4b2e13;
  line-height: 1.45;
}

.bbcode-content {
  display: grid;
  gap: 6px;
}

.bbcode-content a {
  color: #7a3d16;
  font-weight: 700;
}

.tribe-profile-summary {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  align-items: start;
}

.tribe-emblem {
  width: 82px;
  height: 96px;
  display: grid;
  place-items: center;
  color: #f8edca;
  background: linear-gradient(180deg, #8d2d23, #551912);
  border: 2px solid #3d2413;
  box-shadow: inset 0 0 0 4px rgba(255, 234, 169, .24), 0 2px 3px rgba(41, 24, 10, .28);
  clip-path: polygon(50% 0, 92% 12%, 86% 66%, 50% 100%, 14% 66%, 8% 12%);
}

.tribe-emblem span {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 44px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .3);
}

.tribe-emblem-blue {
  background: linear-gradient(180deg, #315e8e, #163758);
}

.tribe-emblem-green {
  background: linear-gradient(180deg, #4f7b34, #27491f);
}

.tribe-emblem-black {
  background: linear-gradient(180deg, #4b4036, #211915);
}

.tribe-emblem-gold {
  color: #3d2413;
  background: linear-gradient(180deg, #d5ae45, #916727);
}

.bbcode-quote,
.bbcode-code {
  margin: 4px 0;
  padding: 8px 10px;
  background: rgba(238, 221, 183, .72);
  border: 1px solid rgba(137, 99, 58, .42);
}

.bbcode-quote {
  border-left: 4px solid #8f6231;
  font-style: italic;
}

.bbcode-code {
  overflow: auto;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  white-space: pre-wrap;
}

.bbcode-player,
.bbcode-tribe,
.bbcode-coord {
  display: inline-flex;
  padding: 1px 5px;
  background: #f5e4bd;
  border: 1px solid rgba(87, 63, 36, .35);
  color: #3f260f;
  font-weight: 700;
}

.stack form {
  margin: 0;
}

.level {
  display: inline-block;
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
}

.notice {
  margin-bottom: 12px;
  padding: 10px;
  background: #fff3cd;
  border: 1px solid #d7bd75;
  border-radius: 4px;
}

.world-grid,
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

body.game-page .game-grid {
  margin-top: 0;
  gap: 8px;
}

.world-grid article {
  padding: 14px;
}

.village-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.tw-top {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(360px, 1.5fr);
  gap: 0;
  overflow: hidden;
  color: #f5e7c5;
  background: #3b2619 url("/assets/graphic/background/navi.png") repeat-x;
  border: 1px solid #6c4b2b;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 2px 3px rgba(60, 35, 15, .25);
}

body.game-page .tw-top {
  border-color: #3b1b0d;
  border-radius: 0;
  background-color: #4d160e;
}

.tw-village-title {
  padding: 7px 10px;
  border-right: 1px solid rgba(255, 235, 185, .18);
}

.tw-village-title h1 {
  margin: 0;
  color: #ffe7ad;
  font-size: 15px;
  line-height: 1.2;
}

.tw-village-title p {
  margin: 3px 0 0;
  color: #d6c197;
  font-size: 12px;
}

.tw-resbar {
  display: grid;
  grid-template-columns: repeat(5, minmax(86px, 1fr));
  gap: 0;
  align-items: stretch;
}

.tw-resbar span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 27px;
  padding: 4px 7px;
  color: #201408;
  background: #ead4a6 url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-left: 1px solid #9b7549;
  border-bottom: 1px solid #6c4b2b;
  font-weight: 700;
  font-size: 12px;
  white-space: nowrap;
}

.tw-resbar img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.tw-quicknav {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  min-height: 28px;
  background: #5c3c22;
  border-top: 1px solid rgba(255, 239, 190, .16);
}

.tw-quicknav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 9px;
  color: #f8e7bd;
  border-right: 1px solid rgba(255, 239, 190, .16);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.tw-quicknav img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex: 0 0 auto;
}

.tw-quicknav a:hover {
  color: #fff6d6;
  background: rgba(255, 242, 198, .08);
}

.tw-statusline {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  padding: 4px 8px;
  color: #e8d2a2;
  background: rgba(31, 18, 8, .44);
  border-top: 1px solid rgba(255, 239, 190, .12);
  font-size: 12px;
}

.tw-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 2px 7px;
  color: #ffeac1;
  background: rgba(255, 239, 190, .08);
  border: 1px solid rgba(255, 239, 190, .18);
  border-radius: 3px;
  font-weight: 700;
  text-decoration: none;
}

.tw-status-pill:hover {
  color: #fff7da;
  background: rgba(255, 239, 190, .16);
}

.tw-status-pill.danger {
  color: #fff4d4;
  background: #8b1f16;
  border-color: #c87a47;
  box-shadow: 0 0 0 1px rgba(255, 221, 139, .12) inset;
}

.tw-status-pill.watchtower {
  color: #e5f1d1;
  background: #365522;
  border-color: #7f9d54;
  box-shadow: 0 0 0 1px rgba(211, 231, 157, .16) inset;
}

.tw-command-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 11px;
  color: #fff3d5;
  background: #6e170f url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #9d4b24;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255, 236, 177, .22) inset, 0 2px 3px rgba(60, 35, 15, .2);
}

.tw-command-alert.watchtower {
  border-color: #5d7e32;
  box-shadow: 0 1px 0 rgba(229, 241, 177, .22) inset, 0 2px 4px rgba(39, 76, 18, .22);
}

.tw-command-alert img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.tw-command-alert div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tw-command-alert strong {
  color: #fff7d4;
}

.tw-command-alert span {
  color: #f2cf9c;
  font-size: 12px;
}

.tw-watchtower-detection {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #d7edb2;
  font-size: 11px;
  font-weight: 700;
}

.tw-watchtower-detection img {
  width: 15px;
  height: 15px;
}

.tw-command-alert a {
  margin-left: auto;
  color: #fff8d9;
  font-weight: 700;
  white-space: nowrap;
}

.tw-attack-groups {
  padding: 9px 10px;
  color: #fff3d5;
  background: #5f160f url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #9d4b24;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(255, 236, 177, .18) inset, 0 2px 3px rgba(60, 35, 15, .18);
}

.tw-attack-groups-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.tw-attack-groups-head span {
  color: #f2cf9c;
  font-size: 12px;
}

.tw-attack-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr) auto);
  gap: 6px;
  align-items: stretch;
}

.tw-attack-group-card,
.tw-attack-group-map {
  color: #fff7d4;
  background: rgba(255, 239, 194, .09);
  border: 1px solid rgba(255, 230, 166, .22);
  border-radius: 3px;
  text-decoration: none;
}

.tw-attack-group-card {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
}

.tw-attack-group-card span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-weight: 700;
}

.tw-attack-group-card img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.tw-attack-group-card small {
  color: #f2cf9c;
}

.tw-attack-group-card.watchtower {
  border-color: rgba(196, 225, 137, .55);
  box-shadow: 0 0 0 1px rgba(211, 231, 157, .16) inset;
}

.tw-attack-group-card em {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #d7edb2;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.tw-attack-group-card em img {
  width: 14px;
  height: 14px;
}

.tw-attack-group-map {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-weight: 700;
}

.tw-village-jump {
  display: inline-flex;
  gap: 6px;
  margin-left: auto;
}

.tw-village-jump a {
  color: #fff0c4;
  font-weight: 700;
  text-decoration: none;
}

.tw-village-jump a:hover {
  text-decoration: underline;
}

.village-switcher-panel {
  padding: 10px 12px;
}

.village-switcher {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
}

.village-switcher a {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  color: #3f260f;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
  text-decoration: none;
}

.village-switcher a:hover,
.village-switcher a.active {
  color: #fff8d6;
  background: #6f4a24;
  border-color: #513516;
}

.village-switcher span {
  color: inherit;
  font-size: 12px;
  opacity: .82;
}

.village-switcher-alert {
  justify-self: start;
  padding: 2px 6px;
  color: #fff4d4;
  background: #8b1f16;
  border: 1px solid #c87a47;
  border-radius: 3px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}

.resources {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
}

.resources span {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
  border-radius: 4px;
  padding: 8px;
}

.resources img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

body.theme-dark .resources span,
body.theme-dark table {
  background: #201a15;
}

body.theme-dark th,
body.theme-dark td,
body.theme-dark .resources span {
  border-color: #6f604f;
}

body.theme-dark th {
  background: #382f25;
}

.wide {
  grid-column: span 3;
}

.screen-tabs-panel {
  padding: 3px 4px;
  background: #d8bd82 url("/assets/graphic/background/table.jpg") repeat;
}

.screen-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  align-items: stretch;
}

.screen-tab-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 1px;
  align-items: center;
  padding: 1px;
  background: rgba(87, 55, 27, .05);
  border: 1px solid rgba(168, 122, 69, .55);
  border-radius: 0;
}

.screen-tab-group.active-group {
  background: rgba(255, 246, 210, .35);
  border-color: #8b5d2c;
}

.screen-tab-group strong {
  padding: 0 4px;
  color: #5f4324;
  font-size: 10px;
  text-transform: uppercase;
}

.screen-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 20px;
  padding: 2px 5px;
  color: #2e1b0b;
  font-weight: 700;
  text-decoration: none;
  background: #e7cf9d url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #9f7744;
  border-radius: 0;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.45);
  font-size: 11px;
}

.screen-tabs a img {
  width: 13px;
  height: 13px;
  object-fit: contain;
  flex: 0 0 auto;
}

.screen-tabs a:hover,
.screen-tabs a.active {
  background-color: #f6e0ac;
  border-color: #6f4b20;
}

.screen-tabs a.active {
  color: #fff4cf;
  background: #6f321d url("/assets/graphic/background/navi.png") repeat-x;
}

.main-building-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.main-building-summary div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.main-building-summary strong {
  font-size: 18px;
}

.main-building-summary span {
  color: var(--muted);
  font-size: 12px;
}

.building-detail-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(120px, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.building-detail-summary div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.building-detail-summary strong {
  font-size: 18px;
}

.building-detail-summary span {
  color: var(--muted);
  font-size: 12px;
}

.building-detail-table {
  margin: 8px 0 12px;
}

.building-detail-table th {
  width: 28%;
}

.building-table button {
  min-width: 88px;
  padding: 6px 9px;
}

.unit-recruit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

body.game-page .screen-barracks-panel .unit-recruit-grid,
body.game-page .screen-stable-panel .unit-recruit-grid,
body.game-page .screen-garage-panel .unit-recruit-grid {
  display: none;
}

.unit-recruit-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #c9aa7c;
  border-radius: 3px;
  box-shadow: inset 0 1px rgba(255, 255, 255, .55);
}

.unit-recruit-card.locked {
  color: #6f6253;
  background-color: #efe0c0;
}

.unit-recruit-head {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
}

.unit-recruit-head img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.unit-recruit-head strong,
.unit-recruit-head span,
.unit-recruit-status {
  display: block;
}

.unit-recruit-head strong {
  color: #2e1b0b;
}

.unit-recruit-head span,
.unit-recruit-status small {
  color: var(--muted);
  font-size: 12px;
}

.unit-recruit-stats,
.unit-recruit-cost {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
}

.unit-recruit-stats span,
.unit-recruit-cost span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 4px;
  background: rgba(255, 253, 246, .68);
  border: 1px solid rgba(160, 122, 77, .42);
  font-size: 12px;
  white-space: nowrap;
}

.unit-recruit-stats img,
.unit-recruit-cost img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.unit-recruit-status {
  min-height: 34px;
  padding: 6px 8px;
  background: rgba(115, 77, 39, .08);
  border-left: 3px solid #8c6b3f;
  font-size: 12px;
}

.unit-recruit-form {
  justify-content: flex-end;
}

.unit-recruit-form button {
  min-width: 84px;
}

.recruit-template-panel {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 10px;
  background: #f4e1bd var(--asset-table);
  border: 1px solid #b78a55;
  box-shadow: inset 0 1px rgba(255, 255, 255, .45);
}

body.game-page .recruit-template-panel {
  margin: 6px 0 10px;
  padding: 6px 8px;
  border-color: #b58a50;
  background: rgba(239, 217, 161, .82) url("/assets/graphic/background/table.jpg") repeat;
}

body.game-page .recruit-template-panel h3,
body.game-page .recruit-template-panel .hint {
  margin: 0;
}

body.game-page .recruit-template-form,
body.game-page .recruit-template-units {
  display: none;
}

.recruit-template-panel h3 {
  margin-top: 0;
}

.recruit-template-form {
  display: grid;
  gap: 8px;
}

.recruit-template-form > input[type="text"] {
  max-width: 320px;
}

.recruit-template-units {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 6px;
}

.recruit-template-units label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 64px;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  background: rgba(255, 253, 246, .68);
  border: 1px solid rgba(160, 122, 77, .42);
  font-size: 12px;
}

.recruit-template-units span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.recruit-template-units img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.recruit-template-units input {
  width: 64px;
}

.recruit-template-table td {
  vertical-align: middle;
}

.recruit-template-table .asset-label {
  margin: 1px 5px 1px 0;
}

.recruit-classic-table {
  margin-top: 10px;
}

body.game-page .recruit-classic-table {
  margin-top: 4px;
}

body.game-page .recruit-classic-table .amount-input {
  width: 58px;
  height: 22px;
  padding: 1px 3px;
}

body.game-page .recruit-classic-table .unit-recruit-form {
  justify-content: flex-start;
  gap: 4px;
}

.recruit-classic-table td {
  vertical-align: middle;
}

.recruit-classic-table .resource-chip-row {
  min-width: 230px;
}

.recruit-row-locked td {
  color: #6f6253;
  background: rgba(239, 224, 192, .56);
}

.recruit-state {
  display: inline-block;
  min-width: 112px;
  padding: 2px 6px;
  border: 1px solid #c4a77d;
  background: #f5ead2;
  font-weight: 700;
  text-align: center;
}

.recruit-row-ready .recruit-state {
  border-color: #5d8e53;
  background: #d7ecd1;
}

.smith-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.smith-summary div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  border: 1px solid #d0b48d;
  background: #f9edcf var(--asset-table);
}

.smith-summary strong {
  font-size: 18px;
}

.smith-summary span {
  color: var(--muted);
  font-size: 12px;
}

.research-table td,
.research-queue-table td {
  vertical-align: middle;
}

.research-state {
  display: inline-block;
  min-width: 118px;
  padding: 2px 6px;
  border: 1px solid #c4a77d;
  background: #f5ead2;
  font-weight: 700;
  text-align: center;
}

.research-state-done {
  border-color: #5d8e53;
  background: #d7ecd1;
}

.research-state-queued {
  border-color: #8b763e;
  background: #fff1b8;
}

.research-state-available {
  border-color: #4a6f9c;
  background: #d6e3f5;
}

.research-row-locked td {
  color: #6f6253;
  background: rgba(239, 224, 192, .56);
}

.academy-capacity-box {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid #d0b48d;
  background: #f9edcf var(--asset-table);
}

.academy-capacity-box strong,
.academy-capacity-box span {
  display: block;
}

.academy-capacity-box span {
  color: var(--muted);
  font-size: 12px;
}

.academy-capacity-bar {
  height: 18px;
  overflow: hidden;
  border: 1px solid #9f835f;
  background: #e8d5ad;
  box-shadow: inset 0 1px 3px rgba(57, 38, 18, .28);
}

.academy-capacity-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(#8fb565, #547e3e);
}

body.game-page .academy-capacity-bar {
  display: block;
  min-height: 14px;
  padding: 0;
  border: 1px solid #8e6931;
  background: #e8d0a0;
  box-shadow: inset 0 1px 2px rgba(57, 38, 18, .3);
}

.academy-table td,
.academy-queue-table td {
  vertical-align: middle;
}

.academy-state {
  display: inline-block;
  min-width: 108px;
  padding: 2px 6px;
  border: 1px solid #c4a77d;
  background: #f5ead2;
  font-weight: 700;
  text-align: center;
}

.academy-state-available {
  border-color: #5d8e53;
  background: #d7ecd1;
}

.academy-state-capacity {
  border-color: #8b763e;
  background: #fff1b8;
}

.academy-row-locked td,
.academy-row-capacity td {
  color: #6f6253;
  background: rgba(239, 224, 192, .56);
}

.market-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

body.game-page .market-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 6px;
  border: 1px solid #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

.market-summary div,
.market-box {
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.market-summary div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
}

body.game-page .market-summary div {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 3px 7px;
  border: 0;
  border-right: 1px solid #d9bd84;
  background: transparent;
}

.market-summary strong {
  font-size: 18px;
}

body.game-page .market-summary strong {
  font-size: 13px;
}

.market-summary span {
  color: var(--muted);
  font-size: 12px;
}

.market-classic-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 8px;
  border: 1px solid #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

.market-classic-menu a {
  padding: 4px 8px;
  color: #6f2417;
  border-right: 1px solid #d9bd84;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.market-classic-menu a:hover {
  background: rgba(255, 248, 220, .65);
  text-decoration: underline;
}

.place-classic-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 8px;
  border: 1px solid #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

.place-classic-menu a {
  padding: 4px 8px;
  color: #6f2417;
  border-right: 1px solid #d9bd84;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.place-classic-menu a:hover {
  background: rgba(255, 248, 220, .65);
  text-decoration: underline;
}

.merchant-capacity-box {
  display: grid;
  grid-template-columns: minmax(180px, .42fr) minmax(220px, 1fr);
  gap: 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 9px 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

body.game-page .merchant-capacity-box {
  display: none;
}

.merchant-capacity-box strong,
.merchant-capacity-box span {
  display: block;
}

.merchant-capacity-box span {
  color: var(--muted);
  font-size: 12px;
}

.merchant-capacity-bar {
  height: 13px;
  overflow: hidden;
  background: #d7c099;
  border: 1px solid #9c7441;
  box-shadow: inset 0 1px 2px rgba(75, 45, 20, .28);
}

.merchant-capacity-bar span {
  height: 100%;
  background: linear-gradient(#b68a46, #7d5625);
}

body.game-page .merchant-capacity-bar {
  display: block;
  min-height: 14px;
  padding: 0;
  border: 1px solid #8e6931;
  background: #e8d0a0;
  box-shadow: inset 0 1px 2px rgba(57, 38, 18, .3);
}

.market-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

body.game-page .market-panels {
  grid-template-columns: 1fr;
  gap: 6px;
  margin-bottom: 8px;
}

.market-section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: space-between;
  margin: 14px 0 8px;
}

.market-section-head h3 {
  margin: 0;
}

.market-filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  padding: 8px;
  border: 1px solid #d0b48d;
  background: #f9edcf var(--asset-table);
}

.market-filter-form label {
  display: grid;
  gap: 2px;
  margin: 0;
  font-size: 12px;
}

.market-filter-form select,
.market-filter-form input {
  min-width: 112px;
}

.market-routes-panel {
  margin: 14px 0;
  padding: 10px;
  border: 1px solid #d0b48d;
  background: #f9edcf var(--asset-table);
}

.market-route-form {
  display: grid;
  grid-template-columns: minmax(160px, 1.4fr) repeat(7, minmax(76px, 1fr)) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.market-route-form label {
  display: grid;
  gap: 3px;
  margin: 0;
  font-size: 12px;
}

.build-template-panel {
  margin: 12px 0;
  padding: 10px;
  border: 1px solid #d0b48d;
  background: #f9edcf var(--asset-table);
}

.build-template-form {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(280px, 1.6fr) auto;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}

.build-template-form label {
  display: grid;
  gap: 3px;
  margin: 0;
  font-size: 12px;
}

.build-template-table td:nth-child(2) {
  min-width: 260px;
}

.building-classic-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 8px;
  border: 1px solid #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

.building-classic-menu a {
  padding: 4px 8px;
  color: #6f2417;
  border-right: 1px solid #d9bd84;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.building-classic-menu a:hover {
  background: rgba(255, 248, 220, .65);
  text-decoration: underline;
}

body.game-page .village-rename-form {
  justify-content: flex-start;
  margin: 0 0 8px;
  padding: 5px 7px;
  border: 1px solid #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

body.game-page .village-rename-form input[type="text"] {
  width: 260px;
}

body.game-page .build-template-panel {
  margin: 8px 0;
  padding: 6px 7px;
  border-color: #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

body.game-page .build-template-panel .market-section-head {
  margin: -6px -7px 6px;
  padding: 4px 7px;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #a4773c;
}

body.game-page .build-template-panel .market-section-head h3 {
  margin: 0;
}

.market-route-auto {
  display: block;
  color: #2f5f23;
  font-weight: 700;
}

.market-route-paused {
  display: block;
  color: #7a5a1d;
  font-weight: 700;
}

.route-error {
  display: block;
  color: #8b1f16;
  font-weight: 700;
}

.market-box {
  padding: 10px;
}

body.game-page .market-box,
body.game-page .market-routes-panel,
body.game-page .market-filter-form {
  padding: 6px 7px;
  border-color: #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

.market-box h3 {
  margin-bottom: 10px;
}

body.game-page .market-box h3,
body.game-page .market-section-head h3 {
  margin: -6px -7px 6px;
  padding: 4px 7px;
  color: #1d1005;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #b58a50;
  font-size: 13px;
}

.market-command-grid {
  grid-template-columns: repeat(5, minmax(88px, 1fr));
}

body.game-page .market-command-grid {
  grid-template-columns: repeat(5, minmax(70px, 1fr));
  gap: 5px;
}

.market-offer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

body.game-page .market-offer-grid {
  gap: 6px;
}

.market-offer-grid > div {
  display: grid;
  gap: 5px;
}

.market-offer-grid label {
  margin-bottom: 0;
  font-size: 12px;
}

.resource-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.resource-chip-row span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 22px;
  padding: 2px 5px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .42);
  white-space: nowrap;
}

.resource-chip-row img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.market-table button {
  padding: 5px 8px;
}

.market-history-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.market-history-grid h3 {
  margin-bottom: 8px;
}

.market-state {
  display: inline-block;
  min-width: 74px;
  padding: 2px 6px;
  border: 1px solid #c4a77d;
  background: #f5ead2;
  font-weight: 700;
  text-align: center;
}

.market-state-accepted {
  border-color: #5d8e53;
  background: #d7ecd1;
}

.market-state-cancelled {
  border-color: #a56855;
  background: #f0d7cf;
}

.village-overview-table .active-village-row td {
  background: rgba(255, 244, 204, .72);
}

.village-overview-table .resource-chip-row {
  min-width: 220px;
}

.storage-forecast {
  display: inline-grid;
  gap: 1px;
  min-width: 72px;
  padding: 2px 5px;
  border: 1px solid transparent;
}

.storage-forecast small {
  color: #6d5637;
  font-size: 11px;
  white-space: nowrap;
}

.storage-forecast.warning {
  background: #fff1bd;
  border-color: #d0a44d;
}

.storage-forecast.urgent {
  color: #5f1f14;
  background: #f3c08f;
  border-color: #b86d33;
}

.storage-forecast.full {
  color: #fff8d6;
  background: #8d2f1c;
  border-color: #5f1f14;
}

.storage-forecast.urgent small,
.storage-forecast.full small {
  color: inherit;
}

.sort-link {
  color: #3f260f;
  text-decoration: none;
}

.sort-link:hover,
.sort-link.active {
  color: #6f2417;
  text-decoration: underline;
}

.overview-mode-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.overview-mode-tabs a {
  padding: 5px 9px;
  color: #4b2e13;
  background: #f5e4bd;
  border: 1px solid #c7a87d;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}

.overview-mode-tabs a:hover,
.overview-mode-tabs a.active {
  color: #fff8d6;
  background: #6f4a24;
  border-color: #513516;
}

.village-group-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  padding: 8px;
  background: rgba(255, 249, 230, .58);
  border: 1px solid rgba(166, 126, 79, .42);
}

.village-group-tabs {
  flex: 1 1 320px;
  margin-bottom: 0;
}

.village-group-tabs small {
  color: inherit;
  opacity: .76;
}

.village-group-create-form input[type="text"] {
  width: 120px;
}

.village-group-label {
  margin-left: 4px;
  background: #806133;
}

.village-group-editor {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 249, 230, .58);
  border: 1px solid rgba(166, 126, 79, .42);
}

.village-group-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 6px 12px;
}

.village-group-checkboxes label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

.village-group-editor button {
  justify-self: start;
}

.village-quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.village-quick-actions form {
  display: grid;
  gap: 7px;
  padding: 10px;
  background: rgba(255, 249, 230, .58);
  border: 1px solid rgba(166, 126, 79, .42);
}

.village-quick-actions h3 {
  margin: 0;
  color: #4b2e13;
  font-size: 13px;
}

.village-quick-actions label {
  display: grid;
  gap: 3px;
  font-size: 12px;
  font-weight: 700;
}

.village-quick-actions select,
.village-quick-actions input {
  min-width: 0;
}

.quick-resource-row,
.quick-unit-row,
.quick-preset-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.quick-unit-row {
  grid-template-columns: minmax(0, 1fr) 88px;
}

.quick-preset-row {
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
}

.quick-preset-row button {
  justify-self: stretch;
  padding: 4px 6px;
  font-size: 11px;
}

.quick-resource-row label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.quick-resource-row img {
  width: 18px;
  height: 18px;
}

.quick-resource-row input {
  width: 100%;
}

.village-quick-actions button {
  justify-self: start;
}

.village-overview-queues {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.village-overview-queues span {
  display: inline-flex;
  justify-content: center;
  min-width: 32px;
  padding: 2px 5px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .42);
  font-weight: 700;
}

.village-command-breakdown {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.village-command-breakdown span,
.village-command-breakdown a {
  display: inline-flex;
  justify-content: center;
  min-width: 32px;
  padding: 2px 5px;
  color: #4b2e13;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .42);
  font-weight: 700;
  text-decoration: none;
}

.village-command-breakdown a.incoming-attack-count {
  color: #fff4d4;
  background: #8b1f16;
  border-color: #c87a47;
}

.village-command-breakdown a:hover {
  text-decoration: underline;
}

.global-command-overview {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 249, 230, .58);
  border: 1px solid rgba(166, 126, 79, .42);
}

.global-command-overview h3 {
  margin: 0;
  color: #4b2e13;
  font-size: 13px;
}

.global-command-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.global-command-head span {
  color: #6d5637;
  font-size: 11px;
  font-weight: 700;
}

.command-head-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-left: auto;
}

.global-command-head .command-head-stats span {
  padding: 2px 5px;
  color: #4b2e13;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .34);
}

.command-filter-tabs {
  margin-bottom: 0;
}

.command-filter-tabs a {
  padding: 3px 7px;
  font-size: 11px;
}

.command-head-stats .watchtower-stat {
  color: #304f19;
  border-color: rgba(93, 122, 52, .55);
}

.command-watchtower-tabs {
  justify-content: flex-start;
}

.command-watchtower-covered {
  background: rgba(218, 232, 167, .28);
}

.command-watchtower-pending {
  background: rgba(236, 220, 163, .22);
}

.command-watchtower-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #304f19;
  font-weight: 700;
  white-space: nowrap;
}

.command-watchtower-badge img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.command-watchtower-badge.pending {
  color: #6b5426;
}

.village-unit-chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 220px;
}

.village-unit-chip-row span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-width: 34px;
  padding: 2px 4px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .42);
  font-size: 11px;
  font-weight: 700;
}

.village-unit-chip-row img {
  width: 18px;
  height: 18px;
}

.village-support-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.village-support-summary span {
  padding: 1px 4px;
  color: #6d5637;
  background: rgba(245, 228, 189, .62);
  border: 1px solid rgba(160, 122, 77, .36);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.village-support-chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px;
  margin-top: 3px;
  padding: 2px 4px;
  border: 1px solid rgba(160, 122, 77, .36);
}

.village-support-chip-row.received {
  background: rgba(222, 236, 204, .7);
}

.village-support-chip-row.away {
  background: rgba(232, 220, 196, .7);
}

.village-support-chip-row strong {
  color: #5e472b;
  font-size: 10px;
}

.village-support-chip-row span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  font-weight: 700;
}

.village-support-chip-row img {
  width: 15px;
  height: 15px;
}

.next-event-pill {
  display: inline-grid;
  gap: 1px;
  min-height: 22px;
  padding: 3px 6px;
  color: #fff8d6;
  background: #6f4a24;
  border: 1px solid #513516;
  font-weight: 700;
  white-space: nowrap;
}

.next-event-pill span,
.next-event-pill small {
  color: #f2ddb0;
  font-size: 11px;
  font-weight: 400;
}

.next-event-pill a {
  color: inherit;
  text-decoration: none;
}

.next-event-pill a:hover {
  text-decoration: underline;
}

.reports-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.reports-summary div {
  display: grid;
  gap: 2px;
  padding: 9px 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.reports-summary strong {
  font-size: 18px;
}

.reports-summary span {
  color: var(--muted);
  font-size: 12px;
}

.reports-page-summary {
  margin-top: 4px;
}

.report-type-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 12px;
}

body.game-page .reports-classic-page .report-type-filter-row {
  gap: 0;
  margin: 0 0 6px;
  border: 1px solid #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

.report-type-filter-row a {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 6px 9px;
  border: 1px solid #c4a77d;
  background: #f9edcf var(--asset-table);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

body.game-page .reports-classic-page .report-type-filter-row a {
  padding: 4px 8px;
  border: 0;
  border-right: 1px solid #d9bd84;
  background: transparent;
  color: #6f2417;
  font-size: 12px;
}

.report-type-filter-row a.active,
.report-type-filter-row a:hover {
  border-color: #8b672f;
  background: #e6cfaa url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
}

.report-type-filter-row small {
  color: var(--muted);
}

.reports-table th,
.reports-table td {
  vertical-align: top;
}

body.game-page .reports-table th,
body.game-page .reports-table td {
  vertical-align: middle;
}

body.game-page .reports-table th:nth-child(2),
body.game-page .reports-table td:nth-child(2),
body.game-page .reports-table th:nth-child(3),
body.game-page .reports-table td:nth-child(3),
body.game-page .reports-table th:nth-child(5),
body.game-page .reports-table td:nth-child(5),
body.game-page .reports-table th:nth-child(6),
body.game-page .reports-table td:nth-child(6) {
  display: none;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 210px;
}

.report-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

body.game-page .report-bulk-actions,
body.game-page .classic-page .inline-actions {
  margin: 0 0 6px;
}

body.game-page .reports-classic-page .map-controls {
  grid-template-columns: minmax(180px, 1fr) minmax(120px, .6fr) minmax(110px, .5fr) minmax(180px, 1fr) auto auto auto;
  gap: 5px;
  padding: 6px;
  border: 1px solid #b58a50;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

body.game-page .reports-classic-page .map-controls label {
  font-size: 11px;
}

.report-select-cell {
  width: 28px;
  text-align: center;
}

.report-actions button {
  padding: 5px 7px;
}

.report-folder-create {
  display: grid;
  gap: 3px;
  padding: 5px;
}

.report-folder-create input {
  min-width: 0;
  width: 100%;
}

.report-share-options,
.report-forward-options {
  position: relative;
}

.report-share-options summary,
.report-forward-options summary {
  cursor: pointer;
  color: #603000;
  font-weight: 700;
}

.report-share-options form,
.report-forward-options form {
  display: grid;
  gap: 3px;
  min-width: 150px;
  padding: 5px;
  border: 1px solid #b58a50;
  background: #f4e4bc;
}

.report-share-options label {
  white-space: nowrap;
}

.report-type,
.report-state-new,
.report-state-read {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 20px;
  padding: 2px 6px;
  border: 1px solid rgba(87, 63, 36, .35);
  background: #f5e4bd;
  color: #3f260f;
  font-weight: 700;
  white-space: nowrap;
}

.report-type img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.report-title,
.report-compact-summary {
  display: block;
}

.report-title {
  margin-bottom: 3px;
}

.report-compact-summary {
  max-width: 560px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-loot-badge {
  display: inline-flex;
  margin-top: 4px;
  padding: 2px 6px;
  border: 1px solid rgba(87, 63, 36, .35);
  font-size: 11px;
  font-weight: 700;
}

.report-loot-full {
  background: #d7e5d8;
  color: #27491f;
}

.report-loot-partial {
  background: #eee0bd;
  color: #65460e;
}

.report-row-new > td {
  background-color: rgba(255, 248, 220, .7);
}

.report-row-read > td {
  color: #5d4c39;
}

.report-detail-row > td {
  padding: 0 8px 8px;
  background: rgba(255, 253, 246, .45);
}

.report-detail-classic {
  padding: 8px 0 2px;
}

.report-route-line {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 8px;
  color: #4b2e13;
}

.report-route-line span {
  color: #8b672f;
  font-weight: 700;
}

.report-route-actions {
  display: inline-flex;
  gap: 4px;
  margin-left: 6px;
}

.report-route-actions a {
  padding: 1px 5px;
  color: #5f3514;
  background: rgba(255, 253, 246, .72);
  border: 1px solid rgba(160, 122, 77, .34);
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

.report-route-actions a:hover {
  text-decoration: underline;
}

.report-detail-sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 8px;
}

.report-detail-sections section {
  border: 1px solid #c9a979;
  background: rgba(255, 253, 246, .78);
}

.report-battle-section {
  margin: 0 0 8px;
  border: 1px solid #b78d55;
  background: rgba(255, 253, 246, .86);
}

.report-detail-sections h3 {
  margin: 0;
  padding: 5px 8px;
  background: #d2b079 url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  color: #2f1d0d;
  font-size: 12px;
}

.report-battle-section h3 {
  margin: 0;
  padding: 5px 8px;
  background: #c99b5a url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  color: #2f1d0d;
  font-size: 12px;
}

.report-battle-matrix-wrap {
  overflow-x: auto;
}

.report-battle-matrix {
  min-width: 620px;
  margin: 0;
  background: rgba(255, 253, 246, .92);
}

.report-battle-matrix th,
.report-battle-matrix td {
  text-align: center;
  white-space: nowrap;
}

.report-battle-matrix tbody th {
  text-align: left;
  width: 150px;
}

.report-battle-matrix thead img {
  display: block;
  width: 18px;
  height: 18px;
  margin: 0 auto 2px;
  object-fit: contain;
}

.report-battle-matrix thead span {
  display: block;
  max-width: 62px;
  overflow: hidden;
  color: #4b2e13;
  font-size: 10px;
  text-overflow: ellipsis;
}

.report-battle-matrix td.empty {
  color: #a29178;
}

.report-unit-grid,
.report-resource-grid,
.report-building-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
}

.report-unit-grid span,
.report-resource-grid span,
.report-building-grid span {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  min-width: 62px;
}

.report-unit-grid img,
.report-resource-grid img,
.report-building-grid img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.report-resource-grid small,
.report-building-grid small {
  color: var(--muted);
}

.report-building-grid span {
  min-width: 118px;
}

.report-scout-section {
  border-color: #8aa2bd;
}

.report-support-section {
  border-color: #8ea56b;
}

.report-transport-section {
  border-color: #b58d55;
}

.report-mini-label,
.report-total-line {
  margin: 6px 8px 0;
  color: #4b2e13;
  font-size: 12px;
  font-weight: 700;
}

.report-total-line {
  margin-bottom: 8px;
}

.report-type-battle {
  background: #ead0b5;
  border-color: rgba(119, 59, 30, .48);
}

.report-type-spy {
  background: #dfe7c9;
  border-color: rgba(76, 106, 45, .42);
}

.report-type-support {
  background: #d7e5d8;
  border-color: rgba(54, 104, 64, .42);
}

.report-type-transport {
  background: #e2d8c5;
  border-color: rgba(118, 88, 49, .42);
}

.report-type-world {
  background: #d6e3f5;
  border-color: rgba(64, 94, 143, .42);
}

.report-state-new {
  background: #5d7f42;
  border-color: #34511f;
  color: #fff8d6;
}

.report-state-read {
  color: var(--muted);
}

.report-result-win {
  background: #d7e5d8;
  border-color: rgba(54, 104, 64, .42);
  color: #27491f;
}

.report-result-loss {
  background: #ead0b5;
  border-color: rgba(119, 59, 30, .48);
  color: #6c2718;
}

.report-result-neutral {
  background: #e2d8c5;
  border-color: rgba(118, 88, 49, .42);
}

.report-result-scout {
  background: #d6e3f5;
  border-color: rgba(64, 94, 143, .42);
  color: #263f6a;
}

.report-result-support,
.report-result-partial {
  background: #eee0bd;
  border-color: rgba(133, 101, 42, .45);
  color: #65460e;
}

.report-result-world {
  background: #d6e3f5;
  border-color: rgba(64, 94, 143, .42);
  color: #263f6a;
}

.report-result-raw {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.report-state-archived {
  background: #d9d2c5;
  border-color: rgba(78, 67, 55, .42);
  color: #4b4035;
}

.report-detail-table {
  margin: 0;
  background: rgba(255, 253, 246, .72);
}

.report-detail-table th {
  width: 190px;
  color: #4b2e13;
}

.inline-form {
  display: inline-flex;
  margin: 0;
}

.game-grid .screen-panel {
  display: none;
}

.game-grid.screen-overview .screen-overview-panel,
.game-grid.screen-map .screen-map-panel,
.game-grid.screen-villages .screen-villages-panel,
.game-grid.screen-main .screen-main-panel,
.game-grid.screen-wood .screen-wood-panel,
.game-grid.screen-stone .screen-stone-panel,
.game-grid.screen-iron .screen-iron-panel,
.game-grid.screen-farm .screen-farm-panel,
.game-grid.screen-storage .screen-storage-panel,
.game-grid.screen-hide .screen-hide-panel,
.game-grid.screen-wall .screen-wall-panel,
.game-grid.screen-church .screen-church-panel,
.game-grid.screen-barracks .screen-barracks-panel,
.game-grid.screen-stable .screen-stable-panel,
.game-grid.screen-garage .screen-garage-panel,
.game-grid.screen-smith .screen-smith-panel,
.game-grid.screen-academy .screen-academy-panel,
.game-grid.screen-statue .screen-statue-panel,
.game-grid.screen-place .screen-place-panel,
.game-grid.screen-simulator .screen-simulator-panel,
.game-grid.screen-market .screen-market-panel,
.game-grid.screen-tribe .screen-tribe-panel,
.game-grid.screen-reports .screen-reports-panel {
  display: block;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf6 var(--asset-table);
}

th,
td {
  padding: 8px;
  border: 1px solid #d0b48d;
  text-align: left;
}

th {
  background: #e6cfaa url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
}

.asset-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.asset-label img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  image-rendering: auto;
}

.classic-village {
  margin-top: 14px;
}

.village-view-tabs {
  margin-bottom: 8px;
}

.tw-overview-layout.classic-mode {
  grid-template-columns: minmax(0, 1fr) 184px;
}

.tw-overview-layout.classic-mode .tw-overview-main {
  min-width: 0;
}

.primary-classic-village {
  margin-top: 0;
  border: 1px solid #b58a50;
  background: #f4dfaa url("/assets/graphic/background/table.jpg") repeat;
}

.classic-village h3 {
  margin-bottom: 8px;
}

.primary-classic-village h3 {
  margin: 0;
  padding: 5px 8px;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #b58a50;
}

.primary-classic-village table {
  margin: 0;
  border: 0;
}

.primary-classic-village th,
.primary-classic-village td {
  padding: 6px 8px;
}

.compact-table th,
.compact-table td {
  padding: 5px 7px;
  font-size: 12px;
}

body.game-page .compact-table,
body.game-page .building-table,
body.game-page .market-table,
body.game-page .recruit-classic-table {
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #b58a50;
}

body.game-page .compact-table th,
body.game-page .compact-table td {
  padding: 3px 5px;
  border-color: #dec28b;
  font-size: 12px;
}

body.game-page .compact-table th {
  color: #1d1005;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
}

body.game-page .asset-label {
  gap: 5px;
}

body.game-page .asset-label img {
  width: 24px;
  height: 24px;
}

.compact-table .asset-label img {
  width: 20px;
  height: 20px;
}

.classic-page {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

body.game-page .classic-page {
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
}

body.game-page .village-head {
  padding: 6px 8px;
}

body.game-page .village-head h1 {
  margin: 0;
  font-size: 20px;
}

body.game-page .village-head p,
body.game-page .village-head .resources {
  display: none;
}

.classic-side-nav {
  display: grid;
  gap: 0;
  background: var(--panel) var(--asset-panel);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

body.game-page .classic-side-nav {
  border-color: #b58a50;
  border-radius: 0;
  background: #efd9a1 url("/assets/graphic/background/table.jpg") repeat;
}

.classic-side-nav strong {
  padding: 8px 10px;
  color: #2e1b0b;
  background: #e6cfaa url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #a88760;
}

body.game-page .classic-side-nav strong {
  padding: 5px 7px;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  font-size: 12px;
}

.classic-side-nav a {
  padding: 8px 10px;
  color: #4b2e13;
  border-bottom: 1px solid rgba(168, 135, 96, .55);
  font-weight: 700;
  text-decoration: none;
}

body.game-page .classic-side-nav a {
  padding: 4px 7px;
  font-size: 12px;
}

.classic-side-nav a:hover,
.classic-side-nav a.active {
  color: #6f2417;
  background: rgba(255, 246, 221, .72);
}

.classic-page-main {
  min-width: 0;
}

.classic-page .panel {
  padding: 12px;
  border-radius: 4px;
}

body.game-page .classic-page .panel {
  padding: 8px;
  border-radius: 0;
}

.classic-page table th,
.classic-page table td {
  padding: 5px 7px;
  font-size: 12px;
  vertical-align: top;
}

.classic-page .button-link,
.classic-page button {
  padding: 6px 9px;
  font-size: 12px;
}

.classic-page .button-link.active {
  color: #fff8d6;
  background: #6f4a24;
  border-color: #513516;
}

.ranking-continent-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
  gap: 4px;
}

.ranking-continent-tabs .button-link {
  justify-content: center;
  text-align: center;
  padding: 5px 4px;
}

.ranking-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: end;
  margin-bottom: 10px;
}

.ranking-search-form input[type="text"] {
  max-width: 320px;
}

.ranking-search-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.ranking-search-results h3 {
  margin-bottom: 7px;
  font-size: 14px;
}

.relation-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  padding: 1px 5px;
  border: 1px solid rgba(87, 63, 36, .35);
  background: #f5e4bd;
  color: #3f260f;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.relation-own {
  background: #d7ebc2;
  border-color: #7aa25d;
}

.relation-ally {
  background: #d7ecd1;
  border-color: #5c9c4b;
}

.relation-nap {
  background: #d8e5f4;
  border-color: #6f93ba;
}

.relation-enemy {
  background: #edd1c8;
  border-color: #b66a55;
}

.daily-ranking-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.daily-ranking-card {
  padding: 9px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.daily-ranking-card h3 {
  margin-bottom: 7px;
  font-size: 14px;
  color: #3f260f;
}

.player-continent-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 8px;
}

.player-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 8px;
}

.player-stat-grid div {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.player-stat-grid strong {
  font-size: 18px;
  color: #3f260f;
}

.player-stat-grid span {
  color: var(--muted);
  font-size: 12px;
}

.player-award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
}

.player-award-card {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 9px;
  align-items: center;
  padding: 9px 10px;
  background: #f9edcf var(--asset-table);
  border: 1px solid #c5a171;
}

.player-award-medal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff8d6;
  background: #8b5a2b;
  border: 2px solid #d6b56f;
  font-weight: 700;
}

.player-award-card div {
  display: grid;
  gap: 2px;
}

.player-award-card strong {
  color: #3f260f;
}

.player-award-card span,
.player-award-card small {
  color: var(--muted);
  font-size: 12px;
}

.player-profile-text {
  padding: 10px;
  margin-bottom: 10px;
  background: rgba(255, 253, 246, .72);
  border: 1px solid #d0b48d;
}

.player-profile-form {
  display: grid;
  gap: 8px;
}

.player-continent-card {
  display: grid;
  gap: 3px;
  padding: 8px 10px;
  color: #3f260f;
  text-decoration: none;
  background: #f9edcf var(--asset-table);
  border: 1px solid #d0b48d;
}

.player-continent-card:hover {
  border-color: #8b5a2b;
}

.player-continent-card strong {
  font-size: 16px;
}

.player-continent-card span {
  color: var(--muted);
  font-size: 12px;
}

.is-muted-row {
  color: #7b6a55;
}

.table-link {
  color: #6f2417;
  font-weight: 700;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

body.game-page .player-classic-page,
body.game-page .tribe-classic-page,
body.game-page .ranking-classic-page {
  margin-top: 0;
}

.classic-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  background: #f1dda8 url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #b58a50;
}

.classic-tabbar a {
  padding: 6px 9px;
  color: #4b2e13;
  border-right: 1px solid rgba(181, 138, 80, .55);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.classic-tabbar a:hover,
.classic-tabbar a.active {
  color: #6f2417;
  background: #f8e8bb url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
}

body.game-page .player-profile-layout,
body.game-page .tribe-classic-main,
body.game-page .ranking-classic-main {
  gap: 6px;
}

body.game-page .player-profile-tabs,
body.game-page .tribe-profile-tabs {
  grid-column: 1 / -1;
}

body.game-page .player-profile-layout {
  display: grid;
  grid-template-columns: minmax(250px, .78fr) minmax(330px, 1fr);
  align-items: start;
}

body.game-page .player-summary-panel,
body.game-page .player-villages-panel {
  grid-column: 1;
}

body.game-page .player-text-panel,
body.game-page .player-awards-panel,
body.game-page .player-stats-panel,
body.game-page .player-continent-panel {
  grid-column: 2;
}

body.game-page .player-tab-panel {
  grid-column: 1 / -1;
}

body.game-page .player-summary-panel h2,
body.game-page .player-text-panel h2,
body.game-page .player-awards-panel h2,
body.game-page .player-stats-panel h2,
body.game-page .player-continent-panel h2,
body.game-page .player-villages-panel h2,
body.game-page .tribe-classic-main h2,
body.game-page .ranking-classic-main h2 {
  margin: -8px -8px 6px;
  padding: 4px 7px;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #b58a50;
  font-size: 13px;
}

body.game-page .player-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
}

body.game-page .player-stat-grid div {
  padding: 4px 6px;
  border-radius: 0;
}

body.game-page .player-stat-grid strong {
  font-size: 13px;
}

body.game-page .player-award-grid {
  grid-template-columns: 1fr;
  gap: 0;
}

body.game-page .player-award-card {
  grid-template-columns: 42px 1fr;
  min-height: 54px;
  padding: 5px 7px;
  border-width: 0 0 1px;
}

body.game-page .player-award-medal {
  width: 32px;
  height: 32px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 246, 210, .7);
}

body.game-page .player-profile-text {
  min-height: 92px;
  padding: 8px;
  text-align: center;
}

body.game-page .player-continent-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
}

body.game-page .player-continent-card {
  padding: 5px 7px;
  border-radius: 0;
}

body.game-page .player-villages-panel table,
body.game-page .ranking-classic-main table,
body.game-page .tribe-classic-main table {
  width: 100%;
  border-collapse: collapse;
}

body.game-page .tribe-profile-summary {
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

body.game-page .tribe-emblem {
  width: 56px;
  height: 56px;
}

body.game-page .tribe-summary-panel {
  grid-column: 1 / -1;
}

body.game-page .tribe-members-panel,
body.game-page .tribe-diplomacy-panel,
body.game-page .tribe-forum-panel,
body.game-page .tribe-villages-panel,
body.game-page .ranking-players-panel,
body.game-page .ranking-tribes-panel,
body.game-page .ranking-villages-panel {
  overflow-x: auto;
}

body.game-page .tribe-announcement-panel .bbcode-content,
body.game-page .tribe-forum-panel .bbcode-content {
  background: rgba(255, 248, 218, .45);
  border: 1px solid rgba(181, 138, 80, .5);
  padding: 8px;
}

body.game-page .ranking-classic-main {
  display: grid;
  grid-template-columns: 1fr;
}

body.game-page .ranking-classic-main h2 {
  font-size: 16px;
}

body.game-page .ranking-classic-main td:first-child,
body.game-page .ranking-classic-main th:first-child {
  width: 46px;
  text-align: right;
}

body.game-page .ranking-classic-main td,
body.game-page .ranking-classic-main th {
  white-space: nowrap;
}

body.game-page .ranking-players-panel {
  order: 1;
}

body.game-page .ranking-tribes-panel {
  order: 2;
}

body.game-page .ranking-villages-panel {
  order: 3;
}

body.game-page .ranking-daily-panel {
  order: 4;
}

body.game-page .ranking-search-panel,
body.game-page .ranking-continent-panel {
  order: 5;
}

body.game-page .settings-classic-main {
  display: grid;
  gap: 6px;
}

body.game-page .settings-panel h2 {
  margin: -8px -8px 8px;
  padding: 5px 8px;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #b58a50;
  font-size: 18px;
}

body.game-page .settings-classic-form {
  display: grid;
  gap: 8px;
}

body.game-page .settings-table {
  width: 100%;
  border-collapse: collapse;
  background: rgba(248, 230, 184, .55);
}

body.game-page .settings-table th,
body.game-page .settings-table td {
  padding: 5px 7px;
  border: 1px solid rgba(181, 138, 80, .35);
  font-size: 12px;
  vertical-align: middle;
}

body.game-page .settings-table th {
  width: 190px;
  text-align: left;
  background: rgba(216, 180, 105, .45);
}

body.game-page .settings-table input[type="number"] {
  width: 58px;
}

body.game-page .settings-table select {
  min-width: 92px;
}

@media (max-width: 820px) {
  .login-shell,
  .home-front-grid,
  .world-grid,
  .game-grid {
    grid-template-columns: 1fr;
  }

  .stats,
  .home-import-stats,
  .resources,
  .building-detail-summary,
  .place-summary,
  .place-command-layout,
  .place-target-grid,
  .market-summary,
  .smith-summary,
  .market-panels,
  .academy-capacity-box,
  .market-command-grid,
  .market-offer-grid,
  .market-history-grid,
  .market-route-form,
  .map-classic-board,
  .map-tactical-row,
  .reports-summary,
  .tribe-summary,
  .tribe-action-grid,
  .message-summary,
  .message-compose-grid,
  .command-grid,
  .map-controls,
  .admin-log-filter,
  .admin-stats-panels,
  .preferences-form,
  .split-panel,
  .classic-page {
    grid-template-columns: 1fr;
  }

  .village-head {
    flex-direction: column;
  }

  .tw-top,
  .tw-resbar,
  .tw-overview-layout {
    grid-template-columns: 1fr;
  }

  .tw-village-title,
  .tw-resbar span {
    border-right: 0;
    border-left: 0;
  }

  .wide {
    grid-column: span 1;
    overflow-x: auto;
  }

  .map-classic-board .map-grid {
    overflow-x: auto;
  }

  body.game-page .map-grid {
    grid-template-columns: repeat(var(--map-size), minmax(45px, 1fr));
  }

  body.game-page .map-cell {
    min-width: 45px;
    min-height: 45px;
    aspect-ratio: 1;
  }

  .map-side-pane {
    grid-template-columns: 1fr;
  }

  .home-front-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .home-news-panel,
  .home-login-panel {
    min-width: 0;
  }

  .home-world-table {
    table-layout: fixed;
  }

  .home-world-table th,
  .home-world-table td {
    overflow-wrap: anywhere;
  }

  .political-map {
    aspect-ratio: 1.6 / 1;
  }

  body.game-page {
    padding-bottom: 0;
  }

  body.game-page .topbar {
    justify-content: center;
    padding: 4px 8px;
  }

  body.game-page .brand {
    display: none;
  }

  .game-main-nav {
    justify-content: flex-start;
    overflow-x: auto;
    flex-wrap: nowrap;
    width: 100%;
  }

  .layout-context-bar {
    grid-template-columns: 1fr;
  }

  .layout-village-link {
    border-right: 0;
    border-bottom: 1px solid rgba(126, 83, 38, .55);
  }

  .layout-resource-strip {
    overflow-x: auto;
  }

  body.game-page::before,
  body.game-page::after,
  .game-footer {
    display: none;
  }
}

/* Human review follow-up: official PT114 screen structure */
body.game-page .screen-place-panel .place-summary,
body.game-page .screen-market-panel .market-summary {
  display: none;
}

body.game-page .screen-place-panel .place-command-layout {
  grid-template-columns: 1fr;
  gap: 8px;
}

body.game-page .screen-place-panel .place-command-box:nth-child(2) {
  order: 1;
}

body.game-page .screen-place-panel .place-command-box:first-child {
  order: 2;
  max-width: 620px;
}

body.game-page .screen-place-panel .place-unit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid #c29a5a;
}

body.game-page .screen-place-panel .place-unit-row {
  min-height: 35px;
  padding: 3px 5px;
  background: rgba(249, 237, 204, .68);
  border: 0;
  border-right: 1px solid #dcc28b;
  border-bottom: 1px solid #dcc28b;
}

body.game-page .screen-place-panel .place-unit-row img {
  width: 25px;
  height: 25px;
}

body.game-page .screen-place-panel .place-command-preview {
  margin-top: 6px;
  background: #ead19a;
  border: 1px solid #aa7e3f;
}

body.game-page .screen-market-panel {
  display: grid !important;
  grid-template-columns: 170px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
}

body.game-page .screen-market-panel > .building-screen-head {
  grid-column: 1 / -1;
}

body.game-page .screen-market-panel > .market-classic-menu {
  grid-column: 1;
  grid-row: 2 / span 30;
  display: flex;
  flex-direction: column;
  align-self: start;
  margin: 0;
}

body.game-page .screen-market-panel > .market-classic-menu a {
  width: 100%;
  border-right: 0;
  border-bottom: 1px solid #c29a5a;
}

body.game-page .screen-market-panel > :not(.building-screen-head):not(.market-classic-menu) {
  grid-column: 2;
}

body.game-page .reports-classic-page {
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px;
}

body.game-page .reports-classic-page .classic-page-main {
  gap: 0;
}

body.game-page .reports-classic-page .classic-page-main > .panel {
  margin: 0;
  border-bottom: 0;
  box-shadow: none;
}

body.game-page .reports-classic-page .classic-page-main > .panel:last-child {
  border-bottom: 1px solid #7a4f20;
}

body.game-page .reports-classic-page .reports-page-summary,
body.game-page .reports-classic-page .report-type-filter-row {
  display: none;
}

body.game-page .reports-classic-page .map-controls {
  grid-template-columns: 112px 100px 92px minmax(160px, 1fr) auto;
  margin: 0 0 5px;
  padding: 5px;
}

body.game-page .reports-classic-page .map-controls .button-link {
  display: none;
}

body.game-page .reports-classic-page .inline-actions {
  justify-content: flex-start;
}

body.game-page .reports-classic-page .reports-list-panel {
  padding-top: 2px;
}

body.game-page .reports-classic-page .reports-table {
  margin-top: 0;
}

body.game-page .report-detail-classic {
  max-width: 640px;
  margin: 0 auto;
  padding: 5px 0;
}

body.game-page .report-battle-section,
body.game-page .report-detail-sections section {
  background: #ead19a url("/assets/graphic/background/table.jpg") repeat;
  border-color: #aa7e3f;
}

body.game-page .report-battle-matrix {
  background: #ead19a url("/assets/graphic/background/table.jpg") repeat;
}

body.game-page .report-battle-hero {
  margin: 0 0 8px;
  overflow: hidden;
  background: #c7b99e;
  border: 1px solid #aa7e3f;
}

body.game-page .report-battle-hero h3 {
  margin: 0;
  padding: 5px 8px;
  color: #1b1005;
  background: #d0a65b url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #aa7e3f;
  font-size: 15px;
  font-style: italic;
}

body.game-page .report-battle-hero > img {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}

body.game-page .report-battle-hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px;
  background: rgba(232, 219, 188, .92);
  font-style: italic;
}

@media (max-width: 820px) {
  body.game-page .screen-place-panel .place-unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.game-page .screen-market-panel {
    display: block !important;
  }

  body.game-page .screen-market-panel > .market-classic-menu {
    flex-direction: row;
    margin-bottom: 8px;
  }

  body.game-page .screen-market-panel > .market-classic-menu a {
    width: auto;
    border-right: 1px solid #c29a5a;
  }

  body.game-page .reports-classic-page {
    grid-template-columns: 1fr;
  }

  body.game-page .reports-classic-page .map-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Segunda calibracao oficial: PT114 (Quartel, Academia, Ferreiro e Mensagens)
   e PT115 (aldeia inicial com protecao). */
body.game-page .tw-beginner-protection {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  margin: 6px 0;
  padding: 6px 10px;
  color: #2d1a08;
  background: #f5e4b8 url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #b98a48;
  box-shadow: inset 0 0 0 1px rgba(255, 249, 220, .62);
  font-size: 12px;
}

body.game-page .tw-beginner-protection::before {
  content: "i";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid #241406;
  border-radius: 50%;
  font-family: Georgia, serif;
  font-weight: 700;
}

body.game-page .screen-barracks-panel .recruit-template-panel,
body.game-page .screen-stable-panel .recruit-template-panel,
body.game-page .screen-garage-panel .recruit-template-panel,
body.game-page .screen-barracks-panel .unit-recruit-grid,
body.game-page .screen-stable-panel .unit-recruit-grid,
body.game-page .screen-garage-panel .unit-recruit-grid {
  display: none;
}

body.game-page .recruit-queue-subpanel:not(:has(table)) {
  display: none;
}

body.game-page .screen-smith-panel .smith-summary,
body.game-page .screen-smith-panel .building-classic-menu {
  display: none;
}

body.game-page .screen-smith-panel .research-table {
  display: block;
  width: 100%;
  background: transparent;
  border: 0;
}

body.game-page .screen-smith-panel .research-table thead {
  display: none;
}

body.game-page .screen-smith-panel .research-table tbody {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  border-top: 20px solid #d2ae68;
}

body.game-page .screen-smith-panel .research-table tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  min-height: 82px;
  padding: 6px 8px;
  background: rgba(249, 232, 190, .62);
  border-right: 1px solid #d5b579;
  border-bottom: 1px solid #d5b579;
}

body.game-page .screen-smith-panel .research-table td {
  display: block;
  padding: 2px 3px;
  border: 0;
  background: transparent;
}

body.game-page .screen-smith-panel .research-table td:first-child {
  grid-column: 1 / -1;
  font-weight: 700;
}

body.game-page .screen-smith-panel .research-table td:first-child img {
  width: 46px;
  height: 46px;
}

body.game-page .screen-smith-panel .research-table td:nth-child(2) {
  grid-column: 1 / -1;
  color: #b48c4d;
}

body.game-page .screen-smith-panel .research-table td:nth-child(3),
body.game-page .screen-smith-panel .research-table td:nth-child(5) {
  display: none;
}

body.game-page .screen-smith-panel .research-table .research-row-done td:nth-child(4),
body.game-page .screen-smith-panel .research-table .research-row-done td:nth-child(6) {
  display: none;
}

body.game-page .screen-smith-panel #smith-queue,
body.game-page .screen-smith-panel #smith-queue ~ * {
  display: none;
}

body.game-page .screen-smith-panel #smith-queue:target,
body.game-page .screen-smith-panel #smith-queue:target ~ * {
  display: revert;
}

body.game-page .screen-academy-panel {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: start;
  gap: 0 10px;
}

body.game-page .screen-academy-panel > * {
  grid-column: 2;
}

body.game-page .screen-academy-panel > .building-screen-head {
  grid-column: 1 / -1;
}

body.game-page .screen-academy-panel > .stats {
  display: none;
}

body.game-page .screen-academy-panel > .building-classic-menu {
  grid-column: 1;
  grid-row: 2 / span 5;
  display: grid;
  align-self: stretch;
  align-content: start;
  border: 0;
  background: #eddaa9;
}

body.game-page .screen-academy-panel > .building-classic-menu a {
  border-right: 0;
  border-bottom: 1px solid #dcc18a;
}

body.game-page .screen-academy-panel > .academy-table {
  grid-row: 2;
  margin-top: 0;
}

body.game-page .screen-academy-panel > .academy-capacity-box {
  grid-row: 3;
  margin-top: 12px;
}

body.game-page .screen-academy-panel > .building-action-row {
  grid-row: 4;
}

body.game-page .messages-classic-page {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
}

body.game-page .messages-classic-page .panel-title-row h2 {
  font-size: 20px;
}

body.game-page .message-table th,
body.game-page .message-table td {
  display: table-cell;
  padding: 3px 5px;
  font-size: 12px;
}

body.game-page .message-table th:nth-child(5),
body.game-page .message-table td:nth-child(5),
body.game-page .message-table th:nth-child(6),
body.game-page .message-table td:nth-child(6) {
  display: none;
}

body.game-page .message-table th:first-child,
body.game-page .message-table td:first-child {
  width: 24px;
}

body.game-page .message-table th:nth-child(3),
body.game-page .message-table td:nth-child(3) {
  width: 165px;
}

body.game-page .message-table th:nth-child(4),
body.game-page .message-table td:nth-child(4) {
  width: 145px;
}

body.game-page .message-preview summary {
  color: #542809;
  font-weight: 700;
  cursor: pointer;
}

body.game-page .message-preview[open] {
  padding: 4px;
  background: rgba(255, 253, 241, .78);
  border: 1px solid #ccb17c;
}

body.game-page #blocked-players {
  display: none;
}

body.game-page #blocked-players:target {
  display: block;
}

@media (max-width: 820px) {
  body.game-page .screen-smith-panel .research-table tbody,
  body.game-page .screen-academy-panel,
  body.game-page .messages-classic-page {
    grid-template-columns: 1fr;
  }

  body.game-page .screen-academy-panel > *,
  body.game-page .screen-academy-panel > .building-screen-head,
  body.game-page .screen-academy-panel > .building-classic-menu {
    grid-column: 1;
    grid-row: auto;
  }

  body.game-page .screen-academy-panel > .building-classic-menu {
    display: flex;
    overflow-x: auto;
  }

  body.game-page .message-table th:nth-child(3),
  body.game-page .message-table td:nth-child(3),
  body.game-page .message-table th:nth-child(4),
  body.game-page .message-table td:nth-child(4) {
    display: none;
  }
}

/* Official PT114 social/profile calibration: tribe, player, ranking and settings. */
body.game-page .social-reference-head {
  display: none;
}

body.game-page .classic-page-title {
  grid-column: 1 / -1;
  margin: 4px 0 6px;
  color: #160d05;
  font-size: 20px;
  line-height: 1.15;
}

body.game-page .player-classic-page,
body.game-page .tribe-classic-page {
  grid-template-columns: 1fr;
}

body.game-page .player-side-nav,
body.game-page .tribe-classic-page > .classic-side-nav {
  display: none !important;
}

body.game-page .player-profile-layout,
body.game-page .tribe-classic-main {
  grid-column: 1 / -1;
}

body.game-page .player-profile-layout > .classic-page-title,
body.game-page .tribe-classic-main > .classic-page-title {
  grid-column: 1 / -1;
}

body.game-page .player-world-map {
  position: relative;
  height: 198px;
  margin: 0 0 4px;
  overflow: hidden;
  border: 1px solid #8b6a33;
  background-color: #66852c;
  background-image: linear-gradient(rgba(28, 48, 13, .3) 1px, transparent 1px), linear-gradient(90deg, rgba(28, 48, 13, .3) 1px, transparent 1px), repeating-linear-gradient(135deg, rgba(126, 161, 65, .2) 0 5px, transparent 5px 12px);
  background-size: 12px 12px, 12px 12px, auto;
}

body.game-page .player-world-map::before,
body.game-page .player-world-map::after {
  content: "";
  position: absolute;
  background: rgba(31, 42, 17, .7);
}

body.game-page .player-world-map::before {
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
}

body.game-page .player-world-map::after {
  right: 0;
  bottom: 50%;
  left: 0;
  height: 2px;
}

body.game-page .player-world-map-village {
  position: absolute;
  z-index: 2;
  width: 7px;
  height: 7px;
  margin: -3px 0 0 -3px;
  background: #fff;
  border: 1px solid #111;
}

body.game-page .player-overview-awards {
  grid-column: 2;
}

body.game-page .tribe-overview-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1.18fr) minmax(260px, .92fr);
  gap: 10px;
  align-items: start;
}

body.game-page .tribe-events-panel,
body.game-page .tribe-reference-announcement {
  padding: 4px;
}

body.game-page .tribe-event-filters {
  padding: 4px 5px 7px;
  text-align: center;
  color: #4c250a;
  font-weight: 700;
}

body.game-page .tribe-event-filters a {
  display: inline-block;
  padding: 2px 5px;
  color: #4c250a;
}

body.game-page .tribe-event-filters a.active {
  background: #d7b06e;
  box-shadow: inset 0 0 0 1px #a87837;
  text-decoration: none;
}

body.game-page .tribe-events-panel th:first-child,
body.game-page .tribe-events-panel td:first-child {
  width: 56px;
  text-align: left;
  white-space: normal;
}

body.game-page .tribe-reference-announcement h2 {
  margin: -4px -4px 7px;
  padding: 4px 6px;
  background: #d7b06e url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #b58a50;
  font-size: 13px;
}

body.game-page .tribe-reference-announcement .bbcode-content {
  min-height: 280px;
  padding: 44px 12px 12px;
  text-align: center;
}

body.game-page .tribe-summary-panel,
body.game-page .tribe-summary-panel + .tribe-announcement-panel {
  display: none;
}

body.game-page .ranking-classic-page,
body.game-page .settings-classic-page {
  align-items: start;
}

body.game-page .ranking-players-panel .visually-subordinate {
  display: none;
}

body.game-page .ranking-players-panel {
  padding-top: 0;
}

body.game-page .ranking-players-panel table th:first-child,
body.game-page .ranking-players-panel table td:first-child {
  width: 62px;
}

body.game-page .settings-side-nav span {
  display: block;
  padding: 4px 6px;
  color: #4b2509;
  border-bottom: 1px solid rgba(170, 126, 63, .42);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.05;
}

body.game-page .settings-table thead th {
  width: auto;
  padding: 3px 6px;
  color: #1f1006;
  background: #d1a65a url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
}

body.game-page .settings-table .inline-control {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 4px;
  min-height: 0;
  margin: 0;
}

body.game-page .settings-table .inline-control input[type="checkbox"] {
  flex: 0 0 auto;
  width: auto !important;
  margin: 0;
}

@media (max-width: 820px) {
  body.game-page .tribe-overview-grid,
  body.game-page .player-profile-layout {
    grid-template-columns: 1fr;
  }

  body.game-page .player-text-panel,
  body.game-page .player-overview-awards {
    grid-column: 1;
  }

  body.game-page .player-world-map {
    height: 160px;
  }
}

/* Fase 9: aproximacao fina de aldeia e edificios principais */
body.game-page .screen-main-panel .main-building-summary,
body.game-page .screen-main-panel .build-template-panel,
body.game-page .screen-barracks-panel .recruit-template-panel:has(.hint),
body.game-page .screen-stable-panel .recruit-template-panel:has(.hint),
body.game-page .screen-garage-panel .recruit-template-panel:has(.hint) {
  display: none;
}

body.game-page .building-screen-head {
  min-height: 74px;
  margin: 0 0 8px;
  padding: 8px 10px;
  background: transparent;
  border: 0;
}

body.game-page .building-screen-head > img {
  width: 76px;
  height: 76px;
  margin-top: 0;
}

body.game-page .building-screen-head h2 {
  margin: 6px 0 3px;
  color: #111;
  font-size: 22px;
  line-height: 1.05;
}

body.game-page .building-screen-head p {
  max-width: 660px;
  color: #1f1206;
  font-size: 13px;
}

body.game-page .screen-main-panel > .building-screen-head + .building-classic-menu,
body.game-page .screen-barracks-panel > .building-screen-head + .building-classic-menu,
body.game-page .screen-stable-panel > .building-screen-head + .building-classic-menu,
body.game-page .screen-garage-panel > .building-screen-head + .building-classic-menu {
  margin-top: 0;
}

body.game-page .building-classic-menu,
body.game-page .market-classic-menu,
body.game-page .place-classic-menu {
  min-height: 24px;
  margin: 0 0 8px;
}

body.game-page .building-classic-menu .classic-menu-disabled {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 4px 7px;
  color: #6f5a38;
  background: rgba(255, 246, 213, .22);
  border-right: 1px solid #c29a5a;
  cursor: default;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.05;
}

body.game-page .building-table th,
body.game-page .building-table td,
body.game-page .recruit-classic-table th,
body.game-page .recruit-classic-table td {
  padding: 3px 5px;
}

body.game-page .building-table .asset-label img,
body.game-page .recruit-classic-table .asset-label img {
  width: 28px;
  height: 28px;
}

body.game-page .building-table .level {
  display: block;
  color: #5b3b1b;
  font-size: 11px;
  font-weight: 400;
}

body.game-page .resource-chip-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

body.game-page .resource-chip-row span {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 18px;
  padding: 1px 3px;
  background: rgba(255, 247, 218, .52);
  border: 1px solid rgba(170, 126, 63, .38);
  white-space: nowrap;
}

body.game-page .resource-chip-row img {
  width: 16px;
  height: 16px;
}

body.game-page .queue-subpanel {
  margin-top: -8px;
  padding-top: 0;
  background: #f0d9a0 url("/assets/graphic/screen/content_bg.png") repeat;
  border-top: 0;
  box-shadow: 0 1px 4px rgba(61, 36, 13, .18);
}

body.game-page .queue-subpanel > h2 {
  margin: 0 -5px 6px;
  padding: 4px 7px;
  color: #1b1005;
  background: #d0a65b url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #9d7136;
  border-left: 0;
  border-right: 0;
  font-size: 13px;
  font-style: italic;
}

body.game-page .queue-subpanel .hint {
  margin: 0 0 6px;
  padding: 4px 6px;
}

body.game-page .building-action-row {
  align-items: center;
  min-height: 36px;
  margin: 7px 0;
  padding: 5px 7px;
}

body.game-page .village-rename-form {
  margin: 0;
  padding: 4px 6px;
}

body.game-page .build-template-panel {
  margin: 7px 0;
}

body.game-page .classic-rename-block {
  margin-top: 8px;
  padding: 0;
  background: #ead19a url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #aa7e3f;
}

body.game-page .classic-rename-block h3 {
  margin: 0;
  padding: 4px 7px;
  color: #1b1005;
  background: #d0a65b url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #aa7e3f;
  font-size: 13px;
  font-style: italic;
}

body.game-page .classic-rename-block .village-rename-form {
  border: 0;
  background: transparent;
}

body.game-page .recruit-classic-table {
  margin-top: 6px;
}

body.game-page .recruit-classic-table .resource-chip-row {
  min-width: 0;
}

body.game-page .recruit-classic-table .amount-input {
  width: 50px;
}

body.game-page .recruit-state,
body.game-page .state-ok,
body.game-page .state-bad {
  min-width: 0;
  padding: 2px 5px;
  border-radius: 0;
}

body.game-page .tw-overview-main {
  min-width: 0;
}

body.game-page .village-view-tabs {
  margin-bottom: 8px;
}

body.game-page .village-visual {
  max-width: 600px;
  aspect-ratio: 4 / 3;
}

body.game-page .village-visual-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.game-page .secondary-classic-village {
  display: none;
}

@media (max-width: 820px) {
  body.game-page .building-screen-head {
    min-height: 56px;
    padding: 6px;
  }

  body.game-page .building-screen-head > img {
    width: 54px;
    height: 54px;
  }

  body.game-page .building-screen-head h2 {
    margin-top: 2px;
    font-size: 18px;
  }

  body.game-page .building-table,
  body.game-page .recruit-classic-table {
    min-width: 720px;
  }

  body.game-page .screen-main-panel,
  body.game-page .screen-barracks-panel,
  body.game-page .screen-stable-panel,
  body.game-page .screen-garage-panel {
    overflow-x: auto;
  }
}

/* Fase 8 final cascade overrides */
body.game-page {
  color: #1b1005;
  font-family: Verdana, Arial, sans-serif;
  font-size: 12px;
  background-color: #c7b58e;
  background-image:
    url("/assets/graphic/background/body-medieval-original-v1.png"),
    url("/assets/graphic/background/body.jpg");
  background-position: center top, center top;
  background-repeat: no-repeat, repeat;
  background-size: cover, auto;
  background-attachment: fixed, scroll;
}

body.game-page .topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 43px;
  padding: 4px max(8px, calc((100vw - 980px) / 2));
  background: #67140d url("/assets/graphic/background/navi.png") repeat-x;
  border-top: 1px solid #2b0703;
  border-bottom: 3px solid #2d160a;
  box-shadow: 0 2px 0 #c8a05a, 0 4px 10px rgba(24, 10, 3, .45);
}

body.game-page .brand {
  display: none;
}

body.game-page .page.classic-frame,
body.game-page .page {
  width: min(904px, calc(100vw - 24px));
  margin: 10px auto 32px;
  padding: 8px 9px 20px;
  background: #ead4a0 url("/assets/graphic/background/content.jpg") repeat;
  border: 1px solid #633b18;
  box-shadow: 0 0 0 2px #c89f5e, 0 0 0 3px rgba(255, 239, 190, .65) inset, 0 4px 12px rgba(32, 17, 6, .44);
}

body.game-page .game-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 0;
}

body.game-page .game-grid .screen-panel {
  display: none !important;
}

body.game-page [hidden] {
  display: none !important;
}

body.game-page .game-grid.screen-overview .screen-overview-panel,
body.game-page .game-grid.screen-map .screen-map-panel,
body.game-page .game-grid.screen-villages .screen-villages-panel,
body.game-page .game-grid.screen-main .screen-main-panel,
body.game-page .game-grid.screen-wood .screen-wood-panel,
body.game-page .game-grid.screen-stone .screen-stone-panel,
body.game-page .game-grid.screen-iron .screen-iron-panel,
body.game-page .game-grid.screen-farm .screen-farm-panel,
body.game-page .game-grid.screen-storage .screen-storage-panel,
body.game-page .game-grid.screen-hide .screen-hide-panel,
body.game-page .game-grid.screen-wall .screen-wall-panel,
body.game-page .game-grid.screen-church .screen-church-panel,
body.game-page .game-grid.screen-barracks .screen-barracks-panel,
body.game-page .game-grid.screen-stable .screen-stable-panel,
body.game-page .game-grid.screen-garage .screen-garage-panel,
body.game-page .game-grid.screen-smith .screen-smith-panel,
body.game-page .game-grid.screen-academy .screen-academy-panel,
body.game-page .game-grid.screen-statue .screen-statue-panel,
body.game-page .game-grid.screen-place .screen-place-panel,
body.game-page .game-grid.screen-simulator .screen-simulator-panel,
body.game-page .game-grid.screen-market .screen-market-panel,
body.game-page .game-grid.screen-tribe .screen-tribe-panel,
body.game-page .game-grid.screen-reports .screen-reports-panel {
  display: block !important;
}

.game-main-nav {
  min-width: 0;
  gap: 4px;
}

.game-main-nav a {
  min-height: 26px;
  padding: 5px 9px 4px;
  color: #fbe4ad;
  background: #3a160b url("/assets/graphic/background/navi.png") repeat-x;
  border: 1px solid #1c0703;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(238, 187, 112, .35) inset, 0 1px 2px rgba(0, 0, 0, .45);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 1px #1b0502;
}

.game-main-nav a:hover,
.game-main-nav a.active {
  color: #fff7d7;
  background-color: #6f2113;
}

body.game-page .panel,
body.game-page .screen-panel,
.classic-frame .panel {
  color: #1b1005;
  background: #f0d9a0 url("/assets/graphic/screen/content_bg.png") repeat;
  border: 1px solid #7a4f20;
  border-radius: 0;
  box-shadow: 0 0 0 1px rgba(255, 246, 210, .72) inset, 0 2px 5px rgba(61, 36, 13, .22);
}

body.game-page .screen-panel {
  padding: 9px 10px 12px;
}

body.game-page .screen-panel > h2,
body.game-page .panel > h2,
body.game-page .panel-title-row,
.classic-table th,
body.game-page .compact-table th,
body.game-page .settings-table th {
  color: #1b1005;
  background: #d0a65b url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-color: #9d7136;
}

body.game-page .screen-panel > h2,
body.game-page .panel > h2 {
  margin: -4px -5px 8px;
  padding: 4px 7px;
  border: 1px solid #9d7136;
  font-size: 16px;
  font-style: italic;
  line-height: 1.15;
}

body.game-page .panel-title-row {
  min-height: 23px;
  margin: -4px -5px 8px;
  padding: 3px 7px;
  border: 1px solid #9d7136;
}

.classic-table,
body.game-page table,
body.game-page .compact-table,
body.game-page .building-table,
body.game-page .market-table,
body.game-page .recruit-classic-table,
body.game-page .settings-table {
  width: 100%;
  border-collapse: collapse;
  color: #1b1005;
  background: #ecd49b url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #aa7e3f;
  font-size: 12px;
}

.classic-table th,
.classic-table td,
body.game-page th,
body.game-page td,
body.game-page .compact-table th,
body.game-page .compact-table td {
  padding: 3px 5px;
  border: 1px solid #d9bd80;
  font-size: 12px;
  line-height: 1.2;
  vertical-align: middle;
}

.classic-button,
body.game-page button,
body.game-page .button-link,
body.game-page input[type="submit"],
body.game-page input[type="button"] {
  min-height: 22px;
  padding: 3px 8px;
  color: #fff3d0;
  background: #5a2d14 url("/assets/graphic/background/navi.png") repeat-x;
  border: 1px solid #2b1005;
  border-radius: 2px;
  box-shadow: 0 1px rgba(255, 233, 178, .35) inset, 0 1px 1px rgba(37, 17, 5, .35);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.15;
  text-decoration: none;
  text-shadow: 0 1px #1b0803;
}

body.game-page input,
body.game-page select,
body.game-page textarea {
  min-height: 20px;
  padding: 2px 4px;
  color: #1b1005;
  background: #fff8df;
  border: 1px solid #8d6838;
  border-radius: 0;
  font-family: Verdana, Arial, sans-serif;
  font-size: 12px;
}

.village-bar,
body.game-page .layout-context-bar,
body.game-page .tw-top {
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(420px, 1.45fr);
  gap: 0;
  margin-bottom: 7px;
  color: #1b1005;
  background: #ead19a url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #7a4f20;
  border-radius: 0;
  box-shadow: 0 1px rgba(255, 244, 210, .55) inset;
}

body.game-page .layout-village-link,
body.game-page .tw-village-title {
  min-height: 26px;
  padding: 4px 8px;
  border-right: 1px solid #9d7136;
  font-weight: 700;
}

.resource-strip,
body.game-page .layout-resource-strip,
body.game-page .tw-resbar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 0;
  min-width: 0;
  overflow-x: auto;
}

.resource-strip span,
body.game-page .layout-resource-strip span,
body.game-page .tw-resbar span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 26px;
  min-width: 74px;
  padding: 3px 6px;
  color: #1b1005;
  background: transparent;
  border-left: 1px solid #b78947;
  border-bottom: 0;
  font-weight: 700;
  white-space: nowrap;
}

.screen-submenu,
body.game-page .screen-tabs-panel,
body.game-page .building-classic-menu,
body.game-page .market-classic-menu,
body.game-page .place-classic-menu,
body.game-page .classic-tabbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0;
  background: #ead19a url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #aa7e3f;
  border-radius: 0;
  box-shadow: none;
}

body.game-page .screen-tabs-panel {
  padding: 0;
  overflow: hidden;
}

body.game-page .screen-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  width: 100%;
}

body.game-page .screen-tab-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  border-right: 1px solid #c29a5a;
}

body.game-page .screen-tab-group strong {
  display: none;
}

.screen-submenu a,
body.game-page .screen-tabs a,
body.game-page .building-classic-menu a,
body.game-page .market-classic-menu a,
body.game-page .place-classic-menu a,
body.game-page .classic-tabbar a,
body.game-page .tw-quicknav a {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  min-height: 24px;
  padding: 4px 7px;
  color: #4b2509;
  background: transparent;
  border-right: 1px solid #c29a5a;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.05;
  text-decoration: none;
}

.screen-submenu a:hover,
.screen-submenu a.active,
body.game-page .screen-tabs a:hover,
body.game-page .screen-tabs a.active,
body.game-page .building-classic-menu a:hover,
body.game-page .building-classic-menu a.active,
body.game-page .market-classic-menu a:hover,
body.game-page .market-classic-menu a.active,
body.game-page .place-classic-menu a:hover,
body.game-page .place-classic-menu a.active,
body.game-page .classic-tabbar a:hover,
body.game-page .classic-tabbar a.active {
  color: #7b1e11;
  background: #f5e4b5 url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
}

.classic-side-nav,
body.game-page .classic-side-nav {
  display: block;
  background: #ead19a url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #aa7e3f;
  border-radius: 0;
}

.classic-side-nav strong,
body.game-page .classic-side-nav strong {
  display: block;
  padding: 4px 6px;
  color: #2b1505;
  background: #d0a65b url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #aa7e3f;
  font-size: 12px;
}

.classic-side-nav a,
body.game-page .classic-side-nav a {
  display: block;
  padding: 4px 6px;
  color: #4b2509;
  border-bottom: 1px solid rgba(170, 126, 63, .42);
  font-size: 12px;
  font-weight: 700;
}

.notice-box,
.warning-box,
body.game-page .notice,
body.game-page .hint {
  padding: 6px 8px;
  background: #f6e4b3 url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #aa7e3f;
  border-radius: 0;
  color: #1b1005;
}

.icon-label,
.timer-label,
body.game-page .asset-label,
body.game-page .resource-chip,
body.game-page .tw-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

body.game-page .tw-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 176px;
  gap: 7px;
  align-items: start;
}

body.game-page .tw-overview-sidebar {
  display: grid;
  gap: 7px;
}

body.game-page .tw-overview-sidebar section {
  padding: 0;
  background: #ead19a url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #aa7e3f;
  border-radius: 0;
}

body.game-page .tw-overview-sidebar h3 {
  margin: 0;
  padding: 4px 6px;
  background: #d0a65b url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border-bottom: 1px solid #aa7e3f;
  font-size: 13px;
  font-style: italic;
}

body.game-page .tw-overview-sidebar p,
body.game-page .tw-overview-sidebar a {
  margin: 0;
  padding: 4px 6px;
  border-bottom: 1px solid rgba(170, 126, 63, .35);
}

body.game-page .village-visual {
  width: 100%;
  max-width: 600px;
  margin: 0 auto 8px;
  overflow: hidden;
  background-color: #6d8b40;
  border: 1px solid #6b3e16;
  box-shadow: 0 0 0 2px #c89f5e, 0 2px 5px rgba(40, 22, 7, .32);
}

body.game-page .visual-building span {
  min-width: 18px;
  min-height: 18px;
  padding: 2px 4px;
  color: #fff8d9;
  background: #486d2c;
  border: 1px solid #d5c491;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px #102104;
}

body.game-page .classic-page {
  grid-template-columns: 106px minmax(0, 1fr);
  gap: 7px;
}

body.game-page .operations-page {
  display: block;
}

body.game-page .operations-page > .hero.compact {
  margin-bottom: 7px;
  padding: 7px 9px;
  background: #ead19a url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #7a4f20;
}

body.game-page .operations-page > .hero.compact h1,
body.game-page .operations-page > .hero.compact p {
  display: inline;
  margin: 0 8px 0 0;
}

body.game-page .operations-page > .game-grid {
  margin-top: 7px;
}

body.game-page .game-footer {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  width: min(calc(var(--game-window-width, 900px) + 4px), calc(100vw - 24px));
  margin: -42px auto 18px;
  transform: none;
  justify-content: center;
  gap: 8px;
  min-height: 22px;
  padding: 2px 8px;
  color: #4b2509;
  background: #d3b46c url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #7a4f20;
  border-bottom: 0;
  font-size: 12px;
}

.game-chat-widget{position:fixed;right:8px;bottom:0;z-index:80;width:min(390px,calc(100% - 16px));font:13px Arial,sans-serif;color:#3d250e}.game-chat-toggle{margin-left:auto;display:flex;gap:.55rem;align-items:center;justify-content:space-between;min-width:130px;padding:.38rem .65rem;border:1px solid #6e3f18;border-bottom:0;border-radius:5px 5px 0 0;background:linear-gradient(#ecd18e,#b78336);color:#2d1606;font-weight:700;box-shadow:0 -2px 8px #0004}.game-chat-panel{border:1px solid #6e3f18;background:#f3e3b9;box-shadow:0 0 14px #0007}.game-chat-panel>header{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.45rem;background:#d6af62}.game-chat-panel select{max-width:185px}.game-chat-messages{height:260px;overflow:auto;padding:.4rem;background:#fff7df}.game-chat-messages article{padding:.35rem;border-bottom:1px solid #dbc896}.game-chat-messages article small{float:right;color:#715d42}.game-chat-messages article p{margin:.25rem 0;overflow-wrap:anywhere}.game-chat-panel form{display:grid;grid-template-columns:1fr auto;gap:.35rem;padding:.4rem}.game-chat-panel textarea{min-height:42px;resize:vertical}.game-chat-panel .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:520px){.game-chat-widget{right:4px;width:calc(100% - 8px)}.game-chat-messages{height:42vh}.game-chat-panel>header{align-items:flex-start;flex-direction:column}}

body.game-page {
  padding-bottom: 18px;
}

body.game-page .page.classic-frame,
body.game-page .page {
  margin-bottom: 58px;
}

@media (max-width: 980px) {
  body.game-page .page.classic-frame,
  body.game-page .page {
    width: calc(100% - 12px);
    margin-top: 6px;
    padding: 6px;
  }

  body.game-page .brand {
    display: none;
  }

  .game-main-nav {
    justify-content: flex-start;
    flex-wrap: nowrap;
    width: 100%;
    overflow-x: auto;
  }
}

@media (max-width: 820px) {
  body.game-page .village-bar,
  body.game-page .layout-context-bar,
  body.game-page .tw-top,
  body.game-page .tw-resbar,
  body.game-page .tw-overview-layout,
  body.game-page .classic-page,
  body.game-page .player-profile-layout {
    grid-template-columns: 1fr;
  }

  body.game-page .screen-tabs,
  body.game-page .building-classic-menu,
  body.game-page .market-classic-menu,
  body.game-page .place-classic-menu,
  body.game-page .classic-tabbar {
    display: flex;
    flex-wrap: nowrap;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
  }

  body.game-page .screen-tabs a,
  body.game-page .building-classic-menu a,
  body.game-page .market-classic-menu a,
  body.game-page .place-classic-menu a,
  body.game-page .classic-tabbar a {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  body.game-page .screen-tabs-panel {
    display: block;
    max-width: 100%;
    overflow: hidden;
  }

  body.game-page .screen-tab-group {
    flex: 0 0 auto;
    flex-wrap: nowrap;
  }

  body.game-page .reports-classic-page .report-folder-nav {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
  }

  body.game-page .reports-classic-page .report-folder-nav > * {
    flex: 0 0 auto;
  }

  body.game-page .reports-classic-page .report-folder-create {
    grid-template-columns: 150px auto;
    align-items: center;
    padding: 3px;
  }

  body.game-page .reports-classic-page .map-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
  }

  body.game-page .reports-classic-page .map-controls > button,
  body.game-page .reports-classic-page .map-controls > .button-link {
    width: 100%;
    min-width: 0;
    text-align: center;
  }

  body.game-page .game-footer {
    display: none;
  }
}

@media (max-width: 560px) {
  body.game-page .topbar {
    position: sticky;
    top: 0;
    z-index: 70;
    min-height: 32px;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 3px 4px;
    border-bottom-width: 2px;
  }

  body.game-page .topbar form {
    flex: 0 0 auto;
  }

  body.game-page .topbar .link-button {
    min-height: 25px;
    padding: 4px 6px;
    font-size: 11px;
    white-space: nowrap;
  }

  body.game-page .game-main-nav {
    flex: 1 1 auto;
    gap: 2px;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  body.game-page .game-main-nav::-webkit-scrollbar {
    display: none;
  }

  body.game-page .game-main-nav a {
    flex: 0 0 auto;
    min-width: 46px;
    min-height: 25px;
    padding: 5px 6px 4px;
    font-size: 0;
    text-align: center;
    scroll-snap-align: start;
  }

  body.game-page .game-main-nav a::after {
    content: attr(data-short);
    font-size: 11px;
    line-height: 1;
  }
}

/* Visual P0: keep the village identity and dark quick navigation legible
   after the compact classic-theme overrides above. */
body.game-page .tw-village-title h1 {
  color: #1b1005;
  text-shadow: none;
}

body.game-page .tw-village-title p {
  color: #5c4226;
}

body.game-page .tw-quicknav a {
  color: #f8e7bd;
  border-right-color: rgba(255, 239, 190, .2);
}

body.game-page .tw-quicknav a:hover,
body.game-page .tw-quicknav a:focus-visible {
  color: #fff7d7;
  background: rgba(255, 242, 198, .12);
}

/* Calibracao visual com a referencia oficial PT114 (2026-08-08).
   A barra de acoes dos edificios precede o seletor e os recursos, tal como
   no cliente classico, e evita uma segunda navegacao global redundante. */
@media (min-width: 981px) {
  body.game-page .page.classic-frame,
  body.game-page .page,
  body.game-page .game-footer {
    width: min(940px, calc(100vw - 24px));
  }

  body.game-page .page.classic-frame,
  body.game-page .page {
    margin-top: 0;
  }
}

body.game-page .tw-top {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(470px, 1.65fr);
  gap: 6px 0;
  overflow: visible;
  background: transparent;
  border: 0;
  box-shadow: none;
}

body.game-page .tw-quicknav {
  order: -3;
  grid-column: 1 / -1;
  justify-content: center;
  min-height: 32px;
  padding: 2px 8px;
  overflow-x: auto;
  color: #4b2509;
  background: #ead19a url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #aa7e3f;
  box-shadow: inset 0 0 0 1px rgba(255, 246, 209, .58);
}

body.game-page .tw-quicknav a {
  flex: 0 0 auto;
  padding: 5px 8px;
  color: #4b2509;
  border-right: 1px solid #c29a5a;
  font-weight: 700;
  text-shadow: 0 1px rgba(255, 246, 209, .65);
  white-space: nowrap;
}

body.game-page .tw-quicknav a:hover,
body.game-page .tw-quicknav a:focus-visible {
  color: #751b0d;
  background: rgba(255, 249, 220, .55);
}

body.game-page .tw-village-title,
body.game-page .tw-resbar,
body.game-page .tw-statusline {
  color: #3f260e;
  background: #e9d39d url("/assets/graphic/background/table.jpg") repeat;
  border: 1px solid #b68a49;
  box-shadow: inset 0 0 0 1px rgba(255, 247, 217, .52);
}

body.game-page .tw-village-title {
  order: -2;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 27px;
  padding: 3px 8px;
}

body.game-page .tw-village-title h1 {
  margin: 0;
  font-size: 12px;
  line-height: 1.2;
}

body.game-page .tw-village-title p {
  margin: 0;
  font-size: 11px;
  line-height: 1.2;
}

body.game-page .tw-village-title p::before {
  content: "\00b7 ";
}

body.game-page .tw-resbar {
  order: -2;
  min-height: 27px;
  padding: 3px 7px;
}

body.game-page .tw-statusline {
  order: -1;
  grid-column: 1 / -1;
  min-height: 24px;
  padding: 3px 8px;
  font-size: 11px;
}

body.game-page .screen-tabs-panel {
  display: none !important;
}

body.game-page .village-view-tabs {
  justify-content: flex-start;
  margin: 8px 0 0;
}

body.game-page .building-screen-head h2 {
  font-size: 20px;
}

body.game-page .screen-main-panel .main-building-summary,
body.game-page .screen-market-panel .market-summary,
body.game-page .screen-place-panel .place-summary {
  display: none;
}

/* As vistas do Edificio Principal sao estados de URL reais; o servidor envia
   apenas a tabela ativa, como no cliente oficial. */

@media (max-width: 820px) {
  body.game-page .tw-top {
    grid-template-columns: 1fr;
  }

  body.game-page .tw-quicknav,
  body.game-page .tw-village-title,
  body.game-page .tw-resbar,
  body.game-page .tw-statusline {
    grid-column: 1;
  }

  body.game-page .tw-quicknav {
    justify-content: flex-start;
    flex-wrap: nowrap;
  }
}

/* Reaplica a composicao da segunda calibracao depois dos overrides legados
   com !important que tornam todos os paineis de ecras block. */
body.game-page .game-grid.screen-academy .screen-academy-panel {
  display: grid !important;
  grid-template-columns: 120px minmax(0, 1fr);
}

body.game-page .screen-academy-panel > .building-classic-menu {
  display: grid;
}

body.game-page .game-grid .recruit-queue-subpanel:not(:has(table)) {
  display: none !important;
}

body.game-page .message-table th:nth-child(2),
body.game-page .message-table td:nth-child(2),
body.game-page .message-table th:nth-child(4),
body.game-page .message-table td:nth-child(4) {
  display: table-cell;
}

@media (max-width: 820px) {
  body.game-page .game-grid.screen-academy .screen-academy-panel {
    grid-template-columns: 1fr;
  }

  body.game-page .screen-academy-panel > .building-classic-menu {
    display: flex;
  }

  body.game-page .message-table th:nth-child(4),
  body.game-page .message-table td:nth-child(4) {
    display: none;
  }
}
.village-favorite-form { display: inline-flex; margin-right: 4px; vertical-align: middle; }
.village-favorite-form button { min-width: 24px; padding: 1px 4px; color: #8a5a00; font-size: 16px; line-height: 1; }
.village-dynamic-group-create { display: inline-block; position: relative; }
.village-dynamic-group-create > summary { cursor: pointer; font-weight: 700; color: #5d3608; }
.village-dynamic-group-create[open] form { margin-top: 6px; padding: 6px; border: 1px solid #c7a15d; background: #f4e4b8; }
.map-cell.relic-range{box-shadow:inset 0 0 0 2px rgba(126,70,168,.38)}
.map-cell.relic-source{box-shadow:inset 0 0 0 3px rgba(111,32,151,.82),0 0 5px rgba(111,32,151,.7)}

/* WCAG keyboard baseline: bypass repeated navigation and preserve a visible
   focus indicator without changing the mouse/pointer presentation. */
.skip-link {
  position: fixed;
  top: 4px;
  left: 4px;
  z-index: 10000;
  padding: 8px 12px;
  color: #fff;
  background: #241207;
  border: 2px solid #f7e35c;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid #f7e35c;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

.operations-dashboard{max-width:1180px;margin:0 auto}.operations-dashboard__header{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1rem;border:1px solid #85551f;background:#ead097}.operations-dashboard__header h1{margin:0}.operations-dashboard__header p{margin:.25rem 0 0}.ops-status{min-width:110px;padding:.55rem .8rem;border:1px solid;text-align:center;font-weight:700;text-transform:uppercase}.ops-status--ok{color:#174b1c;background:#d7efcf;border-color:#4d8c50}.ops-status--warning{color:#684800;background:#fff0b6;border-color:#c29020}.ops-status--critical{color:#6b1010;background:#f7caca;border-color:#b53c3c}.ops-metric-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:.45rem;margin:.65rem 0}.ops-metric-grid article{display:flex;min-width:0;min-height:72px;flex-direction:column;justify-content:center;padding:.55rem;border:1px solid #a87b3c;background:#f1dfb4;text-align:center}.ops-metric-grid strong{font-size:1.28rem;overflow-wrap:anywhere}.ops-metric-grid span{font-size:.78rem}.operations-dashboard__grid{grid-template-columns:repeat(2,minmax(0,1fr))}.ops-definition-list{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.35rem .8rem}.ops-definition-list dt,.ops-definition-list dd{margin:0;padding:.25rem;border-bottom:1px solid #dbc38c}.ops-definition-list dd{text-align:right;font-weight:700}.ops-severity{display:inline-block;padding:.15rem .35rem;border-radius:2px;font-size:.72rem;font-weight:700;text-transform:uppercase}.ops-severity--critical{background:#9f2525;color:#fff}.ops-severity--warning{background:#d59a20;color:#271500}.ops-alert--active{background:#fff2d0}.operations-dashboard code{word-break:break-all}@media(max-width:900px){.ops-metric-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}@media(max-width:620px){.operations-dashboard__header{align-items:flex-start;flex-direction:column}.ops-metric-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.operations-dashboard__grid{grid-template-columns:1fr}.operations-dashboard .compact-table{display:block;overflow-x:auto}}
.game-quickbar{display:flex;align-items:center;justify-content:center;gap:2px;min-height:31px;padding:3px 10px;background:#e9d294;border-bottom:1px solid #8b651e;box-shadow:0 1px 2px #0004;overflow-x:auto;white-space:nowrap}.game-quickbar a{display:inline-block;padding:4px 9px;border:1px solid #b08b43;background:#f7e7b8;color:#4d2708;font-weight:700;text-decoration:none}.game-quickbar a:hover,.game-quickbar a:focus-visible{background:#fff2c9}.game-quickbar .game-quickbar__edit{padding-inline:7px}.quickbar-add-form{display:grid;grid-template-columns:minmax(180px,1fr) minmax(220px,1.5fr) auto;align-items:end;gap:10px}.quickbar-add-form label{display:grid;gap:4px}.quickbar-row-actions,.quickbar-row-actions form{display:flex;gap:4px}.quickbar-links-table code{overflow-wrap:anywhere}@media(max-width:700px){.game-quickbar{justify-content:flex-start}.quickbar-add-form{grid-template-columns:1fr}.quickbar-row-actions{align-items:flex-start;flex-direction:column}}
.village-notepad form{display:flex;flex-wrap:wrap;gap:4px}.village-notepad textarea{box-sizing:border-box;width:100%;min-height:62px;resize:vertical}
.nav-notification{display:inline-block;min-width:1.2em;padding:0 .25em;border-radius:8px;background:#f2b313;color:#2b1305;font-size:.75em;text-align:center}
body.managed-dense_tables table th,body.managed-dense_tables table td{padding-top:2px!important;padding-bottom:2px!important}
body.managed-highlight_countdowns [data-countdown],body.managed-highlight_countdowns time{font-weight:700;color:#8a2d18}
body.managed-reduced_motion *,body.managed-reduced_motion *::before,body.managed-reduced_motion *::after{animation-duration:.001ms!important;animation-iteration-count:1!important;scroll-behavior:auto!important;transition-duration:.001ms!important}

/* Human visual review PT114/PT115 - convergence pass 2026-08-14.
   These rules intentionally sit after the legacy theme layers so the shared
   shell, surfaces and tactical map have one authoritative classic treatment. */
body.game-page {
  --tw-parchment: #f4e4b7;
  --tw-parchment-soft: #f8edce;
  --tw-parchment-deep: #ead19a;
  --tw-header: #d3ad64;
  --tw-border: #9a6b2f;
  --tw-ink: #2c1606;
  color: var(--tw-ink);
  font-family: Verdana, Arial, sans-serif;
  font-size: 12px;
}

body.game-page .topbar {
  position: relative;
  min-height: 49px;
  padding: 4px max(8px, calc((100vw - 1010px) / 2));
  background-color: #6b160f;
  background-image: linear-gradient(rgba(122, 34, 23, .28), rgba(57, 8, 5, .32)), url("/assets/graphic/background/navi.png");
  border-top: 2px solid #d3a24c;
  border-bottom: 3px solid #3b170b;
  box-shadow: 0 1px 0 #d8b062, 0 3px 6px rgba(30, 11, 3, .45);
}

body.game-page .topbar > form {
  display: none;
}

body.game-page .game-main-nav {
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  overflow: visible;
}

body.game-page .game-main-nav a {
  min-height: 34px;
  padding: 8px 13px 7px;
  color: #fff0bd;
  background-color: #43110b;
  background-image: linear-gradient(rgba(97, 27, 19, .35), rgba(30, 5, 3, .45)), url("/assets/graphic/background/navi.png");
  border: 1px solid #160402;
  border-radius: 4px;
  box-shadow: 0 0 0 2px rgba(201, 142, 64, .55), inset 0 1px rgba(255, 226, 151, .24), 0 2px 3px rgba(0, 0, 0, .5);
  font-size: 12px;
  text-shadow: 0 1px #120301;
}

body.game-page .game-main-nav a:hover,
body.game-page .game-main-nav a.active {
  color: #fff8df;
  background-color: #752015;
  box-shadow: 0 0 0 2px rgba(226, 171, 85, .72), inset 0 1px rgba(255, 235, 174, .35), 0 2px 4px rgba(0, 0, 0, .55);
}

body.game-page .page.classic-frame,
body.game-page .page {
  width: min(910px, calc(100vw - 24px));
  margin-top: 13px;
  padding: 10px 11px 20px;
  background-color: var(--tw-parchment);
  background-image: url("/assets/graphic/screen/content_bg.png");
  border-color: #704319;
  box-shadow: 0 0 0 2px #c89e58, inset 0 0 0 1px rgba(255, 248, 218, .82), 0 4px 12px rgba(35, 17, 5, .42);
}

body.game-page .panel,
body.game-page .screen-panel,
body.game-page .classic-frame .panel {
  background-color: var(--tw-parchment);
  background-image: url("/assets/graphic/screen/content_bg.png");
  border-color: var(--tw-border);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 218, .72);
}

body.game-page .screen-panel {
  padding: 12px 14px 15px;
}

body.game-page .screen-panel > h2,
body.game-page .panel > h2,
body.game-page .panel-title-row,
body.game-page .classic-table th,
body.game-page .compact-table th,
body.game-page .settings-table th {
  color: var(--tw-ink);
  background-color: var(--tw-header);
  border-color: #a87a38;
}

body.game-page table,
body.game-page .classic-table,
body.game-page .compact-table,
body.game-page .building-table,
body.game-page .market-table,
body.game-page .recruit-classic-table,
body.game-page .settings-table {
  background-color: var(--tw-parchment-soft);
  background-image: none;
  border-color: #b68a4c;
}

body.game-page table tbody tr:nth-child(odd) > td {
  background-color: rgba(249, 237, 204, .7);
}

body.game-page table tbody tr:nth-child(even) > td {
  background-color: rgba(239, 216, 164, .58);
}

body.game-page th,
body.game-page td,
body.game-page .compact-table th,
body.game-page .compact-table td {
  border-color: #dcc28b;
}

body.game-page .tw-top {
  gap: 6px 0;
  margin-bottom: 8px;
}

body.game-page .tw-quicknav {
  min-height: 43px;
  padding: 6px 10px;
  background-color: #f1dcaa;
  border-color: #b48342;
}

body.game-page .tw-quicknav a {
  min-height: 27px;
  padding: 5px 8px;
  color: #5b2e09;
  border-right-color: #c8a15e;
  font-size: 12px;
}

body.game-page .tw-village-title,
body.game-page .tw-resbar {
  min-height: 28px;
  background-color: #ead29c;
  border-color: #a87838;
}

body.game-page .tw-village-title h1 {
  white-space: nowrap;
}

body.game-page .tw-village-title h1 span {
  font-weight: 700;
}

body.game-page .tw-village-title p {
  display: none;
}

body.game-page .tw-statusline {
  display: none;
}

body.game-page .tw-overview-layout {
  grid-template-columns: minmax(0, 1fr) 188px;
  gap: 9px;
}

body.game-page .village-visual {
  max-width: 660px;
  margin-bottom: 10px;
}

body.game-page .tw-overview-sidebar section {
  background-color: var(--tw-parchment-soft);
  background-image: none;
  border-color: #a8793b;
}

body.game-page .tw-overview-sidebar h3 {
  background-color: var(--tw-header);
  border-color: #a8793b;
}

body.game-page .building-screen-head {
  align-items: flex-start;
  min-height: 105px;
  margin: 2px 6px 12px;
}

body.game-page .building-screen-head > img {
  width: 104px;
  height: 92px;
  object-fit: contain;
  image-rendering: auto;
}

body.game-page .building-screen-head h2 {
  margin: 8px 0 5px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 21px;
  font-style: normal;
}

body.game-page .building-screen-head p {
  max-width: 650px;
  margin: 0;
  line-height: 1.35;
}

body.game-page .official-building-table th:first-child {
  width: 24%;
}

body.game-page .official-building-table th:last-child {
  width: 29%;
}

body.game-page .official-building-table td {
  min-height: 39px;
  padding: 3px 5px;
}

body.game-page .official-building-table .building-identity {
  gap: 7px;
}

body.game-page .official-building-table .building-identity > img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

body.game-page .official-building-table .building-identity > span {
  display: grid;
  gap: 1px;
}

body.game-page .official-building-table .building-identity small,
body.game-page .official-building-table .build-state,
body.game-page .official-building-table .building-requirement-inline {
  display: block;
  font-size: 10px;
}

body.game-page .official-building-table .resource-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  align-items: center;
}

body.game-page .official-building-table td:last-child form {
  display: inline-block;
  margin-right: 7px;
}

body.game-page .official-building-table td:last-child button {
  min-width: 126px;
}

body.game-page .building-complete {
  display: block;
  color: #b38a4b;
  text-align: center;
}

body.game-page .screen-map-panel > h2 {
  margin: 0 0 14px;
  padding: 0;
  background: transparent;
  border: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 21px;
  font-style: normal;
}

body.game-page .map-classic-board {
  grid-template-columns: minmax(0, 1fr) 270px;
  background-color: var(--tw-parchment);
}

body.game-page .map-grid {
  gap: 0;
  padding: 0;
  border: 1px solid #34551e;
  background: #6f963b;
}

body.game-page .map-cell {
  min-height: 39px;
  padding: 0;
  border-color: rgba(47, 83, 28, .68);
  box-shadow: none;
}

body.game-page .map-cell-terrain-sprite {
  opacity: 1;
  image-rendering: auto;
}

body.game-page .map-cell-icon,
body.game-page .map-cell.point-band-medium .map-cell-icon,
body.game-page .map-cell.point-band-large .map-cell-icon {
  top: 50%;
  width: 48px;
  height: 48px;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .38));
}

body.game-page .map-cell-coords,
body.game-page .map-cell-name {
  display: none;
}

body.game-page .map-cell.selected::before,
body.game-page .map-cell:hover::before,
body.game-page .map-cell:focus-visible::before {
  inset: 1px;
  border-color: #fff7d2;
}

body.game-page .game-footer {
  width: min(910px, calc(100vw - 24px));
  margin-top: -42px;
  background-color: #d8ba77;
}

@media (max-width: 980px) {
  body.game-page .game-main-nav {
    justify-content: flex-start;
    gap: 4px;
    overflow-x: auto;
  }

  body.game-page .game-main-nav a {
    padding-inline: 9px;
  }
}

@media (max-width: 820px) {
  body.game-page .tw-statusline {
    display: flex;
  }

  body.game-page .tw-overview-layout {
    grid-template-columns: 1fr;
  }

  body.game-page .official-building-table {
    min-width: 680px;
  }

  body.game-page .screen-main-panel {
    overflow-x: auto;
  }
}

/* Final cascade authority for the PT114 human-review follow-up. */
body.game-page .game-grid.screen-market .screen-market-panel {
  display: grid !important;
  grid-template-columns: 170px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
}

body.game-page .game-main-nav a {
  color: #fff0c0;
  background-color: #35100a;
  background-image: linear-gradient(#6a281b 0%, #3a120b 48%, #210905 100%);
  border-color: #160503;
  box-shadow: 0 0 0 1px rgba(222, 166, 88, .42) inset, 0 1px 3px rgba(0, 0, 0, .72);
}

body.game-page .game-main-nav a:hover,
body.game-page .game-main-nav a.active {
  color: #fff7d7;
  background-color: #6f2113;
  background-image: linear-gradient(#8b3522 0%, #5a1c11 52%, #2c0b06 100%);
}

body.game-page .screen-market-panel > .building-screen-head {
  grid-column: 1 / -1;
}

body.game-page .screen-market-panel > .market-classic-menu {
  grid-column: 1;
  grid-row: 2 / span 30;
  display: flex;
  flex-direction: column;
  align-self: start;
  margin: 0;
}

body.game-page .screen-market-panel > .market-classic-menu a {
  width: 100%;
  border-right: 0;
  border-bottom: 1px solid #c29a5a;
}

body.game-page .screen-market-panel > :not(.building-screen-head):not(.market-classic-menu) {
  grid-column: 2;
}

body.game-page .screen-place-panel .place-summary,
body.game-page .screen-market-panel .market-summary,
body.game-page .reports-classic-page .reports-page-summary,
body.game-page .reports-classic-page .report-type-filter-row {
  display: none !important;
}

body.game-page .screen-place-panel .place-command-layout {
  grid-template-columns: 1fr;
}

body.game-page .screen-place-panel .place-command-box:nth-child(2) {
  order: 1;
}

body.game-page .screen-place-panel .place-command-box:first-child {
  order: 2;
  max-width: 620px;
}

body.game-page .screen-place-panel .place-unit-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.game-page .reports-classic-page {
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px;
}

body.game-page .reports-classic-page .classic-page-main {
  gap: 0;
}

body.game-page .reports-classic-page .map-controls {
  grid-template-columns: 112px 100px 92px minmax(160px, 1fr) auto;
}

body.game-page .reports-classic-page .map-controls .button-link {
  display: none;
}

@media (max-width: 820px) {
  body.game-page .game-grid.screen-market .screen-market-panel {
    display: block !important;
  }

  body.game-page .screen-market-panel > .market-classic-menu {
    flex-direction: row;
    margin-bottom: 8px;
  }

  body.game-page .screen-market-panel > .market-classic-menu a {
    width: auto;
    border-right: 1px solid #c29a5a;
  }

  body.game-page .screen-place-panel .place-unit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.game-page .reports-classic-page {
    grid-template-columns: 1fr;
  }

  body.game-page .reports-classic-page .map-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Authentic Tribal Wars Visual Enhancements */
.tw-village-heading-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.village-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  color: #5a2c0c;
  background: #ecd5a4 linear-gradient(to bottom, #fff0cb, #d2ae6d);
  border: 1px solid #7d4d1e;
  border-radius: 2px;
  font-size: 14px;
  font-weight: bold;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: background 0.15s, color 0.15s;
}

.village-arrow:hover {
  color: #8c1e0b;
  background: #fff4d7 linear-gradient(to bottom, #ffffff, #e4c284);
  border-color: #5a1c11;
}

.unit-fill-link,
.recruit-max-link {
  display: inline-block;
  margin-left: 3px;
  color: #7b2611;
  font-size: 11px;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  padding: 1px 3px;
  background: rgba(220, 180, 120, 0.25);
  border-radius: 2px;
}

.unit-fill-link:hover,
.recruit-max-link:hover {
  color: #b01c05;
  text-decoration: underline;
  background: rgba(220, 180, 120, 0.5);
}

.place-button-row {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  justify-content: flex-start;
}

.btn-attack,
body.game-page button.btn-attack,
body.game-page input[type="submit"].btn-attack {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 16px;
  font-size: 13px;
  font-weight: bold;
  color: #fff9e0;
  background: #7d2617 linear-gradient(to bottom, #9d3927 0%, #681c10 50%, #450f06 100%);
  border: 1px solid #320a04;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(255, 200, 180, 0.4), 0 2px 4px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px #1e0502;
  cursor: pointer;
}

.btn-attack:hover,
body.game-page button.btn-attack:hover {
  color: #ffffff;
  background: #90301e linear-gradient(to bottom, #b44530 0%, #7d2315 50%, #56140a 100%);
  box-shadow: inset 0 1px 0 rgba(255, 220, 200, 0.5), 0 2px 6px rgba(100, 20, 10, 0.45);
}

.btn-support,
body.game-page button.btn-support,
body.game-page input[type="submit"].btn-support {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 16px;
  font-size: 13px;
  font-weight: bold;
  color: #fff9e0;
  background: #2b557a linear-gradient(to bottom, #3b719e 0%, #224768 50%, #152f46 100%);
  border: 1px solid #0d2133;
  border-radius: 3px;
  box-shadow: inset 0 1px 0 rgba(190, 225, 255, 0.4), 0 2px 4px rgba(0, 0, 0, 0.35);
  text-shadow: 0 1px 2px #0a1824;
  cursor: pointer;
}

.btn-support:hover,
body.game-page button.btn-support:hover {
  color: #ffffff;
  background: #366792 linear-gradient(to bottom, #4784b8 0%, #2c587e 50%, #1c3b57 100%);
  box-shadow: inset 0 1px 0 rgba(210, 235, 255, 0.5), 0 2px 6px rgba(20, 50, 80, 0.45);
}

.btn-recruit,
body.game-page button.btn-recruit,
body.game-page input[type="submit"].btn-recruit {
  min-height: 24px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: bold;
  color: #2b1404;
  background: #d8a855 linear-gradient(to bottom, #f3cf80 0%, #c4903a 50%, #9e6d20 100%);
  border: 1px solid #583707;
  border-radius: 2px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 220, 0.6), 0 1px 2px rgba(0, 0, 0, 0.25);
  text-shadow: 0 1px 0 rgba(255, 245, 210, 0.6);
  cursor: pointer;
}

.btn-recruit:hover,
body.game-page button.btn-recruit:hover {
  color: #1a0a01;
  background: #e6b965 linear-gradient(to bottom, #ffdc91 0%, #d49f47 50%, #ad7b28 100%);
}

.btn-recruit:disabled,
body.game-page button.btn-recruit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(60%);
}

/* Classic Table Row Polish */
body.game-page table.compact-table tbody tr:nth-child(even),
body.game-page table.vis tbody tr:nth-child(even) {
  background-color: #f0e2be;
}

body.game-page table.compact-table tbody tr:nth-child(odd),
body.game-page table.vis tbody tr:nth-child(odd) {
  background-color: #fdf8e8;
}

body.game-page table.compact-table tbody tr:hover,
body.game-page table.vis tbody tr:hover {
  background-color: #fff0cc !important;
}

/* Resource bar styling polish */
body.game-page .tw-resbar span {
  font-family: Verdana, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

body.game-page .tw-resbar img {
  vertical-align: middle;
  image-rendering: auto;
}

/* Quick Navigation Bar Polish */
body.game-page .tw-quicknav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 3px 6px;
  background: #dfcaa0 url("/assets/graphic/screen/tableheader_bg3.png") repeat-x;
  border: 1px solid #7a4f20;
  border-top: 0;
  grid-column: 1 / -1;
}

body.game-page .tw-quicknav a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  color: #3b1e06;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 2px;
  transition: background 0.15s, color 0.15s;
}

body.game-page .tw-quicknav a:hover {
  color: #7b1c0c;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

body.game-page .tw-quicknav a img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

/* ==========================================================================
   Tribal Wars Official Parity - Screen Train / Recruitment (PT114)
   ========================================================================== */
.recruit-screen-head h2 {
  margin: 0 0 4px 0;
  font-size: 16px;
  font-weight: bold;
  color: #603000;
}

.recruit-groups-line {
  margin: 2px 0 6px 0;
  font-size: 12px;
  color: #3b1e06;
}

.recruit-groups-line strong {
  color: #603000;
}

.recruit-description-line {
  margin: 0 0 14px 0;
  font-size: 11px;
  color: #4a2808;
  line-height: 1.4;
}

.building-classic-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
  padding-bottom: 6px;
  border-bottom: 1px solid #c1a273;
}

.building-classic-menu a {
  padding: 3px 8px;
  color: #603000;
  font-size: 12px;
  font-weight: bold;
  text-decoration: none;
  border-radius: 3px;
  background: #ecd5a8;
  border: 1px solid #bba172;
}

.building-classic-menu a:hover,
.building-classic-menu a.active {
  color: #ffffff;
  background: #7d510f;
  border-color: #5a3a0b;
}

/* Vis Tables */
table.vis {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #7d510f;
  background: #f4e4c1;
  font-size: 12px;
  margin-bottom: 12px;
}

table.vis th {
  background: #dfcca6;
  background: linear-gradient(to bottom, #f2e3c6 0%, #dfcca6 100%);
  color: #381b02;
  font-weight: bold;
  border: 1px solid #7d510f;
  padding: 5px 8px;
  text-align: left;
}

table.vis td {
  border: 1px solid #7d510f;
  padding: 4px 8px;
  color: #3b1e06;
  vertical-align: middle;
}

table.vis tbody tr:nth-child(odd) {
  background-color: #f0e2be;
}

table.vis tbody tr:nth-child(even) {
  background-color: #fdf8e8;
}

table.vis tbody tr:hover {
  background-color: #fff0cc;
}

.unit-cell {
  font-weight: bold;
  color: #603000;
}

.unit-icon {
  width: 18px;
  height: 18px;
  vertical-align: middle;
  margin-right: 6px;
}

.unit-grayscale {
  filter: grayscale(100%) opacity(0.6);
}

.cost-cell {
  white-space: nowrap;
}

.cost-chip-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.cost-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #331500;
  font-size: 11px;
}

.cost-chip.cost-shortage {
  color: #a00000;
  font-weight: bold;
}

.cost-time {
  font-family: inherit;
  color: #4a2808;
}

.recruit-input-cell {
  white-space: nowrap;
}

.amount-input {
  width: 55px;
  height: 20px;
  padding: 1px 4px;
  border: 1px solid #7d510f;
  border-radius: 2px;
  font-size: 12px;
  text-align: right;
  background: #ffffff;
  color: #000;
}

.amount-input:disabled {
  background: #e8dcc4;
  color: #54391e;
}

.recruit-max-link {
  display: inline-block;
  color: #004b7a;
  font-weight: bold;
  text-decoration: none;
  font-size: 11px;
  margin-left: 4px;
  cursor: pointer;
}

.recruit-max-link:hover {
  text-decoration: underline;
  color: #002d4a;
}

.recruit-max-link.is-disabled {
  color: #6a4f32;
  font-weight: normal;
  cursor: default;
  text-decoration: none;
}

.btn-recruit-batch,
.btn-recruit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 16px;
  font-size: 12px;
  font-weight: bold;
  color: #ffffff;
  background: #8b5a2b;
  background: linear-gradient(to bottom, #8a5a22 0%, #5e370a 100%);
  border: 1px solid #3c1e00;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  text-shadow: 0 1px 1px #000;
}

.btn-recruit-batch:hover,
.btn-recruit:hover {
  background: linear-gradient(to bottom, #9d682a 0%, #6e410d 100%);
}

.btn-recruit-batch img,
.btn-recruit img {
  width: 14px;
  height: 14px;
}

.requirements-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.req-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #3b1e06;
}

.req-badge img {
  width: 16px;
  height: 16px;
  vertical-align: middle;
}

.req-research {
  color: #8c2c10;
  font-weight: bold;
}

.btn-tw-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: bold;
  color: #ffffff !important;
  background: #7d510f linear-gradient(to bottom, #8a5a22 0%, #5e370a 100%);
  border: 1px solid #3c1e00;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  text-shadow: 0 1px 1px #000;
  text-decoration: none;
}

.btn-tw-action:hover:not(:disabled) {
  background: #8a5a22 linear-gradient(to bottom, #9d682a 0%, #6e410d 100%);
  color: #fff !important;
}

.btn-tw-action:disabled,
.btn-tw-action.is-disabled {
  background: #8e7b6d linear-gradient(to bottom, #96867a 0%, #756559 100%);
  border-color: #55483d;
  color: #d1c8be !important;
  cursor: not-allowed;
  box-shadow: none;
  text-shadow: none;
  opacity: 0.85;
}

.building-big-icon {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.building-help-link {
  font-size: 11px;
  color: #603000;
  text-decoration: none;
}

.building-help-link:hover {
  text-decoration: underline;
}

.cost-shortage {
  color: #c00 !important;
  font-weight: bold;
}

.is-muted-row {
  opacity: 0.75;
}

.building-maxed-row {
  background-color: #fdf6e2;
}

.building-locked-row {
  background-color: #f4ece1;
}

.smith-unit-card:hover {
  background: rgba(255,255,255,0.4);
  border-radius: 3px;
}


