@font-face {
  font-family: Vazirmatn;
  src: url('/fonts/vazirmatn.woff2') format('woff2');
  font-display: swap;
  font-weight: 100 900;
}
:root {
  --ink: #443b2b;
  --muted: #7c715a;
  --paper: #f6edcf;
  --paper-deep: #e7d8aa;
  --wood: #69482e;
  --gold: #d7ad50;
  --teal: #176e76;
  --line: #d4c294;
  --shadow: 0 5px 0 #3d38252b, 0 12px 24px #163c3b26;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #177e8d;
  background-image:
    radial-gradient(ellipse at 25% 0, #5cb6b8, transparent 60%), linear-gradient(110deg, #0d6879, #278d98);
  color: var(--ink);
  font-family: Vazirmatn, Tahoma, sans-serif;
  font-size: 14px;
  line-height: 1.8;
  min-height: 100vh;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button,
.button {
  cursor: pointer;
  border: 1px solid #ac8d53;
  background: linear-gradient(#f5e5b4, #e3cb8d);
  border-radius: 7px;
  color: #584327;
  font-weight: 650;
  padding: 8px 17px;
  box-shadow: 0 2px 0 #87663044;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.7;
  transition:
    filter 0.15s,
    transform 0.15s;
}
button:hover,
.button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}
button:active,
.button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
}
button.primary,
.button.primary {
  background: linear-gradient(#d5b354, #b58b34);
  border-color: #9a7529;
  color: #332a16;
  box-shadow:
    0 3px 0 #76551e,
    0 4px 8px #6a4c2022;
}
.danger {
  background: #f1d4bd;
  color: #913e29;
  border-color: #bc876a;
}
.ghost,
.text-button {
  background: transparent;
  box-shadow: none;
  border-color: transparent;
}
.small {
  font-size: 12px;
  padding: 5px 10px;
}
.text-button {
  font-size: 12px;
  color: #25646a;
  padding: 2px 5px;
}
.icon {
  width: 27px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
}
.primary .icon {
  width: 22px;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[role='button']:focus-visible {
  outline: 3px solid #2a91a4;
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2,
h3 {
  line-height: 1.5;
}
h2 {
  font-size: 20px;
}
h3 {
  font-size: 16px;
  margin-bottom: 9px;
}
p {
  margin-bottom: 15px;
}
small {
  font-size: 11px;
}
.muted,
small {
  color: var(--muted);
}
.center {
  text-align: center;
}
.loading {
  padding: 20vh 20px;
  text-align: center;
  color: white;
  font-size: 20px;
}
.eyebrow {
  display: block;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.5px;
  color: #8a7244;
  margin-bottom: 6px;
}
.game-shell {
  max-width: 1460px;
  margin: auto;
  padding: 0 35px;
}
.realm-banner {
  height: 162px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 37px;
  color: white;
  position: relative;
  background:
    linear-gradient(90deg, #1b6c7bd9, #1a576f0a 75%),
    url('/valley.webp') center 24% / cover;
  border-radius: 13px 13px 0 0;
  box-shadow: inset 0 0 0 1px #a6d4c255;
  overflow: hidden;
}
.realm-banner:before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(270deg, #143a45c9, transparent 80%);
}
.realm-banner > div {
  z-index: 1;
}
.realm-banner h1 {
  font-size: 27px;
  margin: 0 0 5px;
  color: #fff3cd;
  max-width: 700px;
  overflow-wrap: anywhere;
}
.realm-banner p {
  font-size: 12px;
  margin: 0;
  color: #d1e6d4;
}
.realm-banner .eyebrow {
  color: #cce2ce;
}
.seal {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 10px 0;
  min-width: 90px;
}
.seal .icon {
  position: absolute;
  width: 100px;
  height: 110px;
  top: -12px;
  stroke: #d8bb6a;
  fill: #214b50d6;
  stroke-width: 1.5;
  filter: drop-shadow(0 5px 3px #11363e);
}
.seal b,
.seal small {
  z-index: 1;
}
.seal b {
  font-size: 32px;
  color: #f3d58e;
  line-height: 1.6;
}
.seal small {
  font-size: 9px;
  color: #f1e6be;
}
.game-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 23px;
  align-items: start;
}
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.panel {
  background: var(--paper);
  background-image:
    radial-gradient(ellipse at 0 100%, #d7bd6e29, transparent 60%),
    repeating-linear-gradient(85deg, #6c4d1702 0 1px, transparent 1px 5px);
  border: 1px solid #b8ac7e;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 23px;
  min-width: 0;
}
.panel h2 {
  background: linear-gradient(#f5e8c3, #e8d5a3);
  border-bottom: 1px solid #c6b17d;
  font-size: 15px;
  font-weight: 750;
  padding: 12px 19px;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  min-height: 52px;
}
.panel h2 .icon {
  width: 22px;
  height: 25px;
  color: #8a6b32;
}
.panel-body {
  padding: 20px;
}
.sidebar .panel {
  margin: 0;
  text-align: center;
}
.sidebar .panel-body {
  padding: 17px;
}
.sidebar h3 {
  margin: 12px 0 0;
  overflow-wrap: anywhere;
}
.sidebar p {
  font-size: 11px;
  margin: 4px 0 12px;
}
.sidebar .progress {
  margin-bottom: 4px;
}
.sidebar .panel-body > a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: #e6d8ae;
  margin: 16px -17px -17px;
  padding: 9px;
  border-top: 1px solid #cdbb8a;
  font-size: 12px;
}
.sidebar .panel-body > a .icon {
  width: 18px;
}
.portrait {
  height: 190px;
  width: 100%;
  background: url('/valley.webp') 99% 66%/340% no-repeat;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px #82663d44,
    inset 0 -25px 40px #4c54352b;
  position: relative;
  border: 4px solid #d8c48e;
  outline: 1px solid #a58c58;
}
.portrait.orc {
  background-position: 0 68%;
  background-size: 335%;
}
.portrait.large {
  height: 350px;
  background-size: 310%;
  background-position: 100% 70%;
}
.portrait.large.orc {
  background-position: 0 70%;
  background-size: 325%;
}
.mini-stats {
  display: flex;
  justify-content: space-around;
  border-top: 1px solid #d8c99e;
  margin-top: 13px;
  padding-top: 11px;
  font-size: 11px;
}
.mini-stats span {
  display: flex;
  align-items: center;
  gap: 4px;
}
.mini-stats .icon {
  width: 17px;
  height: 20px;
  color: #91703c;
}
.side-links {
  background: #145a65aa;
  border: 1px solid #72afac66;
  border-radius: 8px;
  padding: 7px 14px;
  color: #e1e4cc;
}
.side-links a {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 8px 0;
  font-size: 12px;
  border-bottom: 1px solid #ffffff0c;
}
.side-links a:last-child {
  border: 0;
}
.side-links .icon {
  width: 19px;
  height: 21px;
  color: #d6c58c;
}
.side-links a:hover {
  color: #ffda7f;
}
.owl-guide {
  display: flex;
  gap: 9px;
  justify-content: flex-start;
  background: linear-gradient(#e5cb8b, #c2a264);
  border: 2px solid #8b6e3e;
  padding: 13px 10px;
  position: relative;
  box-shadow: var(--shadow);
}
.owl-guide .icon {
  width: 53px;
  height: 56px;
  stroke: #69522d;
  fill: #f5df9e55;
}
.owl-guide span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.owl-guide b {
  background: #9e5231;
  color: #fff0bc;
  min-width: 24px;
  height: 24px;
  line-height: 24px;
  font-size: 12px;
  border-radius: 50%;
  margin-right: auto;
}
.content {
  min-width: 0;
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  color: #ffedc2;
  min-height: 45px;
}
.section-heading h2 {
  margin: 0;
  font-size: 22px;
}
.section-heading .eyebrow {
  color: #b8d8d0;
  font-size: 10px;
  margin-bottom: 3px;
}
.section-heading > a {
  font-size: 12px;
}
.section-heading > div:last-child {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.badge {
  display: inline-flex;
  background: #e1d1a3;
  color: #665435;
  padding: 3px 10px;
  border: 1px solid #bba272;
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.7;
  white-space: nowrap;
}
.badge.gold {
  background: #d9ba6f;
  color: #493918;
  border-color: #f2d68b;
  box-shadow: 0 2px 0 #69501c44;
}
.badge.green {
  background: #c6d5a5;
  border-color: #9eaf7c;
  color: #3d562e;
}
.campaign-label span {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: #c8ddce;
}
.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 21px;
}
.mode-card {
  background: linear-gradient(125deg, #f4e3b8, #e0c88b);
  border: 1px solid #a48b51;
  border-radius: 8px;
  padding: 15px 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px #314e3d44;
  transition: transform 0.2s;
}
.mode-card:hover {
  transform: translateY(-3px);
}
.mode-card > .icon {
  width: 36px;
  height: 39px;
  color: #8d6b34;
  filter: drop-shadow(0 2px #fff8d6);
}
.mode-card h3 {
  font-size: 13px;
  margin: 0 0 3px;
}
.mode-card p {
  font-size: 9px;
  margin: 0;
  color: #74613f;
}
.mode-card > span {
  margin-right: auto;
  color: #88652f;
}
.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.two-col > .panel {
  margin-bottom: 20px;
}
.economy-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 13px;
}
.economy-row b {
  font-weight: 650;
  color: #746039;
}
.economy-row.total {
  border-top: 1px dashed #c7b482;
  padding-top: 12px;
  font-size: 14px;
}
.economy-row.total b {
  color: #537343;
}
.stat-strip {
  display: flex;
  gap: 12px;
  justify-content: space-around;
  flex-wrap: wrap;
  border: 1px solid #ccbb8e;
  border-radius: 6px;
  background: #e9dbb5;
  padding: 12px;
  margin: 15px 0;
}
.stat-strip > span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
}
.stat-strip .icon {
  width: 22px;
  color: #8b703c;
}
.mission-brief {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px dashed #cbbb8c;
}
.mission-brief > .icon {
  width: 30px;
  height: 36px;
  color: #9c793d;
}
.mission-brief > div {
  flex: 1;
}
.mission-brief b {
  font-size: 12px;
}
.mission-brief small {
  display: block;
}
.quest-progress {
  display: flex;
  gap: 14px;
  align-items: center;
}
.quest-progress .icon {
  width: 70px;
  height: 75px;
  color: #8d733e;
}
.quest-progress p {
  font-size: 12px;
}
.progress {
  height: 7px;
  background: #d9cca4;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: inset 0 1px 2px #66542122;
}
.progress i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #768d48, #abb86c);
  border-radius: 5px;
  transition: width 0.4s;
}
.panel-body > a:not(.button) {
  color: #47716b;
  font-size: 12px;
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.panel-body > a .icon {
  width: 19px;
}
.hero-layout {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(300px, 1.8fr);
  gap: 20px;
}
.attribute {
  display: grid;
  grid-template-columns: 75px 1fr auto;
  gap: 12px;
  align-items: center;
  margin: 17px 0;
  font-size: 12px;
}
.attribute b {
  font-weight: 650;
  min-width: 100px;
  text-align: left;
}
.attribute small {
  font-weight: 400;
}
.training-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.training {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  padding: 12px;
}
.training .icon {
  width: 23px;
}
.training b {
  font-size: 12px;
}
.training small {
  width: 100%;
  font-size: 10px;
  padding-right: 32px;
}
.skills-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}
.skills-grid > div {
  text-align: center;
  border: 1px solid #cdbb8e;
  border-radius: 6px;
  padding: 12px 5px;
  background: #e9dcb6;
}
.skills-grid .icon {
  display: block;
  margin: 0 auto 10px;
  color: #8c723f;
}
.skills-grid b,
.skills-grid span,
.skills-grid small {
  display: block;
  font-size: 11px;
}
.barracks-art {
  height: 125px;
  background: radial-gradient(ellipse, #dfc685, transparent 70%);
  display: flex;
  justify-content: center;
  align-items: center;
}
.barracks-art .icon {
  width: 105px;
  height: 105px;
  stroke-width: 1;
  stroke: #856735;
  filter: drop-shadow(0 3px #fff5d0);
}
.big-number {
  font-size: 65px;
  color: #8c713d;
  text-align: center;
  line-height: 1.3;
  margin: 40px 0;
}
.big-number small {
  display: block;
  font-size: 14px;
}
.troop-training {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 28px;
}
.training-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  border-bottom: 1px dashed #cdbb8f;
  padding: 9px 0 16px;
  font-size: 12px;
}
.training-row .progress {
  align-self: center;
}
.training-row b {
  font-weight: 600;
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 13px;
}
input:not([type='checkbox']):not([type='range']),
textarea,
select {
  display: block;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #c2b083;
  border-radius: 6px;
  background: #fff9e6;
  color: #453d2c;
  box-shadow: inset 0 1px 3px #826b2920;
  min-height: 43px;
  margin-top: 5px;
}
input[type='email'],
input[type='password'] {
  direction: ltr;
  text-align: left;
}
input[type='range'] {
  display: block;
  width: 100%;
  accent-color: #a0843c;
  margin-top: 10px;
}
input[type='checkbox'] {
  accent-color: #8e773b;
  width: 17px;
  height: 17px;
}
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 400;
}
textarea {
  min-height: 95px;
  resize: vertical;
}
form > button[type='submit'] {
  min-width: 120px;
}
form .two-col {
  gap: 0 20px;
}
.form-error {
  font-size: 12px;
  color: #a13c28;
  white-space: pre-line;
}
.form-error:empty {
  display: none;
}
.cost-preview {
  font-size: 12px;
  color: #696039;
}
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 15px;
}
.item-card {
  border: 1px solid #c8b380;
  border-radius: 8px;
  background: linear-gradient(#f8edcf, #eadbb0);
  padding: 14px;
  text-align: center;
  display: flex;
  align-items: center;
  flex-direction: column;
  min-width: 0;
  position: relative;
}
.item-card.equipped {
  border: 2px solid #8ca566;
  background: #ecedcf;
}
.item-card .badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
}
.item-art {
  width: 83px;
  height: 83px;
  background: radial-gradient(circle, #e0c487aa, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 7px;
}
.item-art .icon {
  width: 54px;
  height: 57px;
  color: #8c6b33;
  stroke-width: 1.7;
  filter: drop-shadow(1px 3px 0 #c3ae76);
}
.item-card h3 {
  font-size: 13px;
}
.item-card p {
  font-size: 11px;
  color: #7a6845;
  margin-bottom: 8px;
  flex: 1;
}
.item-card small {
  font-size: 9px;
  display: block;
  margin-bottom: 10px;
}
.item-card > b {
  font-size: 13px;
  margin-bottom: 10px;
}
.item-actions {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 5px 0;
  flex-wrap: wrap;
}
.filter-bar {
  display: grid;
  grid-template-columns: 1fr 1.4fr 1fr auto;
  align-items: end;
  gap: 13px;
  padding: 15px;
  background: #e8d8a9;
  border-radius: 8px;
  margin-bottom: 20px;
}
.filter-bar label {
  margin: 0;
}
.filter-bar button {
  height: 42px;
}
.table-scroll {
  overflow-x: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12px;
  text-align: right;
}
th {
  font-size: 11px;
  color: #85734d;
  background: #e9dcb6;
  border-bottom: 1px solid #c4ae7e;
  padding: 10px 12px;
  white-space: nowrap;
}
td {
  padding: 12px;
  border-bottom: 1px solid #dbcda7;
  max-width: 300px;
  overflow-wrap: anywhere;
}
td button {
  margin: 3px;
}
tbody tr:last-child td {
  border: 0;
}
tbody tr:nth-child(even) {
  background: #f0e5c6;
}
.empty {
  padding: 25px 5px;
  text-align: center;
  color: #9a865a;
  font-size: 12px;
  margin: 0;
}
.empty .icon {
  display: block;
  margin: 0 auto 10px;
  width: 42px;
  height: 45px;
  opacity: 0.7;
}
.alliance-grid,
.race-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.alliance-card {
  border: 1px solid #c7b487;
  border-radius: 7px;
  text-align: center;
  padding: 20px;
  background: #ecdfb7;
  display: flex;
  align-items: center;
  flex-direction: column;
}
.alliance-card > .icon {
  width: 65px;
  height: 70px;
  stroke: #9c793a;
  fill: #d9be7d55;
  margin-bottom: 12px;
}
.alliance-card p {
  font-size: 11px;
}
.alliance-card span {
  font-size: 12px;
  margin-bottom: 18px;
}
.race-grid > div {
  padding: 15px;
  border: 1px solid #cbb689;
  border-radius: 7px;
}
.race-grid p {
  font-size: 11px;
}
.race-grid small {
  display: block;
  margin-bottom: 10px;
}
.list-row,
.history-row,
.topic-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 13px;
  padding: 13px 0;
  border-bottom: 1px dashed #c8b88c;
}
.list-row:last-child,
.topic-row:last-child {
  border: 0;
}
.list-row p {
  margin: 0;
  overflow-wrap: anywhere;
}
.list-row small,
.history-row small {
  display: block;
}
.history-row > .icon {
  color: #9a7a3d;
  width: 35px;
  height: 40px;
}
.history-row > div {
  flex: 1;
}
.history-row b {
  font-size: 12px;
}
.history-row > span {
  font-size: 11px;
  color: #78834c;
}
.mission-row {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 18px 0;
  border-bottom: 1px dashed #c7b88a;
}
.mission-row:last-child {
  border: 0;
}
.mission-row > div {
  flex: 1;
}
.mission-row > .icon {
  width: 35px;
  height: 39px;
  color: #9a7c43;
}
.mission-row h3 {
  font-size: 13px;
  margin-bottom: 2px;
}
.mission-row .progress {
  max-width: 350px;
  margin-top: 9px;
}
.notice {
  padding: 15px 20px;
  background: #f0d9a4;
  border: 1px solid #c8a763;
  border-radius: 7px;
  color: #72592e;
  margin-bottom: 20px;
  font-size: 12px;
}
.notice a {
  text-decoration: underline;
  font-weight: 650;
}
.gem-package {
  text-align: center;
  padding: 15px;
  background: #e4e4bd;
  border: 1px solid #bbbd8b;
  border-radius: 7px;
}
.gem-package .icon {
  width: 75px;
  height: 75px;
  color: #42939b;
  fill: #9bd9d655;
  filter: drop-shadow(0 4px #c3b77d);
}
.gem-package h3 {
  margin: 12px 0 3px;
}
.gem-package small {
  display: block;
  margin-bottom: 15px;
}
.message-row {
  padding: 15px 0;
  border-bottom: 1px solid #cdbd93;
}
.message-row > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.message-row p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  margin-top: 12px;
}
.topic-row h3 {
  margin: 5px 0;
  font-size: 14px;
}
.topic-row > span {
  font-size: 11px;
  white-space: nowrap;
}
.preserve {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
}
.battle-resources {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  flex-wrap: wrap;
  background: #ece0b7;
  border: 2px solid #baa36a;
  border-radius: 8px;
  padding: 13px 16px;
  margin-bottom: 15px;
  box-shadow: var(--shadow);
}
.battle-resources > span {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  position: relative;
}
.battle-resources .icon {
  width: 21px;
  color: #8f6f39;
}
.battle-resources b {
  font-size: 17px;
}
.battle-resources small {
  display: block;
  font-size: 8px;
  max-width: 55px;
  line-height: 1.5;
}
.battle-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 195px;
  gap: 15px;
  margin-bottom: 20px;
}
.map-panel {
  background: #1e7781;
  border: 3px solid #baa16b;
  border-radius: 9px;
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow);
}
.map-tools {
  padding: 8px 10px;
  background: #285e5f;
  color: #e7e7bf;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  font-size: 9px;
}
.map-tools button {
  padding: 2px 7px;
  font-size: 10px;
  min-width: 23px;
  box-shadow: none;
}
.battle-map {
  width: 100%;
  display: block;
  min-height: 280px;
  touch-action: manipulation;
  background: #328c9a;
  direction: ltr;
}
.map-tile {
  cursor: pointer;
  outline: none;
}
.map-tile polygon {
  transition: filter 0.2s;
  filter: drop-shadow(0 1px 1px #30524c55);
}
.map-tile:hover polygon {
  filter: brightness(1.17);
}
.map-tile.selected polygon {
  stroke: #fff5a3;
  stroke-width: 5;
  filter: drop-shadow(0 0 4px #f5db68);
}
.map-tile.target polygon {
  stroke: #f9eee4;
  stroke-width: 4;
  stroke-dasharray: 5 2;
}
.map-tile.neighbor polygon {
  stroke-opacity: 1;
  filter: brightness(1.08);
}
.map-tile:focus-visible polygon {
  stroke: #fff8c1;
  stroke-width: 5;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  padding: 8px;
  color: #c6e6d0;
  font-size: 9px;
  background: #1d5b63;
}
.battle-orders {
  background: var(--paper);
  border: 2px solid #b9a372;
  border-radius: 9px;
  padding: 14px;
  font-size: 11px;
  box-shadow: var(--shadow);
}
.battle-orders > button {
  width: 100%;
  margin-bottom: 8px;
}
.battle-orders p {
  margin-bottom: 10px;
}
.battle-orders h3 {
  font-size: 14px;
}
.battle-orders small {
  display: block;
}
.battle-orders hr {
  border: 0;
  border-top: 1px dashed #c5ae78;
  margin: 15px 0;
}
.battle-orders details {
  margin-top: 13px;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
.order-empty {
  text-align: center;
  padding: 18px 0;
}
.order-empty > .icon {
  width: 55px;
  height: 60px;
  color: #b8a472;
}
.participant {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #d4c69e;
}
.participant i {
  width: 10px;
  height: 10px;
  border: 1px solid #75694b;
  border-radius: 2px;
}
.participant small {
  font-size: 9px;
}
.event-log,
.chat-log {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
}
.event-log p {
  font-size: 11px;
  padding: 8px 0;
  margin: 0;
  border-bottom: 1px dashed #d0bf96;
}
.event-log small {
  display: block;
  font-size: 9px;
  color: #8e7649;
}
.event-log time,
.chat-log time {
  font-size: 8px;
  color: #958460;
  display: block;
}
.chat-log p {
  font-size: 11px;
  padding: 8px;
  margin: 0 0 6px;
  background: #e8dcba;
  border-radius: 5px;
}
.chat-log span {
  display: block;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.chat-log b {
  font-size: 10px;
}
.chat-log time {
  display: inline-block;
}
.chat-log + .form-error {
  margin-top: 10px;
}
.result-banner {
  text-align: center;
  background: radial-gradient(ellipse at top, #f4e1a7, #dfce9e);
  border: 3px solid #c8ab66;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.result-banner > .icon {
  display: block;
  width: 90px;
  height: 90px;
  color: #aa7f28;
  fill: #e6bf6155;
  margin: 0 auto 20px;
}
.result-banner h2 {
  font-size: 28px;
  color: #745722;
}
.result-banner .stat-strip {
  max-width: 550px;
  margin: 20px auto;
}
.arena-scene {
  background: radial-gradient(ellipse, #b1b576, #698668);
  border: 3px solid #cbb274;
  border-radius: 12px;
  display: grid;
  grid-template-columns: 1fr 1.2fr 1fr;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding: 25px;
  margin-bottom: 20px;
  color: #fff2c7;
  box-shadow: var(--shadow);
}
.arena-scene .portrait {
  height: 260px;
}
.arena-scene h3 {
  margin-top: 15px;
}
.arena-scene p {
  font-size: 11px;
}
.versus {
  font-size: 27px;
  color: #f0d27b;
  text-shadow: 0 3px #4f603c;
}
.duel-rounds {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.duel-round {
  border: 1px solid #d4c090;
  border-radius: 6px;
  padding: 12px;
  font-size: 11px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.duel-round .progress {
  align-self: center;
}
.duel-round small {
  grid-column: span 2;
}
.stage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stage-list > div {
  background: #eadcb5;
  border: 1px solid #c7b386;
  border-radius: 6px;
  padding: 15px;
}
.stage-list p {
  font-size: 12px;
  margin: 5px 0 12px;
}
.tutorial-owl {
  text-align: center;
  margin-bottom: 20px;
}
.tutorial-owl .icon {
  width: 105px;
  height: 110px;
  color: #92723a;
  fill: #dbbd7355;
}
.dialog-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 20px;
}
dialog {
  background: var(--paper);
  color: var(--ink);
  border: 4px solid #aa8d55;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 20px 80px #102e3ac9;
  max-width: min(600px, 94vw);
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}
dialog::backdrop {
  background: #123740b3;
  backdrop-filter: blur(4px);
}
dialog h2 {
  font-size: 21px;
  border-bottom: 1px solid #c6b17d;
  padding-bottom: 12px;
  margin-left: 25px;
}
.dialog-close {
  position: absolute;
  top: 15px;
  left: 15px;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 24px;
  background: #ddc791;
  color: #6f572d;
  border-color: #b49860;
}
dialog p {
  font-size: 13px;
}
dialog form {
  margin-top: 18px;
}
dialog .large-icon {
  margin: auto;
}
.busy button[type='submit'],
.busy button[data-act] {
  opacity: 0.6;
  pointer-events: none;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 20px);
  padding: 12px 24px;
  background: #e6e9c6;
  color: #385638;
  border: 2px solid #9cac79;
  border-radius: 9px;
  box-shadow: 0 6px 22px #173c4555;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  max-width: 90vw;
  font-size: 13px;
  transition: 0.2s;
}
#toast.show {
  transform: translate(-50%, 0);
  opacity: 1;
  visibility: visible;
}
#toast.error {
  background: #f5ddc4;
  color: #8b3e29;
  border-color: #bd876a;
}
footer {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: center;
  color: #b5d4ca;
  border-top: 1px solid #a4d2c633;
  padding: 20px 0;
  margin-top: 23px;
  font-size: 10px;
}
footer a {
  color: #d9e0c0;
}
.connection {
  display: flex;
  align-items: center;
  gap: 6px;
}
.connection:before {
  content: '';
  width: 6px;
  height: 6px;
  background: #c0d88c;
  border-radius: 50%;
  box-shadow: 0 0 6px #b6ce88;
}
.connection.offline:before {
  background: #e6ba7d;
}
.public-world {
  min-height: 100vh;
  background:
    linear-gradient(#194b5a0d, #145f7399),
    url('/valley.webp') center top/100% auto no-repeat;
  max-width: 1700px;
  margin: auto;
}
.public-world > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 25px 7vw;
  background: linear-gradient(#164c6655, transparent);
  color: #fff1c7;
}
.public-world > header nav {
  display: flex;
  gap: 30px;
  font-size: 13px;
  text-shadow: 0 1px 3px #123b50;
}
.gate-layout {
  display: grid;
  grid-template-columns: 1fr 410px;
  gap: 6vw;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 65px 25px 80px;
  min-height: 650px;
  position: relative;
}
.gate-intro {
  color: #fff0c2;
  align-self: start;
  padding-top: 25px;
  text-shadow: 0 3px 12px #163b4b;
}
.gate-intro h1 {
  font-size: 62px;
  line-height: 1.45;
  font-weight: 900;
  letter-spacing: -2px;
  margin-bottom: 20px;
}
.gate-intro h1 em {
  font-style: normal;
  color: #f9db86;
}
.gate-intro > .eyebrow {
  color: #f7e9c1;
  font-size: 13px;
}
.gate-intro > p {
  font-size: 16px;
  line-height: 2.2;
}
.gate-features {
  display: flex;
  gap: 28px;
  margin: 25px 0 35px;
  color: #fff3c6;
  font-size: 12px;
}
.gate-features > span {
  display: flex;
  align-items: center;
  gap: 7px;
}
.gate-features .icon {
  width: 25px;
  color: #f3d486;
}
.wood {
  background: linear-gradient(#92683f, #60432c);
  border: 2px solid #d0b075;
  color: #fff0be;
  box-shadow: 0 3px #392c24;
}
.gate-card {
  background: #f5e9c9f7;
  background-image: radial-gradient(ellipse at top, #fff8da88, transparent);
  border: 4px solid #ac8d57;
  border-radius: 13px;
  padding: 30px;
  box-shadow:
    0 8px #273f2e55,
    0 30px 60px #103e4b66;
  position: relative;
}
.gate-card:before,
.gate-card:after {
  content: '';
  position: absolute;
  top: -65px;
  width: 10px;
  height: 65px;
  background: repeating-linear-gradient(0deg, #604e32 0 4px, #cdb988 4px 8px);
  border: 1px solid #5c5034;
  border-radius: 4px;
}
.gate-card:before {
  right: 35px;
}
.gate-card:after {
  left: 35px;
}
.gate-card h2 {
  font-size: 21px;
  margin-bottom: 23px;
}
.gate-card .primary {
  width: 100%;
  margin-top: 6px;
}
.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: #436e6b;
  margin: 22px 0 12px;
}
.demo-hint {
  display: block;
  text-align: center;
  border-top: 1px dashed #ccbb8b;
  padding-top: 12px;
  font-size: 10px;
  direction: ltr;
  line-height: 1.9;
}
.public-preview {
  display: flex;
  align-items: center;
  gap: 35px;
  background: #145461e8;
  color: #e4e9cd;
  border-top: 1px solid #9ac6b555;
  border-bottom: 1px solid #9ac6b555;
  padding: 25px max(6vw, 25px);
}
.public-preview > div:first-child {
  flex: 1;
}
.public-preview h2 {
  font-size: 23px;
}
.public-preview p {
  color: #b7d3c7;
  font-size: 13px;
}
.preview-mini {
  max-width: 400px;
  width: 45%;
  border: 3px solid #ae9b68;
  border-radius: 7px;
  overflow: hidden;
}
.preview-mini .battle-map {
  min-height: 0;
}
.public-world > footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 23px;
  justify-content: center;
}
.reduce-motion * {
  animation: none !important;
  transition: none !important;
  scroll-behavior: auto !important;
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
.dialog-nav {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.dialog-nav a {
  display: flex;
  gap: 10px;
  align-items: center;
  background: #e8d9ad;
  border: 1px solid #c6b285;
  border-radius: 6px;
  padding: 10px;
  font-size: 12px;
}
.dialog-nav .icon {
  width: 23px;
  color: #8d7039;
}
.public-stats {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  color: #e5ddac;
  font-size: 11px;
  margin-top: 20px;
}
@media (min-width: 1500px) {
  .battle-map {
    min-height: 370px;
  }
}
@media (max-width: 1150px) {
  .game-shell {
    padding: 0 20px;
  }
  .game-layout {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 18px;
  }
  .portrait {
    height: 170px;
  }
  .mode-card {
    padding: 12px 9px;
    gap: 7px;
  }
  .mode-card > .icon {
    width: 27px;
  }
  .mode-card h3 {
    font-size: 11px;
  }
  .mode-card p {
    font-size: 8px;
  }
  .skills-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .battle-layout {
    grid-template-columns: 1fr;
  }
  .battle-orders {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
  }
  .battle-orders > button {
    width: auto;
    margin: 0;
  }
  .battle-orders details {
    width: 100%;
  }
  .battle-orders details > .participant {
    display: inline-flex;
    margin-left: 15px;
    border: 0;
  }
  .battle-orders hr,
  .battle-orders .order-empty {
    display: none;
  }
  .battle-orders p {
    margin: 0;
  }
  .map-tools {
    font-size: 11px;
  }
  .hero-layout {
    grid-template-columns: 1fr 1.6fr;
  }
  .attribute {
    grid-template-columns: 65px 1fr;
    gap: 5px;
  }
  .attribute > b {
    grid-column: span 2;
    font-size: 11px;
  }
  .arena-scene {
    gap: 15px;
    padding: 16px;
  }
  .arena-scene .portrait {
    height: 200px;
  }
  .gate-layout {
    grid-template-columns: 1fr 370px;
    gap: 35px;
    min-height: 630px;
    padding-top: 55px;
  }
  .gate-intro h1 {
    font-size: 50px;
  }
  .gate-intro > p {
    font-size: 14px;
  }
  .gate-features {
    gap: 12px;
    font-size: 10px;
  }
  .public-world {
    background-size: auto 950px;
  }
}
@media (max-width: 850px) {
  .game-shell {
    padding: 0 13px;
  }
  .realm-banner {
    height: 130px;
    padding: 20px;
  }
  .realm-banner h1 {
    font-size: 22px;
  }
  .realm-banner p {
    font-size: 10px;
  }
  .seal .icon {
    width: 80px;
    height: 85px;
    top: 0;
  }
  .seal b {
    font-size: 28px;
  }
  .seal small {
    font-size: 8px;
  }
  .game-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    display: none;
  }
  .content {
    width: 100%;
  }
  .two-col {
    gap: 15px;
  }
  .panel-body {
    padding: 17px;
  }
  .gate-layout {
    grid-template-columns: 1fr 340px;
    gap: 25px;
    padding: 35px 20px 55px;
  }
  .gate-card {
    padding: 23px;
  }
  .gate-card h2 {
    font-size: 18px;
  }
  .gate-intro h1 {
    font-size: 44px;
  }
  .gate-intro > p {
    font-size: 13px;
  }
  .gate-features {
    flex-wrap: wrap;
    gap: 10px;
  }
  .public-world > header {
    padding: 20px;
  }
  .public-preview {
    gap: 20px;
    padding: 25px;
  }
  .public-preview h2 {
    font-size: 20px;
  }
  .public-preview p {
    font-size: 12px;
  }
  .public-world {
    background-size: auto 900px;
  }
  .arena-scene h3 {
    font-size: 13px;
  }
  .arena-scene .portrait {
    height: 200px;
  }
}
@media (max-width: 580px) {
  body {
    font-size: 13px;
  }
  .game-shell {
    padding: 0 9px;
  }
  .realm-banner {
    height: 115px;
    padding: 14px 18px;
  }
  .realm-banner h1 {
    font-size: 19px;
    max-width: 235px;
  }
  .realm-banner .eyebrow {
    font-size: 8px;
  }
  .realm-banner p {
    font-size: 8px;
  }
  .seal {
    min-width: 60px;
  }
  .seal .icon {
    width: 70px;
    height: 80px;
    top: 1px;
  }
  .seal b {
    font-size: 25px;
  }
  .seal small {
    font-size: 7px;
  }
  .section-heading {
    margin-bottom: 13px;
    flex-wrap: wrap;
  }
  .section-heading h2 {
    font-size: 19px;
  }
  .section-heading .eyebrow {
    font-size: 9px;
  }
  .mode-grid {
    gap: 8px;
  }
  .mode-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 12px 5px;
  }
  .mode-card > span {
    display: none;
  }
  .mode-card > .icon {
    width: 32px;
    height: 35px;
  }
  .mode-card h3 {
    font-size: 10px;
  }
  .mode-card p {
    display: none;
  }
  .two-col {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .panel {
    margin-bottom: 18px;
  }
  .panel h2 {
    padding: 10px 15px;
    font-size: 14px;
  }
  .panel-body {
    padding: 16px;
  }
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .portrait.large {
    height: 290px;
    max-width: 280px;
    margin: auto;
  }
  .attribute {
    grid-template-columns: 70px 1fr auto;
    gap: 7px;
  }
  .attribute > b {
    grid-column: auto;
    font-size: 10px;
    min-width: 75px;
  }
  .training-grid {
    gap: 9px;
  }
  .skills-grid {
    gap: 8px;
  }
  .troop-training {
    grid-template-columns: 1fr;
  }
  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .item-card {
    padding: 12px 9px;
  }
  .item-art {
    height: 70px;
    width: 70px;
  }
  .item-art .icon {
    width: 45px;
    height: 48px;
  }
  .item-card h3 {
    font-size: 12px;
  }
  .item-card p {
    font-size: 10px;
  }
  .item-card small {
    font-size: 8px;
  }
  .filter-bar {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 13px;
  }
  .filter-bar label {
    font-size: 10px;
  }
  .filter-bar select,
  .filter-bar input {
    font-size: 11px;
  }
  .mission-row {
    gap: 10px;
  }
  .mission-row > .icon {
    width: 25px;
    height: 30px;
  }
  .mission-row h3 {
    font-size: 12px;
  }
  .mission-row small {
    font-size: 9px;
  }
  .mission-row > button {
    font-size: 10px;
    padding: 5px 7px;
  }
  .gem-package {
    padding: 12px 5px;
  }
  .gem-package .icon {
    width: 43px;
    height: 47px;
  }
  .gem-package h3 {
    font-size: 14px;
  }
  .gem-package small {
    font-size: 8px;
  }
  .gem-package button {
    font-size: 10px;
    padding: 7px 8px;
  }
  .history-row {
    flex-wrap: wrap;
    gap: 9px;
  }
  .history-row small {
    font-size: 9px;
  }
  .history-row .icon {
    width: 25px;
  }
  .history-row > .button {
    font-size: 10px;
  }
  .battle-resources {
    gap: 9px;
    padding: 10px;
  }
  .battle-resources > span {
    font-size: 9px;
  }
  .battle-resources b {
    font-size: 14px;
  }
  .battle-resources .icon {
    width: 18px;
    height: 20px;
  }
  .battle-resources small {
    font-size: 7px;
    max-width: 45px;
  }
  .battle-map {
    min-height: 250px;
    width: 125%;
    margin-left: -12.5%;
    margin-right: -12.5%;
  }
  .map-panel {
    overflow: auto;
  }
  .map-tools {
    font-size: 9px;
    flex-wrap: wrap;
  }
  .map-tools button {
    font-size: 9px;
  }
  .map-legend {
    font-size: 8px;
    gap: 6px;
  }
  .battle-orders {
    font-size: 10px;
    padding: 12px;
  }
  .battle-orders h3 {
    font-size: 12px;
    margin: 0;
  }
  .battle-orders > button {
    font-size: 10px;
  }
  .battle-orders details {
    font-size: 11px;
  }
  .event-log,
  .chat-log {
    max-height: 210px;
  }
  .arena-scene {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .arena-scene > div:nth-child(2) {
    grid-column: span 2;
    grid-row: 2;
  }
  .arena-scene .portrait {
    height: 185px;
  }
  .duel-rounds {
    grid-template-columns: 1fr;
  }
  .result-banner {
    padding: 23px 15px;
  }
  .result-banner h2 {
    font-size: 23px;
  }
  .result-banner > .icon {
    width: 70px;
    height: 75px;
  }
  .table-scroll table {
    font-size: 10px;
  }
  td,
  th {
    padding: 10px 7px;
  }
  dialog {
    padding: 23px 18px;
    border-width: 3px;
  }
  dialog h2 {
    font-size: 18px;
  }
  .public-world > header {
    padding: 20px 18px;
  }
  .public-world > header nav {
    gap: 14px;
    font-size: 11px;
  }
  .gate-layout {
    grid-template-columns: 1fr;
    max-width: 440px;
    padding: 10px 18px 35px;
    gap: 30px;
  }
  .gate-intro {
    text-align: center;
    padding-top: 10px;
  }
  .gate-intro h1 {
    font-size: 42px;
    line-height: 1.35;
    margin-bottom: 14px;
  }
  .gate-intro .eyebrow {
    font-size: 10px;
  }
  .gate-intro > p {
    font-size: 12px;
  }
  .gate-features {
    justify-content: center;
    margin: 15px 0 20px;
    gap: 20px;
  }
  .gate-intro > .button {
    font-size: 11px;
  }
  .gate-card {
    padding: 25px;
  }
  .gate-card:before,
  .gate-card:after {
    display: none;
  }
  .public-world {
    background-size: auto 800px;
    background-position: 55% 0;
  }
  .public-preview {
    display: block;
    padding: 25px 22px;
    text-align: center;
  }
  .preview-mini {
    width: 100%;
    max-width: 400px;
    margin: auto;
  }
  .preview-mini .battle-map {
    width: 100%;
    margin: 0;
  }
  .public-world > footer {
    font-size: 9px;
    padding: 20px;
  }
  .game-shell > footer {
    flex-wrap: wrap;
    justify-content: center;
    font-size: 8px;
    padding: 15px 0;
    gap: 7px 20px;
  }
  .race-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .race-grid > div {
    padding: 12px;
  }
  .race-grid h3 {
    font-size: 14px;
  }
  .race-grid p {
    font-size: 10px;
  }
  .message-row > div {
    flex-wrap: wrap;
  }
  .topic-row {
    gap: 8px;
  }
  .topic-row h3 {
    font-size: 12px;
  }
  .topic-row > span {
    font-size: 9px;
  }
  .notice {
    font-size: 11px;
    padding: 12px 15px;
  }
}
