/* Destination paintings and the castle's shared navigation. Loaded last so
   desktop, touch and portrait use the same card anatomy at reading size. */
:root {
  --door-duel: #a64f3e; --door-duel-light: #d98664;
  --door-team: #376583; --door-team-light: #74a5be;
  --door-campaign: #446d56; --door-gauntlet: #705581; --door-clash: #86613e;
  --door-armory: #a97853; --door-party: #51868a;
  --door-deeds: #92739a; --door-stores: #588982;
}
html #scr-menu .menucenter { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; }
html #scr-menu .menuhero { height: 174px; }
html #scr-menu .kingdom-logo { height: 168px; }
html #scr-menu .battledeck { display: flex; flex-direction: column; }
html #scr-menu .modepanel { flex: 1; }
html #scr-menu .modelist { height: 100%; gap: 14px; }
html #scr-menu .bigbtn.modebtn {
  --door: var(--door-duel); --door-lit: var(--door-duel-light);
  position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; text-align: left;
  min-height: 160px; padding: 12px 14px; border: 2px solid var(--outline);
  border-top: 3px solid var(--door-lit); border-radius: var(--r-lg);
  background: radial-gradient(ellipse at 85% 0, var(--door-lit), transparent 75%), var(--door);
  box-shadow: inset 0 1px rgba(255,243,213,.3), 0 4px var(--outline), var(--sh-3);
  overflow: hidden; isolation: isolate;
}
html #scr-menu .bigbtn.modebtn.alt { --door: var(--door-team); --door-lit: var(--door-team-light); background: radial-gradient(ellipse at 85% 0, var(--door-lit), transparent 75%), var(--door); border-top-color: var(--door-lit); box-shadow: inset 0 1px rgba(255,243,213,.3), 0 4px var(--outline), var(--sh-3); }
html #scr-menu .modebtn::before { content: none; }
html #scr-menu .modebtn::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(30,26,26,.65), transparent 85%); z-index: -1; pointer-events: none; }
html #scr-menu .modebtn .destination-art { position: relative; align-self: flex-end; flex: none; width: 158px; height: 90px; z-index: -2; object-fit: contain; transform: rotate(4deg); }
html #scr-menu .mode-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; width: 100%; padding: 0; }
html #scr-menu .modebtn .bttl { color: var(--cloth-ink); font: 800 clamp(21px, 1.65vw, 28px)/1.05 var(--font-display); text-shadow: 0 2px var(--outline); text-transform: none; text-wrap: balance; }
html #scr-menu .modebtn .bsub { color: var(--paper-light); font: 600 11px/1.3 var(--font-ui); padding-top: 5px; border-top: 1px solid rgba(255,243,213,.3); text-shadow: none; text-align: left; opacity: 1; white-space: normal; }
html #scr-menu .bigbtn.modebtn.alt .bsub { color: var(--paper-light); }
html #scr-menu .modebtn.ranked .bsub { color: var(--paper-light); }
html #scr-menu #rankbadge { margin-bottom: 12px; }
html #scr-menu .lp-chip { border-radius: var(--r-md); }
html #scr-menu .adventuredeck.withgauntlet.withclash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: 1fr; gap: 12px; }
html #scr-menu :is(.adventurecard, .gauntletbtn, .clashbtn) {
  --destination: var(--door-campaign);
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  position: relative; min-width: 0; min-height: 180px; margin: 0; padding: 10px 8px 16px;
  gap: 5px; border: 2px solid var(--outline); border-top: 4px solid var(--destination);
  background: var(--paper-face); color: var(--paper-ink); border-radius: var(--r-lg);
  box-shadow: 0 4px var(--outline), var(--sh-3); text-shadow: none; overflow: visible;
}
html #scr-menu .gauntletbtn { --destination: var(--door-gauntlet); }
html #scr-menu .clashbtn { --destination: var(--door-clash); }
html #scr-menu :is(.adventurecard, .gauntletbtn, .clashbtn) .destination-art { position: relative; display: block; flex: 1 1 auto; width: 100%; height: 116px; max-height: 135px; min-height: 0; object-fit: contain; margin: 0; filter: none; }
html #scr-menu .adventurecard .adventure-copy { display: flex; flex-direction: column; align-items: center; flex: none; width: 100%; padding: 0; gap: 5px; border: 0; background: none; color: var(--paper-ink); box-shadow: none; text-shadow: none; }
html #scr-menu :is(.adventure-copy b, .cb-tx) { font: 800 21px/1.1 var(--font-display); color: var(--destination); text-transform: none; white-space: normal; }
html #scr-menu .cb-sub { font: 600 12px/1.3 var(--font-ui); color: var(--paper-muted); text-transform: none; font-style: normal; }
html #scr-menu .cb-sub:empty { display: none; }
html #scr-menu .adventure-progress:not(:empty) { position: absolute; top: 8px; right: 5px; left: 5px; bottom: auto; max-width: calc(100% - 10px); width: fit-content; margin: 0 auto; font: 700 10px/1.2 var(--font-ui); padding: 4px 6px; border: 1px solid var(--outline); border-radius: var(--r-pill); background: var(--destination); color: var(--cloth-ink); white-space: normal; }
html #scr-menu .menurow { grid-row: 3; gap: 14px; }
html #scr-menu .menurow .menubtn {
  --destination: var(--door-armory);
  position: relative; display: flex; align-items: center; flex: 1 1 0;
  min-width: 0; min-height: 84px; padding: 10px 14px 10px 4px; gap: 3px;
  background: var(--paper-face); border: 2px solid var(--outline); border-top: 4px solid var(--destination);
  border-radius: var(--r-lg); box-shadow: 0 4px var(--outline), var(--sh-2);
}
html #scr-menu .menurow [data-destination="party"] { --destination: var(--door-party); }
html #scr-menu .menurow [data-destination="deeds"] { --destination: var(--door-deeds); }
html #scr-menu .menurow [data-destination="stores"] { --destination: var(--door-stores); }
html #scr-menu .menurow [data-destination="install"] { --destination: var(--door-team); }
html #scr-menu .menurow .destination-art { display: block; flex: 0 0 83px; width: 83px; height: 70px; object-fit: contain; }
html #scr-menu .menurow .mb-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; text-align: left; }
html #scr-menu .menurow .menubtn .mb-tx { color: var(--paper-ink); font: 800 20px/1.05 var(--font-display); white-space: normal; text-transform: none; }
html #scr-menu .navbadge { top: 7px; right: 7px; border: 2px solid var(--outline); min-width: 22px; height: 22px; font: 800 12px/18px var(--font-ui); }
html #scr-menu .kingdom-caption { grid-row: 4; margin-top: 4px; border-radius: var(--r-md); }
html #scr-menu .racerow { grid-row: 5; }

/* Room colors continue onto selected tabs and calls to action, connecting the
   destination's painting to the tools inside it. Paper stays the reading surface. */
html .screen:not(#scr-menu) :is(.qm-tab.on, .rd-tab.on, .rq-tab.on, .ar-tab.on) { background: var(--room-deep); border-color: var(--room-trim); box-shadow: inset 0 -3px var(--room-trim), 0 3px var(--outline); }
html .screen:not(#scr-menu) .scrhdr { border-radius: var(--r-lg); }
.room-seal:has(img) { flex-basis: 74px; width: 74px; height: 58px; border-radius: var(--r-md); transform: rotate(-3deg); background: var(--paper-face); }
.room-seal img { width: 80px; height: 60px; object-fit: contain; }
html .screen:not(#scr-menu) .scrsub { font: 500 13px/1.25 var(--font-ui); }
html #scr-armory .armsearch input { color: var(--paper-ink); }
html #scr-armory .armsearch input::placeholder { color: var(--paper-muted); opacity: 1; }
html #scr-armory .armsearch:focus-within { border-color: var(--room-deep); box-shadow: 0 0 0 2px var(--room-trim); }
html .screen:not(#scr-menu) .rooms-button { display: flex; align-items: center; justify-content: center; gap: 6px; flex: none; min-height: 40px; padding: 8px 12px; border: 1px solid var(--room-trim); border-radius: var(--r-md); background: var(--room-deep); color: var(--cloth-ink); font: 700 14px var(--font-ui); cursor: pointer; }
.rooms-button .ic { width: 18px; height: 18px; }
.castle-rooms { width: min(650px, calc(100vw - 28px)); max-height: calc(var(--vh, 1vh) * 100 - 32px); margin: auto; padding: 22px; box-sizing: border-box; background: var(--paper-face); color: var(--paper-ink); border: 3px solid var(--outline); border-top: 5px solid var(--door-team); border-radius: var(--r-xl); box-shadow: var(--sh-4); overscroll-behavior: contain; }
.castle-rooms::backdrop { background: rgba(20,29,35,.76); backdrop-filter: blur(4px); }
.rooms-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.rooms-heading h2 { margin: 2px 0 0; font: 800 32px/1.1 var(--font-display); }
.rooms-close { display: grid; place-items: center; flex: none; width: 40px; height: 40px; color: var(--cloth-ink); background: var(--field-board); border: 2px solid var(--outline); border-radius: var(--r-md); cursor: pointer; }
.rooms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.rooms-grid button { display: flex; align-items: center; gap: 6px; min-height: 86px; padding: 6px 10px 6px 0; background: var(--paper-light); color: var(--paper-ink); border: 1px solid var(--paper-shadow); border-radius: var(--r-md); cursor: pointer; text-align: left; }
.rooms-grid img { flex: none; width: 80px; height: 66px; object-fit: contain; }
.rooms-grid button > span { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rooms-grid b { font: 800 19px/1.05 var(--font-display); }
.room-arrow { display: flex; flex: none; color: var(--door-team); transform: rotate(180deg); }
.room-arrow .ic { width: 16px; height: 16px; }
.rooms-grid [aria-current] { border: 2px solid var(--door-team); background: var(--steel-light); }
.rooms-grid [aria-current] .room-arrow { transform: none; }
@media (hover: hover) {
  html #scr-menu :is(.modebtn, .adventurecard, .gauntletbtn, .clashbtn, .menurow .menubtn):hover { transform: translateY(-3px); filter: brightness(1.06); box-shadow: 0 6px var(--outline), var(--sh-3); }
  .rooms-grid button:hover { background: var(--paper); border-color: var(--door-team); }
  .rooms-button:hover { filter: brightness(1.2); }
}
html #scr-menu :is(.modebtn, .adventurecard, .gauntletbtn, .clashbtn, .menurow .menubtn):active { transform: translateY(2px); box-shadow: 0 1px var(--outline), var(--sh-1); }

@media (max-width: 1149px) {
  html #scr-menu .menucenter { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; }
  html #scr-menu .menurow .destination-art { flex-basis: 66px; width: 66px; height: 64px; }
  html #scr-menu .menurow .menubtn .mb-tx { font-size: 18px; }
}
@media (max-width: 700px) {
  html #scr-menu .menucenter { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  html #scr-menu .menuhero { height: 132px; }
  html #scr-menu .kingdom-logo { height: 125px; }
  html #scr-menu .adventuredeck { grid-row: 3; }
  html #scr-menu .bigbtn.modebtn { min-height: 142px; padding: 12px; }
  html #scr-menu .modebtn .destination-art { width: 132px; height: 72px; }
  html #scr-menu .modebtn .bttl { font-size: 22px; }
  html #scr-menu .modebtn .bsub { font-size: 10px; }
  html #scr-menu :is(.adventurecard, .gauntletbtn, .clashbtn) { min-height: 123px; padding: 4px 5px 12px; }
  html #scr-menu :is(.adventurecard, .gauntletbtn, .clashbtn) .destination-art { height: 82px; max-height: 86px; }
  html #scr-menu :is(.adventure-copy b, .cb-tx) { font-size: 19px; }
  html #scr-menu .cb-sub { font-size: 11px; }
  html #scr-menu .menurow { grid-row: 4; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  html #scr-menu .menurow .menubtn { min-height: 72px; padding: 8px 7px 8px 0; }
  html #scr-menu .menurow .destination-art { flex-basis: 60px; width: 60px; height: 58px; }
  html #scr-menu .menurow .menubtn .mb-tx { font-size: 17px; }
  html #scr-menu .kingdom-caption { grid-row: 5; }
  html #scr-menu .racerow { grid-row: 6; }
  html .screen:not(#scr-menu) .rooms-button { width: 36px; min-height: 36px; padding: 5px; }
  .rooms-button span { display: none; }
  .castle-rooms { padding: 14px; }
  .rooms-heading h2 { font-size: 27px; }
  .rooms-grid { grid-template-columns: 1fr; gap: 8px; }
  .rooms-grid button { min-height: 70px; }
  .rooms-grid img { width: 72px; height: 56px; }
}
html.phone #scr-menu .menurow { order: 3; }
html.phone #scr-menu .bigbtn.modebtn { min-height: 142px; padding: 12px; }
html.phone #scr-menu .modebtn .destination-art { width: 132px; height: 72px; }
html.phone #scr-menu .modebtn .mode-copy { padding: 0; }
html.phone #scr-menu .adventuredeck.withgauntlet.withclash { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
html.phone #scr-menu .adventuredeck.withgauntlet .campaignbtn { grid-column: auto; }
html.phone #scr-menu .menurow .menubtn { flex-direction: row; }
html.phone #scr-menu .menurow .menubtn .mb-tx { overflow: visible; text-overflow: clip; white-space: normal; }
html.phone #scr-menu .kingdom-caption { order: 4; }
html.phone #scr-menu .racerow { order: 5; }
html.phone.portrait #scr-menu .menucenter { gap: 14px; }
html.phone.portrait #scr-menu .bigbtn.modebtn { min-height: 142px; padding: 12px; }
html.phone.landscape #scr-menu .bigbtn.modebtn { min-height: 142px; padding: 12px; }
html.phone.portrait #scr-menu .adventuredeck { max-width: none; }
html.phone.portrait #scr-menu .menurow { order: 3; display: grid; gap: 12px; }
html.phone.portrait #scr-menu .menurow .menubtn { min-height: 72px; padding: 8px 7px 8px 0; }
html.phone.portrait #scr-menu .menurow .menubtn .mb-tx { font-size: 17px; }
html.phone.portrait #scr-menu .racerow { order: 5; }
html.phone.landscape #scr-menu .menurow { grid-area: 3 / 1 / 4 / 3; }
html.phone.landscape #scr-menu .kingdom-caption { grid-area: 4 / 1 / 5 / 3; }
html.phone.landscape #scr-menu .racerow { grid-area: 5 / 1 / 6 / 3; }
html.phone.landscape #scr-menu .adventuredeck { width: 100%; }
html.phone.landscape #scr-menu :is(.adventurecard, .gauntletbtn, .clashbtn) { min-height: 142px; }
html.phone.landscape #scr-menu .menurow .menubtn { min-height: 72px; gap: 2px; }
html.phone.landscape #scr-menu .menurow .menubtn .mb-tx { font-size: 17px; white-space: normal; }
html.phone.landscape #scr-menu .menurow .destination-art { flex-basis: 58px; width: 58px; }
@media (prefers-reduced-motion: reduce) {
  html #scr-menu :is(.modebtn, .adventurecard, .gauntletbtn, .clashbtn, .menurow .menubtn) { transition: none; }
  html #scr-menu :is(.modebtn, .adventurecard, .gauntletbtn, .clashbtn, .menurow .menubtn):hover { transform: none; }
}

/* Preserve the reference home composition: the kingdom rail comes first,
   followed by a narrow battle stack and the full-width destination row. */
html #scr-menu { background: url('/img/menu/kingdom-valley.webp?v=b7f03f18') center / cover no-repeat; }
html #scr-menu .menucenter { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: none; width: min(1250px, 100%); max-width: 1250px; gap: 16px; padding: 0 16px 26px; }
html #scr-menu .menuhero { grid-column: 1; grid-row: 1; height: 210px; }
html #scr-menu .kingdom-logo { height: 182px; }
html #scr-menu .racerow { grid-column: 1; grid-row: 2; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 10px; }
html #scr-menu .racecard { min-height: 176px; padding: 8px 5px 24px; }
html #scr-menu .rc-host { --host-size: 80px; }
html #scr-menu .battledeck { grid-column: 1; grid-row: 3; justify-self: center; width: min(760px, 100%); align-self: start; }
html #scr-menu .modepanel { flex: none; }
html #scr-menu .modelist { height: auto; gap: 12px; }
html #scr-menu .bigbtn.modebtn { flex-direction: row; align-items: center; justify-content: center; min-height: 72px; padding: 10px 14px; }
html #scr-menu .modebtn .destination-art { position: absolute; top: 50%; left: 12px; right: auto; width: 55px; height: 43px; z-index: 0; transform: translateY(-50%); }
html #scr-menu .mode-copy { align-items: center; padding: 0 0 0 42px; }
html #scr-menu .bigbtn.modebtn .bttl { font: 800 24px/1.1 var(--font-display); text-align: center; }
html #scr-menu .modebtn .bsub { border: 0; padding-top: 0; text-align: center; }
html #scr-menu .lp-chip { flex-direction: row; height: 54px; min-height: 54px; }
html #scr-menu .lp-chip .lp-card { padding: 5px 10px; }
html #scr-menu .lp-chip .lp-rankck { min-height: 0; padding: 0 9px; border-top: 0; border-left: 1px solid var(--edge-quiet); }
html #scr-menu #rankbadge { margin-bottom: 9px; }
html #scr-menu .adventuredeck.withgauntlet.withclash { grid-column: 1; grid-row: 4; justify-self: center; width: min(760px, 100%); grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
html #scr-menu :is(.adventurecard, .gauntletbtn, .clashbtn) { flex-direction: column; align-items: center; justify-content: center; min-height: 76px; padding: 6px 8px; gap: 0; }
html #scr-menu :is(.adventurecard, .gauntletbtn, .clashbtn) .destination-art { flex: none; width: 48px; height: 33px; max-height: none; }
html #scr-menu .adventurecard .adventure-copy { margin: 0; }
html #scr-menu :is(.adventure-copy b, .cb-tx) { color: var(--paper-ink); font: 800 17px/1.1 var(--font-display); text-transform: uppercase; }
html #scr-menu .menurow { grid-column: 1; grid-row: 5; width: 100%; gap: 12px; }
html #scr-menu .menurow .menubtn { min-height: 74px; padding: 10px 12px; gap: 8px; }
html #scr-menu .menurow .destination-art { flex-basis: 44px; width: 44px; height: 42px; }
html #scr-menu .menurow .menubtn .mb-tx { font-size: 18px; text-transform: uppercase; }
@media (max-width: 1149px) {
  html #scr-menu .racerow { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
  html #scr-menu .racecard { min-height: 146px; }
  html #scr-menu .rc-host { --host-size: 65px; }
}
@media (max-width: 700px) {
  html #scr-menu .menuhero { height: 146px; }
  html #scr-menu .kingdom-logo { height: 125px; }
  html #scr-menu .racecard { min-height: 122px; }
  html #scr-menu .rc-host { --host-size: 54px; }
  html #scr-menu .bigbtn.modebtn { min-height: 64px; padding: 8px; }
  html #scr-menu .modebtn .destination-art { left: 5px; width: 35px; height: 30px; }
  html #scr-menu .mode-copy { padding-left: 28px; }
  html #scr-menu .bigbtn.modebtn .bttl { font-size: 17px; }
  html #scr-menu .menurow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  html #scr-menu .menurow .menubtn { min-height: 62px; padding: 8px; gap: 5px; }
  html #scr-menu .menurow .menubtn .mb-tx { font-size: 15px; }
  html #scr-menu .menurow .destination-art { flex-basis: 35px; width: 35px; height: 35px; }
}
html.phone #scr-menu .menucenter { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; grid-template-areas: none; height: auto; gap: 12px; }
html.phone #scr-menu .menuhero { grid-area: 1 / 1 / 2 / 2; order: 0; }
html.phone #scr-menu .racerow { grid-area: 2 / 1 / 3 / 2; order: 1; }
html.phone #scr-menu .battledeck { grid-area: 3 / 1 / 4 / 2; order: 2; width: min(760px, 100%); }
html.phone #scr-menu .adventuredeck.withgauntlet.withclash { grid-area: 4 / 1 / 5 / 2; order: 3; width: min(760px, 100%); }
html.phone #scr-menu .menurow { grid-area: 5 / 1 / 6 / 2; order: 4; }
html.phone #scr-menu .bigbtn.modebtn { min-height: 64px; padding: 8px; }
html.phone #scr-menu .modebtn .destination-art { width: 35px; height: 30px; }
html.phone #scr-menu .modebtn .mode-copy { padding-left: 28px; }
html.phone.portrait #scr-menu .menuhero { grid-area: 1 / 1 / 2 / 2; }
html.phone.portrait #scr-menu .racerow { grid-area: 2 / 1 / 3 / 2; order: 1; }
html.phone.portrait #scr-menu .battledeck { grid-area: 3 / 1 / 4 / 2; }
html.phone.portrait #scr-menu .adventuredeck { grid-area: 4 / 1 / 5 / 2; }
html.phone.portrait #scr-menu .menurow { grid-area: 5 / 1 / 6 / 2; order: 4; }
html.phone.portrait #scr-menu .menurow .menubtn { min-height: 62px; padding: 8px; }
html.phone.portrait #scr-menu .menurow .menubtn .mb-tx { font-size: 15px; }
html.phone.landscape #scr-menu .menucenter { grid-template-columns: minmax(0, 1fr); }
html.phone.landscape #scr-menu .menuhero { grid-area: 1 / 1 / 2 / 2; height: 118px; }
html.phone.landscape #scr-menu .racerow { grid-area: 2 / 1 / 3 / 2; grid-template-columns: repeat(10, minmax(0, 1fr)); }
html.phone.landscape #scr-menu .battledeck { grid-area: 3 / 1 / 4 / 2; }
html.phone.landscape #scr-menu .adventuredeck { grid-area: 4 / 1 / 5 / 2; }
html.phone.landscape #scr-menu .menurow { grid-area: 5 / 1 / 6 / 2; display: flex; }
html.phone.landscape #scr-menu .bigbtn.modebtn { min-height: 64px; padding: 8px; }
html.phone.landscape #scr-menu :is(.adventurecard, .gauntletbtn, .clashbtn) { min-height: 76px; }
html.phone.landscape #scr-menu .menurow .menubtn { min-height: 62px; padding: 8px; }
html.phone.landscape #scr-menu .menurow .destination-art { flex-basis: 35px; width: 35px; height: 35px; }
html.phone.landscape #scr-menu .menurow .menubtn .mb-tx { font-size: 15px; }
