@font-face {
  font-family: "Cormorant Garamond";
  src: url("assets/fonts/cormorant-garamond.woff2") format("woff2");
  font-weight: 600 700;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("assets/fonts/source-sans-3.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

/* Limestone and bronze frame the illustrated play area. */
:root {
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Source Sans 3", system-ui, sans-serif;
  --ink: #362818;
  --ink-muted: #645039;
  --paper: #f2e3c4;
  --paper-shadow: #e5d1ab;
  --paper-line: #ad9063;
  --bronze: #725032;
  --bronze-light: #d8b377;
  --surface: linear-gradient(125deg, #f8eed7, var(--paper) 56%, #e7d4b1);
}

body {
  background: radial-gradient(ellipse at 50% 0, #3b4c44, #252f2d 52%, #1d2727);
}
.top {
  background: linear-gradient(#273735, #1b2828);
  border-bottom: 3px double #a08053;
}
.brand { color: #f7e6be; }
.brand .crest { filter: drop-shadow(0 2px 1px #151813); }
.heading h1 { font-weight: 600; }
.region { color: #dbc295; letter-spacing: .13em; }
.heading #troops { color: #e4d6b9; overflow-wrap: anywhere; }
.tabs {
  gap: 4px;
  padding: 4px 4px 0;
  background: #1b2928;
  border: 1px solid #8f734e;
  border-bottom: 3px double #8f734e;
}
.tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 42px;
  padding: 7px clamp(8px, 2vw, 22px);
  border: 1px solid #6e5a3f;
  border-bottom: 0;
  background: linear-gradient(#41504a, #2b3734);
  color: #f4e7ca;
  font: 600 17px/1.15 var(--serif);
}
.tabs button:hover, .tabs button[aria-current] {
  border-color: #cea96a;
  background: linear-gradient(#efd7a7, #d3ad73);
  color: #392713;
}
.tabs .icon { width: 16px; height: 16px; }
.tabs #report-count:not(:empty) { color: inherit; margin: 0; }
.board { align-items: start; gap: 12px; }
.visual, .detail, .queues {
  border: 1px solid #866141;
  border-radius: 2px;
  box-shadow: 0 2px 3px #13161177;
}
.visual, .detail {
  color-scheme: light;
  --cream: var(--ink);
  --muted: var(--ink-muted);
  --gold: #68451e;
  --green: #405443;
  --line: var(--paper-line);
  color: var(--ink);
  background: var(--surface);
}
.detail { padding: clamp(13px, 2vw, 22px); }
.detail h2, .report-area h2 { font-weight: 600; }
.detail h3, .activity h2 { font-family: var(--serif); }
.detail h3 { margin-block: 12px 6px; font-size: 19px; }
.detail p, .detail dd { overflow-wrap: anywhere; }
.eyebrow { letter-spacing: .1em; }
.detail .primary, .visual .primary {
  border: 1px solid #7e552f;
  border-radius: 2px;
  background: linear-gradient(#f4d79d, #d4a460);
  color: #302013;
  box-shadow: inset 0 1px #fff2cf;
}
.detail .primary:hover:not(:disabled), .visual .primary:hover:not(:disabled) {
  color: #271808;
  background: linear-gradient(#f8e4b9, #e0b777);
  border-color: #5f3d20;
}
.board .primary:disabled {
  background: #dfd0ae;
  border-color: #baa883;
  box-shadow: none;
  color: #685844;
  opacity: 1;
}
.board .secondary, .board .map-list button, .region-neighbors button {
  background: #efdfbe;
  color: var(--ink);
  border: 1px solid #ac926b;
  border-radius: 2px;
}
.board .secondary:hover, .board .map-list button:hover, .region-neighbors button:hover {
  border-color: var(--bronze);
  background: #f7e8c8;
}
.board input:not([data-troop]), .board select, .detail input[data-troop], .guild-composer textarea, .quantity input {
  background: #fff6e2;
  color: var(--ink);
  border: 1px solid #ab9168;
  border-radius: 2px;
}
.detail label.quantity { display: flex; gap: 6px; }
.detail label.quantity input { flex: none; }
.detail progress, .report-area progress {
  appearance: none;
  height: 7px;
  border: 0;
  color: #506b4e;
  background: #ded0ac;
}
.report-area progress::-webkit-progress-bar, .detail progress::-webkit-progress-bar { background: #ded0ac; }
.report-area progress::-webkit-progress-value, .detail progress::-webkit-progress-value { background: #506b4e; }
.report-area progress::-moz-progress-bar, .detail progress::-moz-progress-bar { background: #506b4e; }
.board :focus-visible { outline: 2px solid #77400e; outline-offset: 2px; }
.tabs :focus-visible, .map :focus-visible { outline: 2px solid #ffdaa0; outline-offset: 2px; }

.resources .storage-balance {
  border: 1px solid #8f754f;
  border-radius: 2px;
  background: linear-gradient(#303d37, #21302b);
  --storage-tint: #e0af71;
}
.resources .storage-stone { --storage-tint: #e1ccaf; }
.resources .storage-iron { --storage-tint: #b4cfce; }
.storage-heading > span { display: inline-flex; align-items: center; gap: 4px; }
.storage-heading .icon { width: 13px; height: 13px; }
.storage-balance progress::-webkit-progress-bar { background: #57645a; border-radius: 0; }
.storage-balance progress::-webkit-progress-value { border-radius: 0; }
.storage-amount { overflow-wrap: anywhere; }
.queues { background: linear-gradient(#303c36, #27332e); }
.queue-active { background: #cba36716; box-shadow: inset 0 2px #cb9e5e; }
.queue small { color: #d7cbb2; overflow-wrap: anywhere; }
#raid-warnings > p {
  padding: 8px 12px;
  color: #fff0ca;
  background: #6e3024;
  border: 1px solid #b28254;
}
.message {
  background: #253631;
  border-radius: 2px;
}

.view-heading {
  --art: url("assets/world/aigai.webp");
  display: flex;
  align-items: end;
  min-height: clamp(105px, 15vw, 144px);
  padding: 14px clamp(12px, 2.5vw, 24px);
  background: linear-gradient(90deg, #242a22 10%, #242a22e8 28%, #242a2255 67%, #22262018),
    var(--art) right 46% / max(60%, 220px) auto no-repeat #242a22;
  border-block-end: 3px double #bc9660;
  color: #fff1d2;
}
.view-heading > div { min-width: 0; }
.view-heading h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font: 600 clamp(28px, 3.8vw, 41px)/1.08 var(--serif);
  text-shadow: 0 2px 3px #20160e;
}
.view-atlas { --art: url("assets/views/atlas.webp"); min-height: 84px; }
.view-reports { --art: url("assets/views/reports.webp"); }
.view-heroes { --art: url("assets/views/heroes.webp"); }
.view-guild { --art: url("assets/views/guild.webp"); }
.view-goals { --art: url("assets/views/goals.webp"); }
.view-heading :is(dt, dd, small) { color: #fff0d4; }
.report-area {
  position: relative;
  min-height: 0;
  padding: 0 0 17px;
  background: var(--surface);
}
.report-area > :not(.view-heading) { margin-inline: clamp(11px, 2vw, 22px); }
.report-area > .empty { padding-block: 7px 0; }
.report-list {
  gap: 0;
  border: 1px solid var(--paper-line);
  background: #fff2d794;
}
.report-list button, .report-list button:hover {
  border-radius: 0;
  background: transparent;
  border: 0;
}
.report-list button + button { border-top: 1px solid #b49b725f; }
.report-list button:is(:hover, [aria-pressed=true]) {
  background: #d8bc8a80;
  box-shadow: inset 3px 0 #84542e;
}
.chronicle-entry {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  overflow-wrap: anywhere;
}
.chronicle-entry > .icon {
  width: 30px;
  height: 30px;
  padding: 5px;
  border: 1px solid #a18957;
  border-radius: 50%;
  color: #36543b;
  background: #ead9ad;
}
.chronicle-entry.loss > .icon, .chronicle-entry.loss .report-outcome { color: #7e3226; }
.report-outcome { color: #36543b; font-weight: 650; font-size: 12px; }
.alpha-game main:has([data-view="login"]) { padding-top: clamp(14px, 4vw, 45px); }
.alpha-game #visual[data-view="login"] > .village { aspect-ratio: 1.65; }
.alpha-game #visual[data-view="login"] img { object-fit: cover; }
.google-login span { border: 1px solid #ad905f; }

.city-scene { border-bottom: 3px double #ad8e5d; }
.city-scene .visual-caption, .visual-caption {
  background: #262a20e8;
  border-color: #c39e64;
  border-radius: 2px;
}
.city-plan, .map-list { background: var(--surface); }
.city-plan h2, .prototype-buildings h2 { font-weight: 600; }
.building-group h3, .atlas-list-group h3, .goals-section > h3 {
  padding-block: 3px;
  border-bottom: 1px solid var(--paper-line);
  font: 600 18px var(--serif);
  color: #4c3922;
}
.building-list button, .prototype-buildings button {
  display: flex;
  align-items: center;
  text-align: left;
  gap: 6px;
  padding: 5px 7px;
  min-width: 0;
  min-height: 59px;
  background: linear-gradient(#faf0d8, #ecddba);
  border: 1px solid #b29a72;
  border-radius: 2px;
  box-shadow: inset 0 1px #fff3d5;
}
.building-list button:hover, .building-list button[aria-pressed=true],
.prototype-buildings button:hover, .prototype-buildings button[aria-pressed=true] {
  border-color: #7e5834;
  background: linear-gradient(#f5dd9f, #e7c791);
}
.building-list button[aria-pressed=true], .prototype-buildings button[aria-pressed=true] {
  box-shadow: inset 3px 0 #8a5c33;
}
.building-list .building-thumb, .prototype-buildings button img {
  width: clamp(36px, 4.4vw, 55px);
  height: 49px;
  flex: none;
  object-fit: contain;
  filter: drop-shadow(0 2px 1px #4d3b2650);
}
.building-list .building-thumb.unbuilt { filter: saturate(.45); opacity: .78; }
.building-list .working { color: #7a4515; font-weight: 700; }
.place-heading {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 9px;
  border-bottom: 1px solid var(--paper-line);
}
.place-heading img { flex: 0 0 auto; width: 34%; max-width: 96px; height: auto; object-fit: contain; }
.place-heading h2 { margin-top: 2px; overflow-wrap: anywhere; }

.city-switch {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  border-bottom: 1px solid var(--paper-line);
}
.city-switch select { min-height: 34px; margin: 0; max-width: 100%; }
.region-neighbors { margin: 0; }
.visual .map {
  width: 100%;
  background: #2c5054;
  border-block: 1px solid #876b49;
}
.map-tools, .map-legend { border-color: #b79562; border-radius: 2px; }
.map-tools button { min-width: 33px; min-height: 33px; background: #263e38; color: #fff0ce; }
.map-tools button:hover { background: #435c4d; }
.atlas-key {
  font-size: 12px;
  color: var(--ink-muted);
  background: #e5d5b4;
}
.map-world .atlas-marker { border-radius: 3px; }
.map-world .atlas-dot, .map-world .atlas-compact { border-radius: 50%; }
.map-world .atlas-label { background: #26372e; border-radius: 2px; }
.atlas-list-group button { display: flex; align-items: center; gap: 6px; min-width: 0; }
.atlas-list-group button img { flex: none; object-fit: contain; }
.atlas-list-group button span { min-width: 0; }
.atlas-list-group button[aria-pressed=true] { background: #ead2a4; border-color: #7e5834; }

.heroes-view .hero-card {
  display: grid;
  grid-template-columns: minmax(80px, 190px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 3vw, 24px);
  padding: 12px;
  margin-block: 14px 12px;
  background: linear-gradient(135deg, #dbc39b, #f7ebd0);
  border: 1px solid var(--paper-line);
}
.hero-card img { align-self: center; border: 1px solid var(--bronze); border-radius: 2px; }
.hero-card h3 { margin: 0; font: 600 clamp(23px, 4vw, 38px)/1.1 var(--serif); }
.hero-card p { margin: 4px 0; }
.hero-card .hero-status { color: var(--ink-muted); font-size: 13px; }
.hero-picker { display: grid; grid-template-columns: repeat(auto-fit, minmax(72px, 1fr)); gap: 7px; }
.hero-picker button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  background: #f5e8ca;
  border: 1px solid var(--paper-line);
  border-radius: 2px;
}
.hero-picker button:is(:hover, [aria-pressed=true]) {
  background: #e5c384;
  border-color: var(--bronze);
}
.hero-picker img { width: min(100%, 65px); aspect-ratio: 1; object-fit: cover; border: 1px solid var(--bronze); }
.inventory-item img { border: 1px solid var(--paper-line); border-radius: 2px; }
.hero-slots { background: #f8ecd0; border: 1px solid var(--paper-line); padding: 7px 8px 7px 24px; }

.guild-panel, .event-list details, .goal-card {
  border-color: #b19970;
  border-radius: 2px;
  background: #faeed4;
}
.guild-panel h3 > .icon { color: #75522e; margin-right: 6px; }
.guild-chat li { background: #ede0c1; border-radius: 2px; }
.guild-view .view-heading { background-position: center, right 38%; }
.goal-card header { display: flex; align-items: center; gap: 8px; }
.goal-card header img { flex: none; object-fit: contain; }
.goal-card.goal-weekly { background: linear-gradient(140deg, #ead6aa, #f9ecd0); }
.goal-card.goal-ready { border-color: #99602a; box-shadow: inset 3px 0 #99602a; }
.event-list .event-card summary { min-width: 0; }
.event-list .event-card summary > span { overflow-wrap: anywhere; }

.prototype-game .visual { aspect-ratio: auto; min-height: 0; }
.prototype-game .village, .prototype-game .map { position: relative; aspect-ratio: 1.62; }
.prototype-game .village img { object-fit: cover; }
.prototype-buildings { padding: 12px 15px; }
.prototype-buildings h2 { margin: 0 0 8px; font: 600 24px var(--serif); }
.prototype-buildings > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.prototype-buildings small { display: block; color: var(--ink-muted); }

@media (max-width: 700px) {
  .tabs { gap: 2px; padding-inline: 2px; }
  .tabs button { min-height: 38px; font-size: 16px; }
  .alpha-game .view-atlas { min-height: 62px; }
}
@media (max-width: 390px) {
  .storage-heading .icon { width: 11px; height: 11px; }
  .chronicle-entry { gap: 6px; }
  .guild-panel, .goal-card { padding: 10px; }
  .prototype-game .top-inner { align-items: start; flex-direction: column; padding-block: 8px; }
  .prototype-game .resource strong { font-size: 12px; }
}
