/* One quiet quotation below the six deployment buttons. The reserved space
   keeps the battlefield from jumping as short and long quotations alternate. */
#app > .battle-wrap .battle-field:has(> .battle-quote) {
  grid-template-rows: minmax(80px, 1fr) auto auto auto auto auto;
}
.battle-quote {
  box-sizing: border-box;
  height: 94px;
  min-width: 0;
  margin: 5px 0 2px;
  padding: 10px 16px;
  display: grid;
  place-items: center;
  border: 1px solid #d7c5a6;
  border-radius: 10px;
  background: #fcf7eb;
  color: #493b2b;
  text-align: center;
}
.battle-quote__content { width: 100%; min-width: 0; }
.battle-quote blockquote {
  margin: 0;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(13px, 1.1vw, 16px);
  font-style: italic;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.battle-quote figcaption { margin-top: 6px; font-size: 11px; font-weight: 700; line-height: 1.3; }
.battle-quote a { color: inherit; text-decoration: none; }
.battle-quote a:hover { text-decoration: underline; }
.battle-quote a:focus-visible { outline: 2px solid #645038; outline-offset: 3px; }
.battle-quote small { display: block; margin-top: 2px; font-size: 10px; font-style: normal; font-weight: 400; }
.battle-quote [hidden] { display: none; }

@media (max-width: 800px) {
  body:has(> #app > .battle-wrap .battle-quote) > .topbar {
    height: 68px;
    min-height: 68px;
    padding: 5px 12px;
    flex-wrap: nowrap;
    gap: 8px;
  }
  body:has(> #app > .battle-wrap .battle-quote) > .topbar .brand { width: 174px; height: 58px; flex-shrink: 0; }
  body:has(> #app > .battle-wrap .battle-quote) > .topbar nav { display: none; }
  body:has(> #app > .battle-wrap .battle-quote) > .topbar .wallet { margin-left: auto; }
  #app > .battle-wrap:has(.battle-quote) .battle-layout { grid-template-rows: minmax(0, 1fr) clamp(128px, 22dvh, 180px); }
  .battle-quote { height: 94px; margin-top: 3px; padding: 7px 10px; }
  .battle-quote blockquote { font-size: 12px; line-height: 1.3; }
  .battle-quote figcaption { margin-top: 4px; font-size: 10px; }
}
@media (max-width: 359px) {
  .battle-quote { height: 106px; }
}
/* Keep both controls and the full quotation reachable in very short windows. */
@media screen and (max-height: 650px) {
  #app > .battle-wrap:has(.battle-quote) { overflow-y: auto; overscroll-behavior: contain; }
  #app > .battle-wrap:has(.battle-quote) .battle-layout { flex-shrink: 0; min-height: 350px; }
  .battle-quote { height: 78px; padding: 6px 10px; }
  .battle-quote blockquote { font-size: 12px; line-height: 1.3; }
}
@media screen and (max-width: 800px) and (max-height: 650px) {
  #app > .battle-wrap:has(.battle-quote) .battle-layout { min-height: 500px; grid-template-rows: minmax(330px, 1fr) 160px; }
  .battle-quote { height: 106px; }
}
@media screen and (min-width: 560px) and (max-height: 500px) {
  #app > .battle-wrap:has(.battle-quote) .battle-layout { min-height: 320px; grid-template-rows: minmax(0, 1fr); }
  .battle-quote { height: 78px; }
}
@media (prefers-reduced-motion: reduce) {
  .battle-quote__content { opacity: 1 !important; }
}

/* The same anthology sits below the content of every non-title menu and guide.
   These flexible cards never squeeze the existing battle/deployment layout. */
#page-quote-slot {
  position: relative;
  z-index: 1;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 28px 18px;
  zoom: var(--defense-ui-scale, 1);
}
#page-quote-slot[hidden],
body:has(> #app > .title-entry) > #page-quote-slot { display: none; }
.page-quote {
  height: auto;
  min-height: 106px;
  margin: 0;
  padding: 16px 20px;
}
.page-quote blockquote { font-size: clamp(14px, 1.1vw, 17px); line-height: 1.45; }
.page-quote figcaption { font-size: 12px; }
body:has(> #page-quote-slot:not([hidden])) > #app,
body:has(> #page-quote-slot:not([hidden])) > #guide-main {
  min-height: calc(100svh - 284px * var(--defense-ui-scale, 1));
}
@media (max-width: 800px) {
  #page-quote-slot { padding-inline: 16px; }
  .page-quote { padding: 14px 12px; }
}
