.challenge-modal { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 24px; background: rgba(5, 3, 10, .68); pointer-events: auto; -webkit-font-smoothing: antialiased; }
.challenge-frame { position: relative; width: min(680px, 94vw); max-height: min(720px, 92vh); overflow: auto; padding: 28px; border: 1px solid rgba(225, 181, 255, .48); border-radius: 18px; color: #eee4dc; background: radial-gradient(circle at 50% -15%, rgba(126, 70, 160, .34), transparent 45%), linear-gradient(160deg, #201627, #0e0a13 75%); box-shadow: 0 0 0 1px rgba(0,0,0,.85), 0 28px 80px rgba(0,0,0,.66), inset 0 0 32px rgba(174,101,214,.12); }
.challenge-frame header { padding: 0 38px 20px 0; text-wrap: pretty; }.challenge-frame header p { margin: 0 0 5px; color: #d8a8ff; font: 700 12px/1 Cinzel, Georgia, serif; letter-spacing: .13em; text-transform: uppercase; }.challenge-frame h2 { margin: 0; color: #ffe3a4; font: 700 clamp(26px, 4vw, 38px)/1.08 Cinzel, Georgia, serif; text-wrap: balance; }.challenge-frame header span, .challenge-frame footer { display: block; margin-top: 10px; color: #bdb0c5; font-size: 16px; line-height: 1.35; }.challenge-frame footer { border-top: 1px solid rgba(232, 206, 156, .16); padding-top: 14px; font-size: 14px; }
.challenge-close { position: absolute; right: 16px; top: 14px; display: grid; place-items: center; box-sizing: border-box; width: 40px; height: 40px; min-height: 0; margin: 0; padding: 0 0 2px; border: 1px solid rgba(225,181,255,.38); border-radius: 50%; background: rgba(24, 14, 34, .55); color: #f3e3ff; font: 400 26px/1 Georgia, serif; transition-property: color, border-color, transform; transition-duration: .16s; }.challenge-close:active, .challenge-tier:active { transform: scale(.96); }
.challenge-tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 4px 0 18px; }.challenge-tier { min-height: 106px; margin: 0; padding: 13px 14px; border-radius: 11px; border-color: rgba(196, 151, 230, .32); text-align: left; background: linear-gradient(145deg, rgba(91,52,112,.55), rgba(21,15,30,.85)); transition-property: transform, border-color, box-shadow; transition-duration: .16s; }.challenge-tier:hover:not(:disabled) { border-color: #e4bcff; box-shadow: 0 6px 20px rgba(123,72,170,.24); }.challenge-tier b, .challenge-tier span, .challenge-tier i, .challenge-tier small { display: block; }.challenge-tier b { color: #ffe1a1; font: 700 16px Cinzel, Georgia, serif; }.challenge-tier span { margin-top: 5px; color: #e5c9f6; }.challenge-tier i { float: right; margin-top: -18px; color: #9b8ba6; font-size: 13px; }.challenge-tier small { clear: both; margin-top: 10px; color: #a99ab0; }.challenge-tier.locked { opacity: .42; cursor: default; }
.bounty-list { display: grid; gap: 8px; margin: 4px 0 18px; }.bounty-row { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; min-height: 66px; padding: 10px 13px; border-radius: 10px; background: rgba(18, 28, 20, .6); box-shadow: inset 0 0 0 1px rgba(124, 224, 138, .21); }.bounty-row b, .bounty-row span { display: block; }.bounty-row b { color: #e7f5e9; font: 700 15px Cinzel, Georgia, serif; }.bounty-row span { margin-top: 4px; color: #9fb1a1; font-size: 13px; }.bounty-row strong { color: #c8f4ce; font-variant-numeric: tabular-nums; }.bounty-row i { min-width: 68px; color: #7ce08a; font-size: 13px; text-align: right; }.bounty-row.done { opacity: .62; }.challenge-empty { color: #bcb1bd; }
.challenge-portal-notice { position: fixed; z-index: 81; top: 13%; left: 50%; display: grid; gap: 3px; min-width: 260px; padding: 10px 16px; transform: translateX(-50%); border-radius: 10px; background: rgba(28, 14, 42, .92); box-shadow: 0 8px 28px rgba(0,0,0,.46), inset 0 0 0 1px rgba(219, 171, 255, .45); color: #e6c4ff; text-align: center; pointer-events: none; }.challenge-portal-notice b { color: #ffe2a0; font-family: Cinzel, Georgia, serif; }.challenge-portal-notice span { font-size: 14px; }
.trial-hud { position: fixed; z-index: 25; top: 14px; left: 50%; display: flex; align-items: center; gap: 10px; width: min(440px, calc(100vw - 32px)); padding: 7px 10px; transform: translateX(-50%); border-radius: 13px; background: rgba(15, 8, 28, .86); box-shadow: 0 4px 18px rgba(0,0,0,.42), inset 0 0 0 1px rgba(193, 136, 243, .45); color: #f4ecfc; pointer-events: none; -webkit-font-smoothing: antialiased; }.trial-emblem { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f5dd8e, #a564c8 55%, #281134); box-shadow: 0 0 12px rgba(205, 133, 255, .65); color: #241023; font: 700 20px Cinzel, Georgia, serif; }.trial-readout { min-width: 0; flex: 1; display: grid; grid-template-columns: 1fr auto; column-gap: 8px; }.trial-readout b { color: #f5ddad; font: 700 13px Cinzel, Georgia, serif; }.trial-readout strong { color: #fff; font-variant-numeric: tabular-nums; }.trial-mods { grid-column: 1 / -1; overflow: hidden; color: #ccb4da; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }.trial-gauge { grid-column: 1 / -1; height: 5px; margin-top: 5px; overflow: hidden; border-radius: 4px; background: #24142f; }.trial-gauge i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #a95ee2, #f2d77a); transition-property: width; transition-duration: .18s; }.trial-readout small { grid-column: 1 / -1; margin-top: 3px; color: #bfb4c9; font-size: 11px; }.trial-hud.urgent strong { color: #ff8585; animation: trial-pulse 1s step-end infinite; }@keyframes trial-pulse { 50% { opacity: .42; } }
.trial-event { grid-column: 1 / -1; display: flex; justify-content: space-between; gap: 8px; margin-top: 5px; padding-top: 5px; border-top: 1px solid rgba(218, 167, 255, .18); color: #f0bf8e; font-size: 11px; }.trial-event b { color: #f3cfab; font: 700 11px Cinzel, Georgia, serif; }.trial-event span { color: #cbbdce; font-variant-numeric: tabular-nums; text-align: right; }
.challenge-event-hud { position: fixed; z-index: 24; top: 82px; left: 14px; display: grid; gap: 5px; width: min(290px, calc(100vw - 28px)); padding: 8px 10px; border-radius: 12px; background: rgba(18, 12, 20, .82); box-shadow: 0 4px 18px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255, 180, 108, .3); color: #eee1d4; pointer-events: none; -webkit-font-smoothing: antialiased; }.challenge-event-hud div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }.challenge-event-hud b { color: #ffd09a; font: 700 12px Cinzel, Georgia, serif; }.challenge-event-hud span { color: #d6c6d1; font-variant-numeric: tabular-nums; text-align: right; }
@media (max-width: 560px) { .challenge-frame { padding: 23px 16px; border-radius: 14px; }.challenge-tier-grid { grid-template-columns: 1fr; }.challenge-tier i { float: none; margin-top: 3px; }.bounty-row { grid-template-columns: 1fr auto; }.bounty-row i { grid-column: 1 / -1; text-align: left; }.trial-hud { top: 8px; } }

.challenge-modal button, .challenge-frame h2, .challenge-frame header p, .trial-hud b, .challenge-event-hud b { text-transform: none; }
.trial-emblem { height: 48px; border-radius: 0; background: url('assets/gen/ui/trial_emblem.webp') center / contain no-repeat; box-shadow: none; color: #fff0bf; }
.trial-gauge-pop { position: fixed; z-index: 27; top: 82px; left: 50%; color: #f5ddad; font: 700 15px Cinzel, Georgia, serif; pointer-events: none; animation: trial-gauge-pop .85s ease-out forwards; }
@keyframes trial-gauge-pop { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -22px); } }
.trial-swift-medal { padding-left: 52px; background-image: url('assets/gen/ui/trial_emblem.webp'); background-position: 10px center; background-size: 34px; background-repeat: no-repeat; }
@media (prefers-reduced-motion: reduce) { .trial-gauge-pop { animation-name: trial-gauge-fade; } .trial-hud.urgent strong { animation: none; } }
@keyframes trial-gauge-fade { to { opacity: 0; } }

/* Recompose the painted atlas into one frame with a fixed header and bottom rail. */
.trial-panel, .trial-panel * { box-sizing: border-box; }
.trial-panel { padding: 16px; background: rgba(8, 5, 3, .78); font-variant-numeric: tabular-nums; }
.trial-panel [hidden] { display: none !important; }
.trial-panel .challenge-frame {
  container-type: inline-size; width: min(1080px, calc(100vw - 32px)); height: min(850px, calc(100dvh - 32px));
  max-height: none; padding: 0; overflow: visible; border: 30px solid transparent; border-radius: 0;
  border-image: url('assets/gen/ui/veil_trials_board_clear.webp') 78 67 70 67 / 36px / 5px stretch;
  background: #21170e; box-shadow: 0 24px 80px #0009; outline: none;
}
.trial-board { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 0; }
.trial-panel .trial-heading {
  position: relative; flex: 0 0 auto; min-height: 172px; padding: 22px 42% 20px 38px; margin: 0;
  background: linear-gradient(90deg, #110c07e8 5%, #110c07aa 47%, transparent 75%), url('assets/gen/ui/veil_trials_board_clear.webp') 65% 8.5% / auto 450% no-repeat;
}
.trial-panel .trial-heading p { margin: 0 0 7px; color: #e3c485; font: 400 13px/1.2 Georgia, serif; letter-spacing: .12em; text-transform: none; }
.trial-panel .trial-heading h2 { margin: 0 0 10px; color: #ffe2a0; font: 700 clamp(32px, 4.5cqw, 48px)/1.04 Georgia, serif; letter-spacing: -.035em; text-wrap: balance; }
.trial-panel .trial-heading span { margin: 0; color: #f1e1c5; font: 400 clamp(13px, 1.5cqw, 16px)/1.35 Georgia, serif; text-wrap: pretty; }
.trial-panel .trial-heading .trial-best { margin-top: 10px; color: #e5c080; font-size: 13px; }
.trial-panel .challenge-close { z-index: 3; top: 10px; right: 10px; }
.trial-sections { display: flex; align-items: stretch; flex: 0 0 auto; padding: 0 20px; gap: 24px; background: #170e08; box-shadow: inset 0 1px #bd924055, 0 1px #bd924055; }
.trial-panel .trial-sections button {
  position: relative; min-height: 48px; margin: 0; padding: 10px 6px !important; border: 0 !important; border-image: none !important; border-radius: 0;
  color: #bca27d; background: none !important; font: 400 17px/1.2 Georgia, serif;
  transition-property: color, box-shadow; transition-duration: .16s;
}
.trial-panel .trial-sections button[aria-pressed="true"] { color: #ffe1a1; box-shadow: inset 0 -3px #d8a44c; }
.trial-panel .trial-sections button:hover { color: #fff1ce; }
.trial-writ-count { display: inline-block; margin-left: 10px; color: #ccb48e; font-size: 12px; }
.trial-panel .trial-tier-panel, .trial-pinnacles { flex: 1 1 0; min-height: 0; overflow: auto; padding: 16px 12px; scrollbar-width: thin; scrollbar-color: #9e7632 #1c1109; }
.trial-panel .challenge-tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: auto; align-content: start; gap: 10px 14px; height: auto; margin: 0; }
.trial-panel .challenge-tier {
  position: relative; aspect-ratio: 583 / 179; min-width: 0; min-height: 0; margin: 0; padding: 0; border: 0 !important; border-image: none !important;
  border-radius: 0; background-image: url('assets/gen/ui/veil_trials_board_clear.webp') !important;
  background-size: 229.33% auto !important; background-repeat: no-repeat !important; color: #281306;
  text-align: left; font-family: Georgia, serif; box-shadow: none; isolation: isolate;
  transition-property: box-shadow, transform; transition-duration: .16s;
}
.trial-panel [data-slot="0"] { background-position: 9.55% 38.32% !important; }
.trial-panel [data-slot="1"] { background-position: 90.98% 38.32% !important; }
.trial-panel [data-slot="2"] { background-position: 9.55% 57.27% !important; }
.trial-panel [data-slot="3"] { background-position: 90.98% 57.27% !important; }
.trial-panel [data-slot="4"] { background-position: 9.55% 76.23% !important; }
.trial-panel [data-slot="5"] { background-position: 90.98% 76.23% !important; }
.trial-panel [data-slot="6"] { background-position: 9.55% 95.18% !important; }
.trial-panel [data-slot="7"] { background-position: 90.98% 95.18% !important; }
.trial-panel .challenge-tier::before { content: ''; position: absolute; z-index: -1; inset: 7% 2%; background: linear-gradient(90deg, transparent 14%, #f9deaccf 20%, #f9deacb8 58%, transparent 89%); pointer-events: none; }
.trial-panel .challenge-tier:hover:not(:disabled) { box-shadow: inset 0 0 0 2px #ffdc7d, 0 0 18px #ffc74f66; }
.trial-panel button:focus-visible, .trial-page-status:focus-visible { outline: 2px solid #fff0b5; outline-offset: 3px; }
.trial-panel button:active:not(:disabled) { transform: scale(.96); }
.trial-panel .challenge-tier.locked { opacity: 1; cursor: default; }
.trial-panel .trial-tier-number { position: absolute; left: 1.8%; top: 11%; display: grid; place-items: center; width: 13.1%; height: 49%; margin: 0; color: #ffe4a3; font: 400 clamp(23px, 2.8cqw, 30px)/1 Georgia, serif; }
.trial-panel .trial-tier-copy { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-content: center; gap: 2px 10px; margin: 0; padding: 8px 12px 8px 19.7%; height: 100%; color: #281306; }
.trial-panel .trial-tier-copy span { margin: 0; color: inherit; }
.trial-panel .trial-tier-copy b { grid-column: 1 / -1; display: block; margin: 0; color: #281306; font: 700 clamp(17px, 2cqw, 21px)/1.1 Georgia, serif; }
.trial-panel .trial-tier-copy i { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 6px; float: none; margin: 0; color: #281306; font: 400 clamp(12px, 1.4cqw, 15px)/1.15 Georgia, serif; }
.trial-panel .trial-tier-copy i.uncleared { font-style: italic; }
.trial-panel .trial-tier-copy small { grid-column: 1 / -1; display: flex; align-items: center; gap: 6px; margin: 0; clear: none; color: #281306; font: 400 clamp(11px, 1.25cqw, 14px)/1.15 Georgia, serif; text-wrap: pretty; }
.trial-panel .trial-tier-copy .trial-monster-level { grid-column: 2; grid-row: 2; align-self: center; color: #412816; font-size: 11px; }
.trial-panel .trial-detail-icon { flex: 0 0 16px; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trial-panel .trial-reward img { flex: 0 0 19px; width: 19px; height: 19px; object-fit: contain; }
.trial-empty-slot { visibility: hidden; }
.trial-panel .challenge-frame .trial-board-footer { flex: 0 0 auto; margin: 0; padding: 12px 20px 8px; border: 0; box-shadow: inset 0 1px #b28a4d66; background: #170e08; color: #d6c4a6; font: 400 13px/1.35 Georgia, serif; }
.trial-pages { display: grid; grid-template-columns: 110px 1fr 110px; align-items: center; gap: 16px; margin: 0; }
.trial-panel .trial-pages button { margin: 0; min-height: 40px; padding: 8px 14px; border: 1px solid #a87932 !important; border-image: none !important; border-radius: 2px; color: #ffe3a5; background: linear-gradient(#4c321a, #27190d) !important; font: 400 15px/1.3 Georgia, serif; transition-property: transform, box-shadow; transition-duration: .16s; }
.trial-panel .trial-pages button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px #e7b351; }
.trial-pages button:disabled { opacity: .4; cursor: default; }
.trial-page-status { color: #f4d89e; font: 400 17px/1.2 Georgia, serif; text-align: center; }
.trial-pages small { display: block; margin-top: 3px; color: #c3aa87; font-size: 12px; }
.trial-tip { margin: 10px auto 0; max-width: 90ch; color: #ccb795; text-align: center; font-size: 12px; line-height: 1.35; text-wrap: pretty; }
.trial-pinnacles h3 { margin: 8px 12px 10px; color: #ffe1a1; font: 700 28px/1.2 Georgia, serif; }
.trial-pinnacles > p { max-width: 75ch; margin: 0 12px 24px; color: #d6c4a6; font: 400 16px/1.45 Georgia, serif; text-wrap: pretty; }
.trial-pinnacle-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; padding: 0 12px 12px; }
.trial-panel .trial-pinnacle-list button {
  display: flex; flex-direction: column; align-items: center; width: 100%; min-width: 0; margin: 0; padding: 16px !important;
  border: 14px solid transparent !important; border-image: url('assets/gen/ui/card_frame.webp') 48 / 14px / 0 stretch !important;
  border-radius: 0; color: #ffe3a5; background: radial-gradient(ellipse at 50% 20%, #503620, #1a1009 80%) !important;
  text-align: left; font: 400 15px/1.35 Georgia, serif; transition-property: transform, filter; transition-duration: .16s;
}
.trial-panel .trial-pinnacle-list button:hover:not(:disabled) { filter: brightness(1.18); }
.trial-panel .trial-pinnacle-list button:disabled { opacity: 1; cursor: default; }
.trial-altar-art { width: 100%; height: clamp(90px, 13cqw, 140px); object-fit: contain; margin-bottom: 14px; }
.trial-altar-copy { display: flex; flex-direction: column; gap: 12px; flex: 1; width: 100%; }
.trial-altar-copy b { color: #ffe1a1; font: 700 20px/1.15 Georgia, serif; text-wrap: balance; }
.trial-altar-copy > span { color: #d6c4a6; font-size: 15px; text-wrap: pretty; }
.trial-altar-copy small { margin-top: auto; padding-top: 14px; color: #e0bd78; font-size: 13px; box-shadow: 0 -1px #b28a4d40; }
.trial-altar-footer { margin: 8px 0; text-align: center; color: #f4d89e; }
@media (max-height: 760px) and (min-width: 761px) {
  .trial-panel .trial-heading { min-height: 126px; padding-top: 14px; padding-bottom: 14px; }
  .trial-panel .trial-heading h2 { font-size: 34px; margin-bottom: 6px; }
  .trial-panel .trial-heading .trial-best { margin-top: 6px; }
}
@media (max-width: 760px) {
  .trial-panel { padding: 8px; }
  .trial-panel .challenge-frame { width: calc(100vw - 16px); height: calc(100dvh - 16px); border-width: 18px; border-image-width: 24px; }
  .trial-panel .trial-heading { min-height: 154px; padding: 20px 58px 18px 18px; background-size: auto, auto 450%; background-position: center, 65% 8.5%; }
  .trial-panel .trial-heading h2 { font-size: 34px; }
  .trial-panel .trial-heading span { font-size: 14px; }
  .trial-sections { padding: 0 12px; gap: 16px; }
  .trial-panel .trial-sections button { font-size: 16px; }
  .trial-writ-count { margin-left: 6px; font-size: 11px; }
  .trial-panel .trial-tier-panel, .trial-pinnacles { padding: 12px 6px; }
  .trial-panel .challenge-tier-grid { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-rows: auto; height: auto; gap: 10px; }
  .trial-panel .challenge-tier { min-height: 0; }
  .trial-panel .trial-tier-copy { gap: 2px 6px; padding: 6px 10px 6px 20%; }
  .trial-panel .trial-tier-copy b { font-size: clamp(16px, 5.3cqw, 19px); }
  .trial-panel .trial-tier-copy i { font-size: clamp(12px, 4cqw, 14px); }
  .trial-panel .trial-tier-copy small { font-size: clamp(10px, 3.3cqw, 12px); }
  .trial-panel .trial-tier-copy .trial-monster-level { font-size: clamp(10px, 3.3cqw, 12px); }
  .trial-panel .trial-tier-number { font-size: clamp(22px, 6.8cqw, 26px); }
  .trial-empty-slot { display: none; }
  .trial-panel .challenge-frame .trial-board-footer { padding: 10px 8px; }
  .trial-pages { grid-template-columns: 84px 1fr 84px; gap: 8px; }
  .trial-panel .trial-pages button { padding: 8px; font-size: 14px; }
  .trial-page-status { font-size: 15px; }
  .trial-tip { font-size: 11px; }
  .trial-pinnacles h3 { font-size: 25px; }
  .trial-pinnacles > p { margin-bottom: 18px; font-size: 15px; }
  .trial-pinnacle-list { grid-template-columns: 1fr; gap: 12px; }
  .trial-panel .trial-pinnacle-list button { flex-direction: row; gap: 16px; padding: 8px !important; }
  .trial-altar-art { width: 28%; height: 100px; margin-bottom: 0; }
  .trial-altar-copy b { font-size: 18px; }
  .trial-altar-copy > span { font-size: 14px; }
}

@media (max-height: 520px) and (min-width: 761px) {
  .trial-panel .challenge-frame { border-width: 18px; border-image-width: 24px; }
  .trial-panel .trial-heading { min-height: 96px; padding: 12px 42% 10px 20px; }
  .trial-panel .trial-heading p { margin-bottom: 4px; font-size: 11px; }
  .trial-panel .trial-heading h2 { font-size: 28px; margin-bottom: 5px; }
  .trial-panel .trial-heading span { font-size: 11px; }
  .trial-panel .trial-heading .trial-best { margin-top: 4px; font-size: 11px; }
  .trial-panel .trial-sections button { min-height: 40px; padding-top: 8px !important; padding-bottom: 8px !important; }
  .trial-panel .trial-tier-panel, .trial-pinnacles { padding-top: 8px; padding-bottom: 8px; }
  .trial-panel .challenge-frame .trial-board-footer { padding-top: 6px; padding-bottom: 6px; }
  .trial-tip { margin-top: 5px; font-size: 10px; }
}
