/* v45.38: readable headers, shared graphics settings and reward reveals. */
.realm-masthead { margin: 0 0 18px; width: 100%; overflow: hidden; border: 1px solid #a58445; border-radius: 12px; background: #111a29; }
.realm-masthead > img { display: block; width: 100%; height: clamp(124px, 18vw, 340px); object-fit: cover; object-position: center; }
.realm-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 20px; padding: 14px 20px; background: #111a29; }
.view .realm-heading h2 { margin: 0; font-size: 28px; color: #ffe3a4; line-height: 1.15; }
.view .realm-heading p { margin: 0; color: #e5dfd1; font-size: 15px; line-height: 1.5; }
.account-graphics { padding: 16px; border: 1px solid #a58445; border-radius: 10px; background: #1c283a; color: #f9efd8; margin: 18px 0; }
.account-graphics h3 { margin: 0 0 8px; font-size: 20px; color: #ffe3a4; }
.account-graphics p { margin: 0 0 12px; font-size: 15px; line-height: 1.5; }
.graphics-toggle { display: flex; gap: 8px; }
.graphics-toggle .btn { min-width: 100px; color: #fff3dd; background: #293951; border-color: #8392a8; }
.graphics-toggle .btn[aria-pressed="true"] { background: #e5c488; color: #281b0c; border-color: #f9e4ad; }
.graphics-effects-off *, .graphics-effects-off *::before, .graphics-effects-off *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.logi-tab-pair { display: flex; align-items: stretch; min-width: 0; gap: 1px; }
.logi-tabs[aria-label="Kingdom Management"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.logi-tab-pair > [role="tab"] { flex: 1; }
.logi-tabs .logi-tab-info { flex: 0 0 23px; font: bold 14px Georgia, serif; letter-spacing: 0; border-radius: 5px 5px 0 0; background: #fff0cb; color: #4d330e; }
.logi-tab-info img { display: block; width: 17px; height: 21px; }
.logi-tabs .logi-tab-info:hover, .logi-tabs .logi-tab-info[aria-expanded="true"] { background: #fff9e8; color: #19140c; }
.logi-tab-help { flex: 0 0 auto; display: flex; align-items: flex-start; gap: 8px; padding: 9px; border: 1px solid #ab853e; background: #fff4d3; color: #35210c; }
.logi-tab-help p { margin: 0; font: 13px/1.45 var(--f-body); }
.logi-tab-help button { flex: none; color: #35210c; background: transparent; border: 0; font-size: 19px; cursor: pointer; }
.farm-compact .lr-top { grid-template-columns: minmax(0, 1fr) auto auto; align-items: start; gap: 6px; }
.farm-compact .lr-top > b { min-width: 0; overflow-wrap: anywhere; line-height: 1.4; }
.logi-switch { width: 40px; min-width: 40px; max-width: 40px; justify-self: end; padding: 1px 4px; }
.royal-vault .store-tabs button[data-tab="gems"] img { object-fit: cover; }
.royal-vault .hero-book-art { height: 130px; width: 100%; border-radius: 7px; background: linear-gradient(#07132422, #07132444), url("art/shop/hero_books.webp") center/cover; }
.royal-vault .hero-book-art .item-art { filter: drop-shadow(0 3px 5px #000b); }
.royal-vault .coin-pack-art { height: 130px; object-fit: cover; }
.royal-vault .store-card, .royal-vault .gem-card, .reward-card { position: relative; isolation: isolate; }
.royal-vault .store-card::before, .royal-vault .gem-card::before, .reward-card::before {
  content: ""; position: absolute; pointer-events: none; inset: -2px; z-index: 1; border-radius: inherit; padding: 2px;
  background: linear-gradient(115deg, #80642e 35%, #edb84b 44%, #fff2c0 49%, #fff2c0 51%, #edb84b 56%, #80642e 65%);
  background-size: 250% 100%; background-position: 80% 50%;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude;
}
.royal-vault .store-card::after, .royal-vault .gem-card::after, .reward-card::after { content: ""; position: absolute; pointer-events: none; inset: -3px; z-index: -1; border-radius: inherit; box-shadow: 0 0 13px 2px #eac77275; opacity: 0; }
.royal-vault.is-playing .store-card::before, .royal-vault.is-playing .gem-card::before, .reward-reveal.is-playing .reward-card::before { animation: event-gold-sweep 2.5s linear infinite; }
.royal-vault.is-playing .store-card::after, .royal-vault.is-playing .gem-card::after, .reward-reveal.is-playing .reward-card::after { animation: event-aura-glimmer 2.8s ease-in-out infinite; }
.event-effects-hidden .royal-vault *, .event-effects-hidden .royal-vault *::before, .event-effects-hidden .royal-vault *::after,
.event-effects-hidden .reward-reveal *, .event-effects-hidden .reward-reveal *::before, .event-effects-hidden .reward-reveal *::after { animation-play-state: paused !important; }
.sheet-wrap.reward-wrap { place-items: center; padding: 18px; }
.sheet.reward-dialog { width: min(760px, calc(100vw - 36px)); max-height: calc(100dvh - 36px); border-radius: 14px; margin: 0; background: #162033; color: #f9efd8; box-shadow: 0 16px 70px #000b, 0 0 28px #edb84b33; }
.reward-dialog .sh { background: #162033; border-color: #9a793e; color: #ffdfa0; }
.reward-dialog .sh p, .reward-dialog .dim { color: #dbe2ed; }
.reward-dialog .sheet-close { color: #ffedc5; }
.reward-reveal { padding: 22px; }
.reward-reveal > p { margin: 0 0 22px; font-size: 16px; line-height: 1.5; color: #f4e8ce; }
.reward-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(180px, 100%), 1fr)); gap: 18px; padding: 0; margin: 0 0 20px; list-style: none; }
.reward-card { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 20px 14px; border: 1px solid #b78c3f; border-radius: 10px; background: #24334b; }
.reward-card > b { color: #ffdfa0; font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
.reward-card > small { font-size: 14px; line-height: 1.5; color: #f0ede5; }
.reward-card .reward-art, .reward-card .wheel-reward-art, .reward-card .item-art { width: 100px; height: 100px; object-fit: contain; }
.reward-card .ic, .reward-card .medal { width: 70px; height: 70px; }
.reward-amount { font-size: 25px; color: #fff3cf; line-height: 1.1; font-weight: 800; }
.reward-reveal .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.reward-reveal .btn { font-size: 15px; padding: 10px 16px; }
.reward-reveal .wheel-batch-balance { color: #dae2ef; font-size: 14px; }
.event-progress-summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 16px; margin-bottom: 16px; border: 1px solid #71849b; border-radius: 9px; background: #25364b; color: #f5eedf; }
.event-progress-summary > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.event-progress-summary > div > span { font-size: 13px; line-height: 1.4; color: #e0e7f0; }
.event-progress-summary > div > b { font-size: 22px; font-variant-numeric: tabular-nums; color: #ffe7b4; }
.event-progress-summary > p { grid-column: 1/-1; margin: 0; font-size: 15px; line-height: 1.5; }
.event-progress-summary .event-scoring-guide { padding-top: 10px; border-top: 1px solid #61768f; }
.event-scoring-guide > b { display: block; margin-bottom: 4px; color: #ffe7b4; }
.event-progress-summary .event-score-note { color: #d8e1ed; font-size: 13px; }
.event-hub .ev-miles li { grid-template-columns: minmax(200px, 1fr) minmax(180px, 1.1fr) auto; gap: 18px; padding: 18px; align-items: start; }
.event-milestone-title { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.event-milestone-title > span { font-size: 13px; color: #dbe4ee; }
.event-milestone-title > b { font-size: 17px; color: #ffe7b4; }
.event-progress-reading { display: flex; flex-direction: column; gap: 6px; }
.event-progress-reading > strong { font-size: 21px; line-height: 1.3; color: #fff2d4; font-variant-numeric: tabular-nums; }
.event-progress-reading > span { font-size: 15px; color: #dae3ee; }
.event-milestone-goal .event-meter { height: 12px; margin: 12px 0; }
.event-milestone-goal .event-points-needed { margin: 0; font-size: 15px; line-height: 1.4; font-weight: 700; color: #ffe1a0; }
.event-milestone-reward { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; min-width: 0; }
.event-reward-heading { font-size: 13px; color: #dce5ef; text-transform: uppercase; letter-spacing: .06em; }
.event-hub .event-milestone-reward .reward, .event-hub .event-milestone-reward .ev-item { font-size: 15px; line-height: 1.6; }
.event-milestone-status .event-in-progress, .event-milestone-status .event-claimed { display: inline-block; border-radius: 6px; padding: 7px 9px; background: #2d4158; font-size: 14px; color: #e2ecfa; }
.event-milestone-status .event-claimed { background: #304b36; color: #e4f7d8; }
@container (max-width: 760px) {
  .event-hub .ev-miles li { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .event-milestone-reward { padding-top: 12px; border-top: 1px solid #61768f; }
  .event-progress-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .royal-vault:not(.motion-opt-in) .store-card::before, .royal-vault:not(.motion-opt-in) .store-card::after,
  .royal-vault:not(.motion-opt-in) .gem-card::before, .royal-vault:not(.motion-opt-in) .gem-card::after,
  .reward-reveal:not(.motion-opt-in) .reward-card::before, .reward-reveal:not(.motion-opt-in) .reward-card::after { animation: none !important; }
}
@media (max-width: 650px) {
  .event-hub .ev-miles li { grid-template-columns: minmax(0, 1fr); }
  .event-progress-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .realm-heading { padding: 12px 14px; }
  .view .realm-heading h2 { font-size: 25px; }
  .realm-masthead > img { height: clamp(110px, 25vw, 145px); }
  .sheet-wrap.reward-wrap { padding: 14px; }
  .sheet.reward-dialog { width: calc(100vw - 28px); max-height: calc(100dvh - 28px); border-radius: 14px; }
  .reward-reveal { padding: 18px; }
}

/* Earned rewards: steady readable contents, shared store border effects. */
.royal-fragment-art { width: 100px; height: 100px; object-fit: contain; }
.royal-exchange-head { padding: 18px; margin-bottom: 18px; border: 1px solid #b79350; border-radius: 10px; background: #1c2b41; }
.royal-exchange-head > div:first-child { display: flex; gap: 16px; align-items: center; }
.royal-exchange-head > div:first-child > .royal-fragment-art { width: 80px; height: 80px; }
.royal-exchange-head h3 { margin: 5px 0; color: #ffe4a8; font-size: 26px; }
.royal-exchange-head p { font-size: 15px; line-height: 1.5; margin: 10px 0; color: #e5eaf2; }
.royal-exchange-head span { font-size: 13px; color: #f3d59e; }
.royal-earn-progress { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 10px; border-top: 1px solid #566379; }
.exchange-categories { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.royal-vault .exchange-card { display: flex; flex-direction: column; gap: 8px; }
.exchange-reward-art { display: grid; place-items: center; min-height: 110px; background: #142035; border-radius: 8px; }
.exchange-reward-art img, .exchange-reward-art svg { width: 100px; height: 100px; object-fit: contain; }
.royal-vault .exchange-card p { font-size: 15px; line-height: 1.5; margin: 0; }
.exchange-price { margin-top: auto; display: flex; gap: 8px; align-items: center; font-size: 19px; color: #ffe3a3; }
.exchange-price .royal-fragment-art, .royal-fragment-balance .royal-fragment-art { width: 32px; height: 32px; }
.royal-vault .exchange-card .exchange-blocker { color: #f7c2b9; }
.royal-vault .exchange-card .exchange-guarantee { color: #d4e4bd; }
.daily-medal-hunt { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,260px); gap: 22px; padding: 20px; margin-bottom: 18px; border: 1px solid #bf9853; border-radius: 10px; background: #223249; color: #f4ead8; }
.daily-medal-hunt.is-ready { border-color: #f5d484; box-shadow: 0 0 0 1px #f5d484; }
.view .daily-medal-hunt h3 { color: #ffe4ac; font-size: 24px; margin: 7px 0; }
.view .daily-medal-hunt p { color: #e2eaf4; font-size: 15px; line-height: 1.5; margin: 10px 0; }
.daily-hunt-count { display: block; font-size: 24px; color: #ffe4a8; margin: 10px 0; }
.daily-medal-hunt .event-meter { height: 12px; }
.daily-hunt-actions { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.daily-hunt-actions label { font-size: 16px; font-weight: 700; }
.daily-hunt-actions select { min-height: 42px; font-size: 16px; background: #f1e6d1; color: #182435; }
.daily-hunt-actions select option { background: #f1e6d1; color: #182435; }
.royal-fragment-balance { display: inline-flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 700; }
.royal-fragment-card .inventory-actions .btn { width: 100%; }
@container (max-width: 600px) { .daily-medal-hunt { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 650px) { .daily-medal-hunt { grid-template-columns: minmax(0,1fr); padding: 16px; } .royal-exchange-head > div:first-child > .royal-fragment-art { width: 60px; height: 60px; } .royal-exchange-head h3 { font-size: 23px; } }
