/* Relics keep their own metal and enamel colours; the surrounding hall follows the site. */
.today-card.today-medals { position: relative; padding: 0; overflow: hidden; }
.today-medals-link { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: .15rem; padding: .8rem; color: var(--ivory); background: linear-gradient(0deg,#080604 3%,#0806049c 54%,#08060410), url('assets/medals/hall.webp') center 46% / cover; border: 0; cursor: pointer; text-align: center; }
.today-medals-link::before { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 22%, color-mix(in srgb,var(--gold) 26%,transparent),transparent 68%); opacity: .7; transition: opacity .3s; }
.today-medals-link > * { position: relative; }
.today-medals-link img { position: absolute; top: -.1rem; width: clamp(5rem, 8.4vw, 8.5rem); height: clamp(5rem, 8.4vw, 8.5rem); object-fit: contain; mix-blend-mode: screen; filter: drop-shadow(0 0 12px #e7ac4038); transition: filter .3s; }
.today-medals-link strong { font-family: var(--serif); font-size: clamp(1.5rem,2.2vw,2.15rem); font-weight: 400; line-height: 1.15; }
.today-medals-link [data-medals-count] { font-size: .73rem; color: var(--gold-pale); letter-spacing: .04em; }
.today-medals-link:hover::before { opacity: 1; }
.today-medals-link:hover img { filter: drop-shadow(0 0 18px #e7ac4070); }
.today-medals-link:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: -6px; border-radius: .9rem; }
dialog.medals-hall, .has-player dialog.medals-hall.has-mobile-transport[open] { position: fixed; inset: 0; margin: 0; width: 100%; max-width: none; height: 100svh; max-height: none; padding: 0; border: 0; border-radius: 0; overflow: hidden; background: var(--site-surface-0,#0b0908); color: var(--ivory); }
.medals-hall::backdrop { background: #050403; }
.medals-hall[open] { animation: medals-enter .35s ease-out both; }
.medals-shell { position: relative; display: flex; flex-direction: column; height: 100%; isolation: isolate; }
.medals-shell::before { content: ''; position: absolute; inset: 0; z-index: -2; background: linear-gradient(0deg,#070605e8,#07060570 55%,#07060530), url('assets/medals/hall.webp') center top / cover; opacity: .85; }
.medals-shell::after { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background: linear-gradient(90deg,color-mix(in srgb,var(--site-surface-0,#0b0908) 85%,transparent),transparent 30%,transparent 70%,color-mix(in srgb,var(--site-surface-0,#0b0908) 85%,transparent)); }
.medals-header { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: max(.7rem,env(safe-area-inset-top)) max(1.5rem,env(safe-area-inset-right)) .7rem max(1.5rem,env(safe-area-inset-left)); border-bottom: 1px solid var(--line); background: #080705b3; }
.medals-wordmark { display: flex; align-items: center; gap: 1.2rem; color: var(--gold-pale); font: 600 1.3rem var(--serif); letter-spacing: .2em; text-decoration: none; }
.medals-wordmark span { font: 400 .65rem var(--sans); text-transform: uppercase; letter-spacing: .15em; color: var(--muted); }
.medals-exit { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; font-size: 1.65rem; color: var(--ivory); background: #080705a8; border: 1px solid var(--line); border-radius: .3rem; cursor: pointer; }
.medals-exit:hover { border-color: var(--gold); color: var(--gold-pale); }
.medals-scroll { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-color: var(--gold) #100d0a; padding: 0 max(1.5rem,calc((100vw - 1320px)/2)); scroll-padding-top: 5rem; }
.medals-intro { text-align: center; padding: 2.3rem 1rem 1.6rem; }
.medals-eyebrow { color: var(--gold-pale); font-size: .65rem; text-transform: uppercase; letter-spacing: .19em; }
.medals-intro h1 { margin: .7rem 0 .6rem; font: 400 clamp(2.7rem,4.2vw,4.6rem)/1.05 var(--serif); text-shadow: 0 2px 30px #000; }
.medals-intro h1 em { color: var(--gold-pale); font-weight: 400; }
.medals-lead { font-size: .92rem; color: #ded4c2; line-height: 1.7; }
.medals-overall { display: flex; flex-direction: column; align-items: center; gap: .65rem; margin-top: 1.1rem; }
.medals-overall strong { font-size: .8rem; color: var(--gold-pale); font-weight: 500; letter-spacing: .08em; }
.medals-hall progress { appearance: none; display: block; height: 3px; width: 100%; border: 0; border-radius: 10px; background: #ffffff14; color: var(--gold); overflow: hidden; }
.medals-hall progress::-webkit-progress-bar { background: #ffffff14; }
.medals-hall progress::-webkit-progress-value { background: var(--gold); }
.medals-hall progress::-moz-progress-bar { background: var(--gold); }
.medals-overall progress { width: min(21rem,100%); }
.medals-categories { position: sticky; top: 0; z-index: 2; display: flex; justify-content: center; flex-wrap: wrap; gap: .35rem; padding: .65rem; border: 1px solid var(--line); border-radius: .4rem; background: color-mix(in srgb,var(--site-surface-0,#0b0908) 95%,transparent); }
.medals-categories button { min-height: 40px; padding: .55rem 1rem; border: 0; background: transparent; color: var(--gold-pale); font-size: .72rem; cursor: pointer; }
.medals-categories button:hover { background: #ffffff09; }
.medals-category { padding: 1.8rem 0 1rem; }
.medals-category-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; padding-bottom: .8rem; }
.medals-category-heading h2 { margin: 0; font: 400 clamp(1.5rem,2.1vw,2rem) var(--serif); color: var(--ivory); }
.medals-category-heading p { margin: 0; font-size: .7rem; color: var(--muted); }
.medals-grid { display: grid; grid-template-columns: repeat(6,minmax(0,1fr)); gap: .75rem; }
#medals-people .medals-grid, #medals-path .medals-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
#medals-words .medals-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
.medal-item { position: relative; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: .5rem .8rem 1rem; border: 1px solid #ffffff17; border-radius: .5rem .5rem 2rem 2rem; color: var(--ivory); background: linear-gradient(180deg,#0b0905b3,#0b0905e0); text-align: center; cursor: pointer; transition: border-color .25s, background .25s; }
.medal-item:hover { border-color: var(--gold); background: #14100de8; }
.medal-item:focus-visible, .medals-hall button:focus-visible, .medal-detail button:focus-visible { outline: 2px solid var(--gold-pale); outline-offset: 3px; }
.medal-art-wrap { display: block; width: 100%; max-width: 12rem; aspect-ratio: 1; position: relative; }
.medal-art { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; }
.medal-item .medal-art { filter: saturate(.2) brightness(.65); opacity: .78; transition: filter .3s, opacity .3s; }
.medal-item:hover .medal-art { filter: saturate(.55) brightness(.85); opacity: 1; }
.medal-item.is-earned { border-color: color-mix(in srgb,var(--gold) 65%,transparent); background: radial-gradient(ellipse at 50% 18%,#c895301f,transparent 65%),#0b0905df; box-shadow: inset 0 0 24px #e3aa3010,0 0 16px #e5b6450c; }
.medal-item.is-earned .medal-art { filter: drop-shadow(0 0 11px #e1ae3750); opacity: 1; }
.medal-state { font-size: .58rem; text-transform: uppercase; letter-spacing: .14em; color: #b7ad9e; }
.is-earned .medal-state { color: var(--gold-pale); }
.medal-name { font: 400 clamp(1.05rem,1.4vw,1.35rem)/1.15 var(--serif); min-height: 2.3em; }
.medal-progress { margin-top: auto; color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.medal-item progress { width: 64%; margin-top: .25rem; }
.medals-footnote { max-width: 54rem; margin: 2rem auto 3rem; padding: 1rem 0; border-top: 1px solid var(--line); color: #bcb5a9; font-size: .73rem; line-height: 1.7; text-align: center; }
.medals-hall.has-mobile-transport .medals-shell { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
#medals-hall > .modal-player-controls, #medal-detail > .modal-player-controls { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; height: calc(60px + env(safe-area-inset-bottom)); align-items: flex-start; justify-content: center; gap: .7rem; padding: .45rem .75rem max(.45rem,env(safe-area-inset-bottom)); background: var(--site-surface-0,#0c0a07); border-top: 1px solid var(--line); }
#medals-hall > .modal-player-controls button, #medal-detail > .modal-player-controls button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); background: #ffffff05; color: var(--gold-pale); border-radius: .25rem; cursor: pointer; }
#medals-hall > .modal-player-controls button:disabled, #medal-detail > .modal-player-controls button:disabled { opacity: .35; cursor: default; }
dialog.medal-detail { position: fixed; margin: auto; width: min(62rem,calc(100vw - 2rem)); max-width: none; max-height: calc(100svh - 3rem); padding: 0; border: 1px solid var(--gold); border-radius: .6rem; color: var(--ivory); background: var(--site-surface-0,#100d09); box-shadow: 0 30px 100px #000c; overflow: auto; overscroll-behavior: contain; }
.medal-detail::backdrop { background: #030201c9; backdrop-filter: blur(5px); }
.medal-detail > .medals-exit { position: sticky; top: .65rem; margin: .65rem .65rem -3.4rem auto; z-index: 2; }
.medal-detail-content { display: grid; grid-template-columns: minmax(0,.8fr) minmax(0,1.2fr); gap: 2rem; padding: 3rem 2.2rem 2.2rem; }
.medal-detail-art { position: sticky; top: 2rem; align-self: start; aspect-ratio: 1; background: radial-gradient(ellipse,#a77e2222,transparent 68%); }
.medal-detail-art img { max-width: 100%; filter: saturate(.65); }
.medal-detail.is-earned .medal-detail-art img { filter: drop-shadow(0 0 24px #d4a34455); }
.medal-detail-copy h2 { margin: .6rem 0 1.1rem; font: 400 clamp(2rem,3.3vw,3.1rem)/1.07 var(--serif); }
.medal-lore { color: var(--gold-pale); font: italic 400 1.2rem/1.6 var(--serif); }
.medal-detail-copy h3 { margin: 1.7rem 0 .6rem; font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ivory); }
.medal-condition, .medal-evidence { color: var(--muted); font-size: .83rem; line-height: 1.7; }
.medal-detail-progress { border-top: 1px solid var(--line); padding-top: 1rem; color: var(--gold-pale); font-size: .78rem; }
.medal-earned-date { color: var(--muted); font-size: .68rem; }
.medal-evidence { color: var(--gold-pale); }
.medal-checklist { list-style: none; margin: 1rem 0 0; padding: 0; }
.medal-checklist li { display: flex; align-items: baseline; justify-content: space-between; gap: .8rem; padding: .5rem 0; border-bottom: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.medal-checklist small { flex-shrink: 0; font-size: .65rem; }
.medal-checklist li.is-complete { color: var(--gold-pale); }
.has-player dialog.medal-detail.has-mobile-transport[open] { top: 1rem; bottom: auto; margin: 0 auto; height: auto; max-height: calc(100svh - 5.5rem - env(safe-area-inset-bottom)); }
.medal-toast { position: fixed; z-index: 300; bottom: max(1rem,env(safe-area-inset-bottom)); left: 1rem; width: min(24rem,calc(100vw - 2rem)); display: flex; align-items: center; padding: .4rem; border: 1px solid var(--gold); border-radius: .6rem; background: var(--site-surface-0,#100d09); color: var(--ivory); box-shadow: 0 8px 40px #0009,0 0 24px color-mix(in srgb,var(--gold) 13%,transparent); animation: medal-notice .35s ease-out both; }
.medal-toast-open { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; border: 0; background: transparent; text-align: left; color: inherit; cursor: pointer; padding: 0; }
.medal-toast-open img { flex: 0 0 72px; width: 72px; height: 72px; object-fit: contain; mix-blend-mode: screen; filter: drop-shadow(0 0 8px #d8aa4359); }
.medal-toast-open > span { display: flex; flex-direction: column; gap: .2rem; }
.medal-toast-open small { color: var(--gold-pale); text-transform: uppercase; font-size: .58rem; letter-spacing: .1em; }
.medal-toast-open strong { font: 400 1.18rem/1.1 var(--serif); }
.medal-toast-open span span { font-size: .62rem; color: var(--muted); }
.medal-toast-dismiss { flex: 0 0 36px; height: 44px; border: 0; background: transparent; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
dialog .medal-toast, .has-player .medal-toast { bottom: max(5rem,env(safe-area-inset-bottom)); }
@keyframes medals-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes medal-notice { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (max-width: 1050px) { .medals-grid { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 650px) {
  .today-medals-link img { top: -.1rem; width: 5.2rem; height: 5.2rem; }
  .today-medals-link { padding: .65rem .3rem; }
  .today-medals-link strong { font-size: clamp(1.1rem, 5.5vw, 1.45rem); }
  .today-medals-link [data-medals-count] { font-size: .6rem; }
  .medals-header { padding-left: .8rem; padding-right: .8rem; }
  .medals-wordmark { gap: .7rem; font-size: 1.05rem; }
  .medals-wordmark span { font-size: .55rem; letter-spacing: .06em; }
  .medals-scroll { padding: 0 .8rem; scroll-padding-top: 7rem; }
  .medals-intro { padding: 2rem .2rem 1.4rem; }
  .medals-intro h1 { font-size: clamp(2.5rem,11vw,3.4rem); }
  .medals-eyebrow { font-size: .57rem; letter-spacing: .1em; }
  .medals-lead { font-size: .8rem; }
  .medals-categories { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem; padding: .25rem; }
  .medals-categories button { padding: .4rem .2rem; font-size: .63rem; }
  .medals-category-heading { display: block; }
  .medals-category-heading p { margin-top: .25rem; font-size: .65rem; }
  .medals-grid, #medals-words .medals-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
  .medal-item { padding: .4rem .6rem .8rem; gap: .35rem; }
  .medal-name { font-size: 1.1rem; }
  .medal-detail-content { grid-template-columns: 1fr; gap: .3rem; padding: 1.8rem 1.1rem 1.3rem; }
  .medal-detail-art { position: static; width: min(14rem,70%); margin: auto; }
  .medal-detail-copy h2 { font-size: 2rem; }
  .medal-lore { font-size: 1.1rem; }
  .medal-toast { left: .65rem; width: calc(100vw - 1.3rem); }
}
html[data-motion="reduced"] .medals-hall, html[data-motion="reduced"] .medal-toast { animation: none; }
html[data-motion="reduced"] .medal-art, html[data-motion="reduced"] .medal-item, html[data-motion="reduced"] .today-medals-link::before, html[data-motion="reduced"] .today-medals-link img { transition: none; }
@media (prefers-reduced-motion: reduce) { .medals-hall, .medal-toast { animation: none; } .medal-art, .medal-item, .today-medals-link::before, .today-medals-link img { transition: none; } }

/* A theme unlock shares the medal queue; it never interrupts the visitor. */
.medal-toast[data-notice-theme] { width: min(19rem,calc(100vw - 1.5rem)); padding: .35rem .5rem; }
.bonus-toast-copy { display: flex; align-items: center; gap: .65rem; flex: 1; min-width: 0; }
.medal-toast [hidden] { display: none !important; }
.bonus-toast-copy > span:last-child { display: grid; gap: .1rem; }
.bonus-toast-copy small { color: var(--gold-light); font: 600 .59rem/1.5 var(--sans); text-transform: uppercase; letter-spacing: .08em; }
.bonus-toast-copy strong { color: var(--ivory); font: 400 1.13rem/1.2 var(--serif); }
.bonus-toast-copy span span { color: var(--muted); font: 400 .65rem/1.4 var(--sans); }
.bonus-toast-seal { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid #5F6975; background: #171B20 url('assets/constellation.svg') center / 29px auto no-repeat; }
.medal-toast[data-notice-theme="vestnik"] .bonus-toast-seal { display: grid; place-items: center; background: #F7F5EF; color: #8B2529; border-color: #D5CFC4; }
.medal-toast[data-notice-theme="vestnik"] .bonus-toast-seal::before { content: 'В'; font: 500 1.5rem/1 var(--serif); border-block: 1px solid #8B2529; }
