/* V6 secondary screens. Ornamental material comes from the generated UI kit. */
:root {
  --panel-enamel: #102c3b;
  --panel-deep: #081c2a;
  --panel-ivory: #fff0ce;
  --panel-gold: #ddb96d;
  --panel-muted: #b9d0d8;
  --panel-line: #d8b87546;
  --panel-jade: #0b847a;
}

.hub-panel, .modal-box, .upgrade-dialog, .small-dialog, .result-dialog {
  border: 18px solid transparent;
  border-image: url('./assets/ui-v6/panel.png') 96 fill / 18px stretch;
  border-radius: 28px;
  background: var(--panel-enamel);
  background-clip: padding-box;
  color: var(--panel-ivory);
  box-shadow: 0 18px 65px #04162073;
  scrollbar-width: thin;
  scrollbar-color: #c7a76b80 #0b202b;
  overscroll-behavior: contain;
}
.hub-panel {
  inset: 110px 4.2% 112px;
  max-width: 1280px;
  padding: 24px 25px 31px;
}
.hub-panel h2, .hub-panel h3, .modal-box h2, .modal-box h3,
.upgrade-dialog h2, .small-dialog h2, .result-dialog h2,
.card-title, .card-info strong, .reveal-content h2 {
  font-family: 'Bree Serif', Georgia, serif;
  font-weight: 400;
  letter-spacing: -.025em;
  color: var(--panel-ivory);
  text-shadow: 0 2px 1px #03142088;
}
.hub-panel h2 em, .modal-box h2 em, .upgrade-dialog h2 em,
.small-dialog h2 em, .result-dialog h2 em { color: #b9e2db; }
.hub-panel .eyebrow, .modal-box .eyebrow, .upgrade-dialog .eyebrow,
.small-dialog .eyebrow, .result-dialog .eyebrow { color: var(--panel-gold); }
.hub-panel p, .modal-box p, .small-dialog p, .result-dialog > p { color: var(--panel-muted); }
.section-heading { align-items: end; margin-bottom: 23px; }
.section-heading h2 { font-size: 35px; }
.count-badge {
  padding: 10px 18px;
  border-color: var(--panel-line);
  background: #071e2ab3;
  color: var(--panel-ivory);
  font-size: 17px;
  box-shadow: inset 0 1px 0 #fff3c916;
}
.collection-tools { gap: 16px; margin-bottom: 26px; }
.collection-tools > .muted { color: var(--panel-muted); font-size: 12px; line-height: 1.6; }
.hub-panel .segmented, .map-toolbar .segmented {
  background: #061a25c2;
  border: 1px solid var(--panel-line);
  padding: 4px;
}
.hub-panel .segmented button, .map-toolbar .segmented button {
  min-height: 44px;
  padding: 10px 19px;
  color: var(--panel-muted);
  font-size: 12px;
}
.hub-panel .segmented button.active, .map-toolbar .segmented button.active {
  background: #146259;
  color: #fff3d2;
  box-shadow: inset 0 0 0 1px #cba56685;
}

/* The collection reads as a set of illustrated, tangible cards. */
.heroes-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 22px 18px; }
.hero-card {
  border: 12px solid transparent;
  border-image: url('./assets/ui-v6/panel.png') 96 fill / 12px stretch;
  border-radius: 22px;
  background: var(--panel-deep);
  background-clip: padding-box;
  box-shadow: 0 7px 17px #03131e70;
  overflow: visible;
}
.hero-card:hover { transform: translateY(-4px); box-shadow: 0 11px 23px #020f1d9c; }
.hero-card.selected { box-shadow: 0 0 0 2px #9ed8c2, 0 0 22px #4ac1a72e; }
.hero-card.locked { border-image-source: url('./assets/ui-v6/panel.png'); opacity: .86; }
.card-art {
  height: 164px;
  border-radius: 14px 14px 0 0;
  background: #17384a;
  overflow: hidden;
}
.card-art::before {
  inset: 16px auto auto 50%;
  width: 136px;
  height: 136px;
  transform: translateX(-50%);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: url('./assets/ui-v6/ring.png') center / contain no-repeat;
  opacity: .42;
}
.card-art::after { content: none; }
.hero-card .hero-portrait { width: 165px; height: 188px; margin-bottom: -10px; filter: drop-shadow(0 9px 8px #00101880); }
.hero-model-image { position: relative; z-index: 1; display: block; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 9px 8px #00101880); }
.hero-card .hero-model-image { width: 160px; height: 171px; margin: 0 auto -7px; }
.hero-card.locked .hero-model-image { filter: saturate(.45) brightness(.68) drop-shadow(0 8px 6px #00101880); }
.hero-card.locked .hero-portrait { filter: saturate(.52) brightness(.8) drop-shadow(0 8px 6px #00101880); }
.card-rarity {
  top: 7px;
  font-size: 8px;
  letter-spacing: .13em;
  padding: 4px 9px;
  border-radius: 999px;
  background: #051a28bf;
}
.hero-level-badge { right: 6px; bottom: 22px; background: #071c2ae8; border-color: #d5b57680; color: var(--panel-ivory); font-size: 9px; }
.card-owned-strip { background: #09232de8; color: #bfe3d5; bottom: 0; font-size: 7px; padding: 7px 3px 6px; }
.card-owned-strip.unlock { color: #bfced1; }
.card-info { padding: 13px 9px 10px; min-height: 76px; border-color: var(--panel-line); background: #0c2432; border-radius: 0 0 12px 12px; }
.card-info > span { min-width: 0; }
.card-info strong { font-size: 23px; }
.card-info small { color: var(--panel-muted); font-size: 11px; line-height: 1.4; }
.card-info > .glyph { background: #183747; color: var(--rarity); width: 28px; height: 28px; }
.selected-check { left: 5px; bottom: 81px; background: #b9e7cd; color: #123e3b; box-shadow: 0 0 0 3px #173e49; }

/* Common modal frame and readable body text. */
.overlay { padding: 24px; background: #041725b5; backdrop-filter: blur(9px); }
.modal-box { width: min(100%, 900px); padding: 25px 27px 28px; max-height: calc(100dvh - 48px); overflow: auto; }
.small-dialog::before, .upgrade-dialog::before, .result-dialog::before, .modal-box::before { content: none; }
.modal-box h2 { font-size: 38px; line-height: 1.12; margin: 10px 0 19px; }
.modal-box p { font-size: 13px; line-height: 1.7; }
.modal-close { top: 4px; right: 4px; width: 44px; height: 44px; min-width: 44px; min-height: 44px; background: #0a2636; border-color: var(--panel-gold); }
.modal-close:hover { background: #204654; }
.hero-detail { grid-template-columns: minmax(220px, .86fr) minmax(0, 1.25fr); align-items: start; gap: 30px; }
.detail-art {
  min-height: 346px;
  height: 370px;
  margin-top: 13px;
  border: 14px solid transparent;
  border-image: url('./assets/ui-v6/panel.png') 96 fill / 14px stretch;
  border-radius: 28px;
  background: #173e4c;
  background-clip: padding-box;
  box-shadow: 0 12px 28px #03131d55;
}
.detail-art::before {
  inset: 12% 2%;
  border: 0;
  border-radius: 0;
  transform: none;
  background: url('./assets/ui-v6/ring.png') center / contain no-repeat;
  opacity: .6;
}
.detail-art::after { content: none; }
.detail-art .hero-portrait { height: 318px; width: 277px; max-width: 114%; }
.detail-art .hero-model-image { height: 335px; width: 100%; margin: 10px auto 0; }
.rarity-tag { top: 9px; font-size: 9px; background: #071d2bd9; padding: 6px 14px; border-radius: 999px; letter-spacing: .12em; }
.detail-role { position: absolute; bottom: 11px; left: 12px; right: 12px; z-index: 3; text-align: center; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--panel-ivory); background: #0a2536e8; border: 1px solid var(--panel-line); border-radius: 999px; padding: 8px 10px; }
.detail-body { min-width: 0; }
.detail-body .eyebrow { padding-right: 30px; font-size: 9px; }
.detail-body h2 { font-size: 43px; margin: 8px 0 5px; padding-right: 25px; }
.detail-body .hero-title { color: #c1d8da; font-size: 13px; margin-bottom: 17px; }
.weapon-description { border-color: var(--panel-line); padding: 14px 0; }
.weapon-description > strong { font-size: 14px; color: var(--panel-ivory); }
.weapon-description p { font-size: 13px; margin-top: 8px; }
.hero-skill-tags > span { background: #0c2231; border-color: #d1b3733b; color: #c9ddd8; font-size: 10px; padding: 5px 9px; }
.detail-body .hero-combat-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 18px 0 10px; }
.detail-body .hero-combat-metrics > span { display: grid; grid-template-columns: 24px 1fr; column-gap: 8px; align-items: center; min-width: 0; padding: 9px 10px; border: 1px solid #c6a66e9c; border-radius: 18px; background: #071d2b; line-height: 1.2; letter-spacing: 0; }
.detail-body .hero-combat-metrics > span > .glyph { grid-row: 1 / 3; width: 23px; height: 23px; color: var(--panel-gold); }
.detail-body .hero-combat-metrics small { color: var(--panel-muted); font-size: 7px; line-height: 1.3; letter-spacing: .06em; }
.detail-body .hero-combat-metrics b { font: 600 19px/1.2 Outfit, sans-serif; color: var(--panel-ivory); margin: 2px 0 0; }
.detail-secondary-stats { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0 0 17px; padding: 2px 3px; color: var(--panel-muted); font-size: 11px; line-height: 1.6; }
.detail-secondary-stats b { color: #f3e3bc; margin-left: 3px; font-weight: 650; }
.hero-trait-card { display: flex; gap: 12px; align-items: start; padding: 13px 14px; border: 1px solid #71aeaa4f; border-radius: 16px; background: #17433f66; }
.hero-trait-card > span { width: 32px; min-width: 32px; height: 36px; display: grid; place-items: center; }
.hero-trait-card .glyph { width: 28px; height: 28px; color: #b6ddbd; }
.hero-trait-card strong { display: block; font-size: 13px; color: #e8e3bb; }
.hero-trait-card p { margin: 5px 0 0; font-size: 12px; line-height: 1.6; color: #c5dad5; }
.hero-stat-explanation { margin: 9px 0 13px; border-bottom: 1px solid var(--panel-line); padding-bottom: 7px; }
.hero-stat-explanation summary { min-height: 44px; padding: 13px 2px; font-size: 11px; font-weight: 600; color: #bed8dc; cursor: pointer; }
.hero-stat-explanation p { font-size: 12px; margin: 0 0 10px; line-height: 1.6; }
.detail-body > .primary-button, .detail-body > .secondary-button { min-height: 50px; font-size: 13px; margin-top: 11px; padding: 12px 17px; }
.detail-body .detail-note { font-size: 12px; line-height: 1.6; color: #bed3d1; margin-top: 13px; }
.stat-training { display: grid; gap: 7px; margin-top: 14px; padding: 12px; border: 1px solid var(--panel-line); border-radius: 18px; background: #061b28a8; }
.stat-training-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 2px 3px 8px; }
.stat-training-head strong { color: #f1dfb9; font-size: 13px; }
.stat-training-head span { color: #a9c4ca; font-size: 10px; text-align: right; }
.stat-row { display: grid; grid-template-columns: 27px minmax(112px,1fr) 52px 40px 82px; gap: 8px; align-items: center; min-height: 44px; padding: 5px 6px; border-radius: 12px; background: #11303e; }
.stat-icon { display: grid; place-items: center; color: var(--panel-gold); }
.stat-icon .glyph { width: 21px; height: 21px; }
.stat-copy { min-width: 0; }
.stat-copy b { display: block; color: #eef1d4; font-size: 11px; }
.stat-copy small { display: block; color: #9eb9c1; font-size: 8px; line-height: 1.35; }
.stat-value { color: #fff0ca; font-size: 12px; text-align: right; }
.stat-rank { color: #8fd8c1; font-size: 10px; text-align: center; }
.stat-row button { min-height: 34px; padding: 5px 8px; border: 1px solid #d1b37077; border-radius: 10px; background: #17665b; color: #fff0cc; font: 700 9px Outfit,sans-serif; white-space: nowrap; }
.stat-row button .glyph { width: 12px; height: 12px; vertical-align: -3px; }
.stat-row button:disabled { opacity: .48; background: #173744; }

/* Invocation: a painted altar instead of a CSS illustration. */
.summon-panel { align-items: center; min-height: 0; }
.summon-copy { width: 52%; max-width: 520px; }
.summon-copy h2 { font-size: 45px; line-height: 1.1; margin: 14px 0 19px; }
.summon-copy h2 em { color: #c9d7ff; }
.summon-copy > p { color: #c6d6db; font-size: 14px; line-height: 1.7; }
.guarantee-card { margin: 22px 0; padding: 17px 0; border-color: var(--panel-line); }
.guarantee-card > .glyph { color: var(--panel-gold); background: #d9bc6d0d; }
.guarantee-card strong { color: #f8e8c4; font-size: 13px; }
.guarantee-card small { color: #bcd0d8; font-size: 11px; }
.summon-actions { gap: 12px; }
.summon-actions .primary-button { background: url('./assets/ui-v6/primary.png') center / 100% 100% no-repeat; background-color: transparent; border-color: transparent; color: #fff2ce; box-shadow: none; }
.summon-actions button { min-height: 56px; padding: 14px 17px; font-size: 14px; }
.summon-copy .summon-small { color: #b9ced4; font-size: 12px; line-height: 1.6; }
.rates { background: #071e2e9c; border-color: var(--panel-line); border-radius: 17px; padding: 5px 15px 12px; }
.rates summary { min-height: 44px; padding: 10px 0; color: #e8d9b8; font-size: 12px; }
.rates p { font-size: 12px; color: #bbd1d8; }
.rates-grid { gap: 10px; }
.rates-grid span { font-size: 10px; }
.rates-grid b { font-size: 17px; }
.altar-scene { left: 55%; right: 0; top: 8%; bottom: 8%; }
.summon-altar-art { display: block; width: 100%; height: 100%; max-height: 510px; object-fit: contain; filter: drop-shadow(0 16px 26px #020e2480); animation: v6AltarFloat 6s ease-in-out infinite; }
.altar-caption { bottom: 1%; font-size: 10px; letter-spacing: .13em; color: #d7c59d; }
.altar-beam, .altar-diamond, .altar-platform, .altar-orbit, .altar-spark { display: none; }
.summon-reveal { background: #071e2bf5; overflow: auto; }
.reveal-rays, .reveal-particles { display: none; }
.reveal-orbits { width: min(68vw, 650px); height: min(68vw, 650px); background: url('./assets/ui-v6/ring.png') center / contain no-repeat; opacity: .2; }
.reveal-orbits i { display: none; }
.reveal-card { border: 17px solid transparent; border-image: url('./assets/ui-v6/panel.png') 96 fill / 17px stretch; border-radius: 26px; background: #17394b; background-clip: padding-box; box-shadow: 0 18px 60px #000c147a; width: 232px; height: 280px; }
.reveal-card::before { inset: 8px; border: 0; border-radius: 0; background: url('./assets/ui-v6/ring.png') center / contain no-repeat; opacity: .55; }
.reveal-card .hero-portrait { height: 267px; width: 232px; }
.reveal-stage { position: absolute; inset: -24px; z-index: 2; }
.reveal-stage canvas { width: 100%; height: 100%; display: block; }
.reveal-fallback { position: absolute; inset: 0; display: grid; place-items: center; z-index: 1; }
.reveal-stage:not([data-fallback='true']) + .reveal-fallback { display: none; }
.reveal-fallback .hero-portrait { height: 267px; width: 232px; }
.summon-reveal.charging .reveal-card { box-shadow: 0 0 0 2px var(--rarity),0 0 70px color-mix(in srgb,var(--rarity) 62%,transparent),0 18px 60px #000c147a; }
.reveal-content > .eyebrow { color: var(--rarity); }
.reveal-content h2 { color: #fff0cb; font-size: 44px; }
.reveal-content p { color: #c6dade; font-size: 14px; line-height: 1.6; }
.reveal-content > .primary-button { min-height: 56px; }
.mystery { display: block; font-size: 0; width: 190px; height: 240px; background: url('./assets/ui-v6/altar.png') center / contain no-repeat; }
.summon-reveal.charging .reveal-card { animation: v6AltarFloat 3s ease-in-out infinite; }

/* Choices, pauses and results share the same material and hierarchy. */
.upgrade-dialog { width: min(100%, 1040px); padding: 25px 26px 22px; max-height: calc(100dvh - 48px); overflow: auto; }
.upgrade-heading h2 { font-size: 40px; }
.paused-note { color: #b9d0d6; font-size: 9px; }
.upgrade-context { color: #c7dcd7; font-size: 12px; }
.evolution-path { color: #bed2d4; font-size: 10px; }
.evolution-path > span { background: #08232e; border-color: var(--panel-line); }
.evolution-path > span.ready { background: #185448; color: #d3ebc1; border-color: #abd09b66; }
.upgrade-cards { gap: 18px; margin: 24px 0 22px; }
.upgrade-card { padding: 18px 16px; min-height: 260px; border: 13px solid transparent; border-image: url('./assets/ui-v6/panel.png') 96 fill / 13px stretch; border-radius: 22px; background: #103647; background-clip: padding-box; box-shadow: 0 9px 20px #03152460; overflow: visible; }
.upgrade-card::after { content: none; }
.upgrade-card:hover { background-color: #1a4351; transform: translateY(-4px); box-shadow: 0 0 0 2px var(--rarity), 0 12px 23px #03101d85; }
.card-top { margin-bottom: 18px; }
.upgrade-icon { background: url('./assets/ui-v6/ring.png') center / contain no-repeat; border: 0; box-shadow: none; border-radius: 0; width: 56px; height: 56px; }
.upgrade-icon .glyph { width: 27px; height: 27px; }
.rarity-word { font-size: 9px; letter-spacing: .08em; }
.card-kind { color: #b4ced4; font-size: 9px; }
.card-title { font-size: 24px; line-height: 1.15; margin-top: 8px; }
.card-description { color: #c5d8db; font-size: 13px; line-height: 1.6; }
.offer-level { font-size: 10px; }
.card-bottom { color: #eadbb8; font-size: 10px; }
.card-bottom > span:last-child { border-color: #d1b27377; color: #f4dfaa; }
.upgrade-footer > span { color: #b9cfd5; font-size: 12px; }
.upgrade-footer > .text-button { min-height: 44px; }
.rift-reward { background: #123b3d; border-color: var(--panel-line); border-radius: 18px; }
.rift-reward-icon { background: url('./assets/ui-v6/ring.png') center / contain no-repeat; border: 0; border-radius: 0; box-shadow: none; }
.rift-reward small { color: #c8d9cf; }
.rift-reward strong { color: var(--panel-ivory); }
.rift-reward p { color: #c0d7d2; }
.small-dialog { width: min(100%, 490px); padding: 27px 26px 25px; max-height: calc(100dvh - 48px); overflow: auto; }
.dialog-sigil { background: url('./assets/ui-v6/ring.png') center / contain no-repeat; border: 0; box-shadow: none; border-radius: 0; color: var(--panel-gold); }
.small-dialog h2 { font-size: 37px; line-height: 1.15; }
.small-dialog p { color: #c3d9dc; font-size: 14px; }
.small-dialog > small { font-size: 11px; color: #adc7ce; }
.small-dialog > .primary-button, .small-dialog > .secondary-button { min-height: 52px; }
.pause-tools { gap: 8px 14px; margin-top: 10px; }
.pause-tools .pause-guide-button { min-height: 44px; padding: 10px 6px; font-size: 12px; color: #e1d2b0; }
.pause-build { color: #c4d8db; }
.result-dialog { width: min(100%, 620px); padding: 25px 27px 28px; max-height: calc(100dvh - 48px); overflow: auto; }
.result-aura { display: none; }
.result-top .eyebrow { color: var(--panel-gold); }
.result-emblem { color: var(--panel-gold); }
.result-dialog h2 { font-size: 43px; line-height: 1.1; }
.result-stats { padding: 22px 0; border-color: var(--panel-line); gap: 12px; }
.result-stats strong { font-family: 'Bree Serif', Georgia, serif; font-weight: 400; font-size: 34px; color: var(--panel-ivory); }
.result-stats small { font-size: 9px; color: #c1d4d7; line-height: 1.5; }
.result-discoveries { font-size: 12px; color: #c4d9dc; }
.secured-loot { border: 1px solid #bda16a78; border-radius: 20px; background: #16443c; padding: 19px; box-shadow: inset 0 1px #f4dd9c14; }
.secured-loot > span { color: #c7ddc8; font-size: 9px; }
.secured-loot > div { font-size: 29px; gap: 25px; flex-wrap: wrap; }
.result-milestones { font-size: 12px; color: #d8e4c4; }
.result-milestones > div { background: #9ac6aa0b; border: 1px solid #bdd5a429; border-radius: 13px; }

/* Chronicles and utilities remain part of the game, not a separate dashboard. */
.career-stats { margin: 22px 0 32px; gap: 16px; }
.career-stat { padding: 19px; border: 1px solid var(--panel-line); border-radius: 20px; background: #071e2a99; }
.career-stat > .glyph { color: var(--panel-gold); }
.career-stat strong { font-family: 'Bree Serif', Georgia, serif; font-size: 37px; font-weight: 400; color: var(--panel-ivory); }
.career-stat small { color: #bed0d4; font-size: 9px; }
.milestone-heading h3 { font-size: 25px; }
.milestone-heading span { color: #b8ced3; font-size: 12px; }
.milestones { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 17px; }
.milestone { padding: 21px; border: 1px solid #c3a36c65; border-radius: 20px; background: #0b2533; }
.milestone.claimed { background: #173d36; border-color: #8dbba467; }
.milestone-top { color: var(--panel-gold); }
.milestone.claimed .milestone-top { color: #b8dfc1; }
.milestone h3 { font-size: 21px; }
.milestone p { color: #bfd2d7; font-size: 13px; min-height: 42px; }
.milestone-track { height: 6px; background: #051722; border: 1px solid #74909326; }
.milestone-track i { background: #b7d1a2; }
.milestone-reward { color: #f4dfb6; font-size: 12px; }
.settings-section { border-color: var(--panel-line); margin-top: 24px; padding-top: 21px; }
.settings-section h3 { font-size: 22px; }
.settings-section p { color: #c0d5db; font-size: 13px; }
.settings-actions { gap: 10px; }
.settings-actions > .secondary-button { white-space: normal; min-height: 50px; font-size: 12px; }
.import-label { border-color: #be9c6299; background: #173d4d; color: var(--panel-ivory); min-height: 50px; font-size: 12px; }
.settings-section .settings-state { color: #b6e1c1; font-size: 12px; }
.settings-section .file-hint { color: #b9ced4; font-size: 11px; }
.comfort-toggle { min-height: 52px; color: var(--panel-ivory); }
.comfort-toggle input { border-color: #c4a05d99; background: #0a202d; }
.comfort-toggle input:checked { background: #0c8071; border-color: #c4d69b; }
.comfort-toggle input::after { background: #dccb9e; }
.comfort-toggle input:checked::after { background: #f3ebc9; }
.guide-controls span { background: #081f2c; color: #bed3d9; border: 1px solid #ccaf723b; }
.guide-controls b { color: var(--panel-ivory); }
.guide-place { background: #0b2736; border-color: var(--panel-line); border-radius: 18px; min-height: 82px; }
.guide-place strong { color: var(--panel-ivory); font-size: 14px; }
.guide-place small { color: #bfd2d7; font-size: 12px; }
.poi-guide-emblem { border: 0; border-radius: 0; box-shadow: none; background: url('./assets/ui-v6/ring.png') center / contain no-repeat; }
.poi-guide-step { border-color: var(--panel-line); }
.poi-guide-step > span { color: #efdab0; background: #173746; border-color: #c7a56877; }
.poi-guide-step strong { color: var(--panel-ivory); }
.poi-guide-reward small { color: #b6d0d2; }
.map-modal { width: min(100%, 940px); }
.map-layout { grid-template-columns: minmax(0, 1fr) 240px; gap: 27px; }
.world-map { padding: 7px; border: 2px solid #d4b7789e; background: #071e29; box-shadow: 0 0 0 5px #06172388; filter: saturate(.9); }
.map-legend { gap: 9px; }
.map-legend button { min-height: 60px; border-color: var(--panel-line); border-radius: 10px; padding: 9px 7px; }
.map-legend button:hover { background: #1c485480; }
.map-legend button strong { color: var(--panel-ivory); font-size: 13px; }
.map-legend button small { color: #bdd1d7; font-size: 11px; }
.map-toolbar > span { color: #b9cfd5; font-size: 12px; }
.map-caption { color: #bed2d6 !important; font-size: 12px !important; line-height: 1.6; }
.terrain-legend { color: #c4d6d9; }

@keyframes v6AltarFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

@media (max-width: 1000px) and (min-width: 601px) and (min-height: 521px) {
  .heroes-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px 14px; }
  .hero-detail { grid-template-columns: minmax(190px, .8fr) minmax(0, 1.2fr); gap: 22px; }
  .detail-art { height: 320px; min-height: 320px; }
  .detail-art .hero-portrait { height: 290px; width: 252px; }
  .detail-body .hero-combat-metrics > span { grid-template-columns: 1fr; text-align: center; padding: 9px 6px; }
  .detail-body .hero-combat-metrics > span > .glyph { display: none; }
  .milestones { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) and (orientation: portrait) {
  .hub-panel { inset: 93px 10px 94px; padding: 17px 11px 23px; border-width: 13px; border-image-width: 13px; border-radius: 22px; }
  .section-heading { align-items: center; gap: 12px; margin-bottom: 20px; }
  .section-heading .eyebrow { font-size: 8px; line-height: 1.5; letter-spacing: .08em; }
  .section-heading h2 { font-size: 28px; }
  .count-badge { font-size: 13px; padding: 9px 11px; }
  .collection-tools { display: block; margin-bottom: 20px; }
  .collection-tools > .muted { display: block; font-size: 11px; margin-top: 11px; text-align: left; }
  .hub-panel .segmented { width: 100%; }
  .hub-panel .segmented button { flex: 1; padding: 10px 11px; font-size: 12px; min-height: 44px; }
  .heroes-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 10px; }
  .hero-card { border-width: 10px; border-image-width: 10px; border-radius: 19px; }
  .card-art { height: 143px; }
  .card-art::before { width: 112px; height: 112px; top: 24px; }
  .hero-card .hero-portrait { width: 139px; height: 160px; margin-bottom: -7px; }
  .card-rarity { top: 5px; font-size: 7px; letter-spacing: .06em; padding: 4px 7px; }
  .hero-level-badge { right: 3px; bottom: 21px; font-size: 7px; padding: 5px; min-width: 27px; }
  .card-owned-strip { display: block; font-size: 6px; padding: 7px 1px 6px; }
  .card-info { padding: 11px 5px 8px; min-height: 80px; align-items: start; }
  .card-info strong { font-size: 21px; }
  .card-info small { font-size: 10px; min-height: 28px; line-height: 1.4; }
  .card-info > .glyph { width: 23px; height: 23px; padding: 4px; margin-top: 2px; }
  .selected-check { left: 3px; bottom: 83px; width: 21px; height: 21px; }
  .overlay { padding: 12px; }
  .modal-box, .upgrade-dialog, .small-dialog, .result-dialog { border-width: 13px; border-image-width: 13px; padding: 20px 15px; border-radius: 23px; max-height: calc(100dvh - 24px); }
  .modal-box h2 { font-size: 31px; line-height: 1.13; margin: 10px 0 17px; }
  .modal-close { top: 1px; right: 1px; }
  .hero-detail { display: grid; grid-template-columns: 1fr; gap: 21px; }
  .detail-art { height: 180px; min-height: 180px; max-width: 240px; width: 100%; margin: 6px auto 0; border-width: 11px; border-image-width: 11px; }
  .detail-art::before { inset: 5% 0; }
  .detail-art .hero-portrait { height: 199px; width: 173px; margin-top: 7px; }
  .rarity-tag { top: 1px; padding: 5px 11px; font-size: 8px; }
  .detail-role { font-size: 9px; padding: 6px 9px; bottom: 3px; left: 8px; right: 8px; }
  .detail-body h2 { font-size: 37px; margin: 8px 0 5px; padding-right: 0; }
  .detail-body .eyebrow { font-size: 9px; padding-right: 0; }
  .detail-body .hero-title { font-size: 13px; margin-bottom: 17px; }
  .weapon-description p { font-size: 13px; line-height: 1.65; }
  .hero-skill-tags > span { font-size: 10px; }
  .detail-body .hero-combat-metrics { gap: 7px; margin: 17px 0 11px; }
  .detail-body .hero-combat-metrics > span { grid-template-columns: 1fr; text-align: center; padding: 11px 5px; border-radius: 15px; }
  .detail-body .hero-combat-metrics > span > .glyph { display: none; }
  .detail-body .hero-combat-metrics small { font-size: 8px; }
  .detail-body .hero-combat-metrics b { font-size: 23px; margin-top: 5px; }
  .detail-secondary-stats { justify-content: space-between; gap: 6px; font-size: 11px; }
  .hero-trait-card { padding: 13px 12px; gap: 9px; }
  .hero-trait-card p, .hero-stat-explanation p, .detail-body .detail-note { font-size: 12px; }
  .hero-stat-explanation summary { font-size: 12px; }
  .detail-body > .primary-button, .detail-body > .secondary-button { min-height: 52px; font-size: 13px; }
  .summon-panel { display: flex; flex-direction: column; align-items: stretch; }
  .summon-copy { width: 100%; max-width: none; }
  .summon-copy h2 { font-size: 35px; margin-top: 11px; }
  .summon-copy > p { font-size: 13px; line-height: 1.65; }
  .guarantee-card { margin: 18px 0; gap: 10px; padding: 15px 0; }
  .guarantee-card strong { font-size: 13px; }
  .guarantee-card small { font-size: 11px; }
  .summon-actions { flex-direction: column; gap: 10px; }
  .summon-actions button { min-height: 52px; font-size: 14px; padding: 13px 17px; }
  .summon-copy .summon-small { font-size: 12px; margin: 18px 0 13px; }
  .rates summary { font-size: 12px; }
  .rates-grid { gap: 6px; }
  .rates-grid span { font-size: 9px; }
  .altar-scene { position: relative; inset: auto; order: -1; width: 100%; height: 190px; margin: -12px 0 18px; flex-shrink: 0; }
  .summon-altar-art { height: 190px; max-width: 270px; margin: auto; }
  .altar-caption { bottom: -5px; font-size: 8px; }
  .upgrade-heading { display: block; }
  .upgrade-heading h2 { font-size: 31px; margin-top: 8px; }
  .paused-note { display: none; }
  .upgrade-context { font-size: 11px; margin-top: 14px; }
  .evolution-path { position: static; max-width: none; margin-top: 11px; gap: 6px; font-size: 9px; }
  .upgrade-cards { grid-template-columns: 1fr; gap: 13px; margin: 21px 0 17px; }
  .upgrade-card { display: grid; grid-template-columns: 51px minmax(0, 1fr); column-gap: 12px; padding: 12px 10px; border-width: 10px; border-image-width: 10px; border-radius: 18px; min-height: 145px; }
  .upgrade-card .card-top { grid-column: 1; grid-row: 1 / 5; display: flex; flex-direction: column; align-items: center; gap: 8px; justify-content: start; margin: 0; }
  .upgrade-icon { width: 49px; height: 49px; }
  .upgrade-icon .glyph { width: 25px; height: 25px; }
  .rarity-word { font-size: 7px; letter-spacing: .01em; text-align: center; }
  .card-kind, .card-title, .card-description, .offer-level { grid-column: 2; }
  .card-kind { font-size: 8px; }
  .card-title { font-size: 21px; line-height: 1.13; margin-top: 5px; }
  .card-description { font-size: 13px; line-height: 1.5; margin-top: 8px; }
  .offer-level { margin-top: 10px; font-size: 9px; }
  .card-bottom { display: none; }
  .upgrade-footer { gap: 9px; align-items: start; }
  .upgrade-footer > span { font-size: 10px; max-width: 48%; }
  .upgrade-footer > .text-button { font-size: 11px; min-height: 44px; padding: 10px 11px; }
  .rift-reward { padding: 13px; border-radius: 17px; }
  .rift-reward p { font-size: 12px; }
  .small-dialog h2 { font-size: 32px; margin: 12px 0 17px; }
  .small-dialog p { font-size: 13px; }
  .pause-tools { gap: 4px 10px; }
  .pause-tools .pause-guide-button { min-height: 44px; font-size: 11px; padding: 10px 4px; }
  .result-dialog h2 { font-size: 35px; }
  .result-stats { gap: 7px; padding: 18px 0; margin: 20px 0 15px; }
  .result-stats strong { font-size: 29px; }
  .result-stats small { font-size: 8px; line-height: 1.5; }
  .result-discoveries { font-size: 11px; gap: 9px 13px; }
  .secured-loot { padding: 16px 12px; }
  .secured-loot > div { gap: 16px; font-size: 25px; }
  .secured-loot .glyph { width: 23px; height: 23px; }
  .career-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin: 20px 0 27px; }
  .career-stat { padding: 15px; border-radius: 17px; }
  .career-stat strong { font-size: 32px; margin-top: 10px; }
  .career-stat small { font-size: 8px; line-height: 1.6; }
  .milestone-heading { align-items: start; gap: 10px; }
  .milestone-heading h3 { font-size: 23px; }
  .milestone-heading span { font-size: 10px; max-width: 110px; text-align: right; line-height: 1.5; }
  .milestones { grid-template-columns: 1fr; gap: 13px; }
  .milestone { padding: 19px; border-radius: 18px; }
  .milestone h3 { font-size: 22px; }
  .milestone p { font-size: 13px; min-height: 0; }
  .settings-section h3 { font-size: 22px; }
  .settings-section p { font-size: 13px; }
  .settings-actions { flex-direction: column; }
  .settings-actions > .secondary-button, .import-label { min-height: 50px; font-size: 12px; }
  .guide-places { grid-template-columns: 1fr; gap: 11px; }
  .guide-place { min-height: 76px; padding: 14px; }
  .guide-place small { font-size: 12px; }
  .poi-guide-head { gap: 12px; padding-right: 20px; }
  .poi-guide-head h2 { font-size: 29px; }
  .poi-guide-emblem { width: 56px; height: 56px; }
  .poi-guide-head .eyebrow { font-size: 8px; }
  .map-toolbar { gap: 12px; margin-top: 15px; }
  .map-toolbar .segmented { width: 100%; display: flex; }
  .map-toolbar .segmented button { flex: 1; padding: 10px; font-size: 12px; min-height: 44px; }
  .map-toolbar > span { font-size: 11px; }
  .map-layout { grid-template-columns: 1fr; gap: 19px; margin-top: 20px; }
  .world-map { max-height: none; }
  .map-legend { grid-template-columns: 1fr; gap: 5px; }
  .map-legend button { min-height: 58px; padding: 9px; }
  .map-caption { text-align: left; font-size: 12px !important; }
  .summon-reveal { padding: 22px 18px; }
  .reveal-content { width: min(100%, 345px); }
  .reveal-content > .eyebrow { margin-bottom: 17px; font-size: 9px; }
  .reveal-card { width: 195px; height: 239px; margin-bottom: 20px; border-width: 14px; border-image-width: 14px; }
  .reveal-card .hero-portrait { width: 202px; height: 232px; }
  .reveal-content h2 { font-size: 37px; margin-bottom: 12px; }
  .reveal-content p { font-size: 13px; margin-bottom: 15px; }
  .reveal-content > .primary-button { min-height: 54px; width: 100%; min-width: 0; }
  .reveal-orbits { top: 40%; width: 345px; height: 345px; }
  .mystery { width: 165px; height: 208px; }
}

@media (max-height: 520px) and (orientation: landscape) {
  .hub-panel { inset: 65px 3.5% 73px; border-width: 12px; border-image-width: 12px; padding: 14px 16px 24px; border-radius: 20px; }
  .section-heading { margin-bottom: 17px; gap: 12px; }
  .section-heading h2 { font-size: 27px; }
  .section-heading .eyebrow { font-size: 8px; margin-bottom: 6px; }
  .count-badge { font-size: 12px; padding: 8px 12px; }
  .collection-tools { gap: 12px; margin-bottom: 17px; }
  .collection-tools > .muted { font-size: 10px; max-width: 225px; text-align: right; }
  .hub-panel .segmented button, .map-toolbar .segmented button { min-height: 44px; font-size: 11px; padding: 9px 13px; }
  .heroes-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px 12px; }
  .hero-card { border-width: 9px; border-image-width: 9px; }
  .card-art { height: 122px; }
  .card-art::before { height: 102px; width: 102px; top: 16px; }
  .hero-card .hero-portrait { height: 145px; width: 126px; margin-bottom: -8px; }
  .card-rarity { top: 4px; font-size: 7px; }
  .hero-level-badge { font-size: 7px; right: 3px; bottom: 8px; padding: 4px; }
  .card-owned-strip { display: none; }
  .card-info { padding: 10px 6px; min-height: 70px; }
  .card-info strong { font-size: 20px; }
  .card-info small { font-size: 10px; min-height: 25px; }
  .card-info > .glyph { height: 23px; width: 23px; }
  .selected-check { bottom: 74px; width: 20px; height: 20px; }
  .overlay { padding: 11px; }
  .modal-box, .upgrade-dialog, .small-dialog, .result-dialog { border-width: 12px; border-image-width: 12px; padding: 18px 19px; max-height: calc(100dvh - 22px); border-radius: 20px; overflow: auto; }
  .modal-box { width: min(100%, 850px); }
  .modal-box h2 { font-size: 31px; }
  .modal-close { top: 1px; right: 1px; min-height: 44px; min-width: 44px; }
  .hero-detail { grid-template-columns: minmax(160px, .7fr) minmax(0, 1.3fr); gap: 22px; }
  .detail-art { min-height: 230px; height: 250px; margin-top: 7px; border-width: 11px; border-image-width: 11px; }
  .detail-art .hero-portrait { height: 240px; width: 209px; }
  .detail-body h2 { font-size: 34px; }
  .detail-body .hero-title { font-size: 12px; }
  .rarity-tag { top: 6px; font-size: 8px; }
  .detail-role { font-size: 9px; bottom: 6px; padding: 6px 9px; }
  .weapon-description { padding: 12px 0; }
  .weapon-description p { font-size: 13px; }
  .detail-body .hero-combat-metrics { gap: 7px; }
  .detail-body .hero-combat-metrics > span { padding: 8px 5px; grid-template-columns: 1fr; text-align: center; border-radius: 14px; }
  .detail-body .hero-combat-metrics > span > .glyph { display: none; }
  .detail-body .hero-combat-metrics b { font-size: 21px; }
  .detail-body .hero-combat-metrics small { font-size: 8px; }
  .detail-body > .primary-button, .detail-body > .secondary-button { min-height: 48px; font-size: 12px; }
  .summon-panel { align-items: start; }
  .summon-copy { width: 57%; max-width: none; }
  .summon-copy h2 { font-size: 32px; }
  .summon-copy > p { font-size: 13px; }
  .summon-actions button { min-height: 48px; font-size: 12px; padding: 12px 14px; }
  .altar-scene { position: absolute; left: 59%; right: 2%; top: 22px; height: 220px; bottom: auto; }
  .summon-altar-art { max-height: 200px; }
  .altar-caption { font-size: 8px; bottom: 4px; }
  .guarantee-card { margin: 17px 0; padding: 14px 0; }
  .guarantee-card strong { font-size: 12px; }
  .guarantee-card small { font-size: 11px; }
  .rates summary { min-height: 44px; }
  .upgrade-dialog { width: min(100%, 950px); }
  .upgrade-heading h2 { font-size: 29px; }
  .upgrade-heading .eyebrow { font-size: 8px; }
  .upgrade-context { margin-top: 11px; font-size: 11px; }
  .evolution-path { position: static; max-width: none; margin: 9px 0 0; font-size: 9px; }
  .upgrade-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 19px 0 16px; }
  .upgrade-card { display: flex; padding: 12px 10px; min-height: 215px; border-width: 10px; border-image-width: 10px; border-radius: 18px; }
  .card-top { margin-bottom: 13px; gap: 6px; }
  .upgrade-icon { width: 43px; height: 43px; }
  .upgrade-icon .glyph { width: 23px; height: 23px; }
  .card-title { font-size: 20px; line-height: 1.15; }
  .card-kind { font-size: 8px; }
  .card-description { font-size: 13px; line-height: 1.5; }
  .rarity-word, .offer-level { font-size: 8px; }
  .upgrade-footer > span { font-size: 11px; }
  .upgrade-footer > .text-button { min-height: 44px; font-size: 11px; }
  .small-dialog { width: min(100%, 490px); }
  .small-dialog h2 { font-size: 31px; }
  .small-dialog p { font-size: 13px; }
  .small-dialog > .primary-button, .small-dialog > .secondary-button { min-height: 48px; margin-top: 13px; }
  .pause-tools .pause-guide-button { min-height: 44px; font-size: 11px; }
  .result-dialog { width: min(100%, 590px); }
  .result-dialog h2 { font-size: 35px; }
  .result-stats { padding: 17px 0; }
  .result-stats strong { font-size: 30px; }
  .result-discoveries { font-size: 11px; }
  .secured-loot { padding: 16px; }
  .career-stats { gap: 12px; margin: 18px 0 25px; }
  .career-stat { padding: 14px; border-radius: 17px; }
  .career-stat strong { font-size: 29px; margin-top: 10px; }
  .career-stat small { font-size: 8px; }
  .milestone-heading h3 { font-size: 22px; }
  .milestone-heading span { font-size: 11px; }
  .milestones { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
  .milestone { padding: 17px; }
  .milestone h3 { font-size: 21px; }
  .milestone p { font-size: 13px; }
  .guide-places { grid-template-columns: 1fr 1fr; }
  .guide-place { min-height: 78px; padding: 13px; }
  .guide-place small { font-size: 12px; }
  .map-layout { grid-template-columns: minmax(0, 1fr) 230px; gap: 22px; }
  .world-map { max-height: 72dvh; }
  .map-legend button { min-height: 56px; padding: 8px 5px; }
  .map-legend button strong { font-size: 12px; }
  .map-legend button small { font-size: 11px; }
  .summon-reveal { padding: 17px; }
  .reveal-content { width: auto; max-width: 100%; height: auto; min-height: 268px; display: grid; grid-template-columns: 175px minmax(220px, 290px); grid-template-rows: 20px 43px minmax(43px, 1fr) 26px 48px; gap: 9px 30px; align-items: center; text-align: left; }
  .reveal-card { grid-column: 1; grid-row: 1 / 6; width: 175px; height: 253px; margin: 0; border-width: 13px; border-image-width: 13px; align-self: center; }
  .reveal-card .hero-portrait { height: 235px; width: 205px; }
  .reveal-content #reveal-kicker { grid-column: 2; grid-row: 1; margin: 0; font-size: 8px; }
  .reveal-content #reveal-name { grid-column: 2; grid-row: 2; margin: 0; font-size: 34px; }
  .reveal-content #reveal-message { grid-column: 2; grid-row: 3; margin: 0; font-size: 13px; line-height: 1.5; min-height: 0; }
  .reveal-content #reveal-ability { grid-column: 2; grid-row: 4; margin: 0; justify-content: start; font-size: 12px; }
  .reveal-content #reveal-button { grid-column: 2; grid-row: 5; margin: 0; min-height: 48px; min-width: 0; width: 100%; font-size: 13px; }
  .reveal-orbits { top: 50%; width: 570px; height: 350px; }
  .mystery { width: 155px; height: 220px; }
}

@media (max-width: 600px) and (max-height: 700px) and (orientation: portrait) {
  .reveal-card { width: 167px; height: 205px; margin-bottom: 17px; }
  .reveal-card .hero-portrait { width: 178px; height: 205px; }
  .reveal-content h2 { font-size: 33px; }
  .reveal-content p { margin-bottom: 12px; }
  .reveal-ability { margin-bottom: 17px; }
  .summon-reveal { padding: 18px; }
  .altar-scene { height: 160px; }
  .summon-altar-art { height: 160px; }
}

@media (hover: none) {
  .hero-card:hover, .upgrade-card:hover { transform: none; }
  .hero-card:hover .hero-portrait { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .summon-altar-art, .summon-reveal.charging .reveal-card { animation: none; }
}
body[data-reduced-motion='true'] .summon-altar-art,
body[data-reduced-motion='true'] .summon-reveal.charging .reveal-card { animation: none; }

@media (max-width: 620px) {
  .stat-row { grid-template-columns: 24px minmax(0,1fr) 48px 72px; gap: 6px; }
  .stat-rank { display: none; }
  .stat-copy small { display: none; }
  .stat-training-head { display: block; }
  .stat-training-head span { display: block; margin-top: 4px; text-align: left; }
}
/* QA: match the generated button's painted area; keep all short-screen choices readable. */
.summon-actions .primary-button{background-size:100% 180%}
@media(min-width:600px) and (max-height:400px) and (orientation:landscape){
  .upgrade-dialog{padding:10px 14px;border-width:8px;border-image-width:12px;position:relative}
  .upgrade-heading h2{font-size:24px;line-height:1.05;margin-top:4px}.upgrade-heading .eyebrow{font-size:7px}
  .upgrade-context{font-size:9px;margin-top:5px}.upgrade-context .glyph{width:14px;height:14px}
  .evolution-path{position:absolute;right:16px;top:22px;max-width:45%;margin:0;font-size:8px;gap:5px}
  .evolution-path>span{padding:4px 5px}
  .upgrade-cards{gap:11px;margin:9px 0 8px}
  .upgrade-card{padding:8px;min-height:158px;border-width:8px;border-image-width:10px}
  .card-top{margin-bottom:5px;min-height:26px}.upgrade-icon{height:26px;width:26px}.upgrade-icon .glyph{height:17px;width:17px}
  .upgrade-card .card-kind{display:none}.card-title{font-size:17px;line-height:1.1;margin-top:3px}
  .card-description{font-size:11.5px;line-height:1.35;margin-top:6px}.offer-level{font-size:7px;margin-top:6px}.rarity-word{font-size:7px}
  .upgrade-footer>span{font-size:9px}.upgrade-footer>.text-button{font-size:10px;min-height:44px;padding:8px 12px}
}
