/* Container opening (lr-) and in-panel enchanting (ep-). Loaded after game.css. */

/* MARK: Container opening */

.lr-root { position: fixed; z-index: 1000; inset: 0; --lr-darkness: 0; }
.lr-veil { position: fixed; inset: 0; background: color-mix(in srgb, var(--lr-deep, #061519) 52%, transparent); opacity: 0; backdrop-filter: blur(0) saturate(1); transition: opacity .5s ease, backdrop-filter .5s ease; }
.lr-root.is-dimming .lr-veil { opacity: .45; }
.lr-root.is-dimmed .lr-veil { opacity: 1; backdrop-filter: blur(7px) saturate(.65); }
.lr-veil-deep { position: fixed; inset: 0; pointer-events: none; background: var(--lr-deep, #061519); opacity: calc(var(--lr-darkness) * .42); }
.lr-scene { position: fixed; inset: 0; pointer-events: none; will-change: transform; }
.lr-canvas { position: absolute; top: 0; left: 0; pointer-events: none; }
.lr-item { position: absolute; top: 0; left: 0; will-change: transform; transform-origin: 50% 50%; }
.lr-item img { display: block; width: 100%; height: 100%; object-fit: contain; }

.lr-card { position: absolute; display: flex; flex-direction: column; overflow: hidden; visibility: hidden; border: 1px solid color-mix(in srgb, var(--lr-highlight) 22%, transparent); border-radius: 28px; background: linear-gradient(180deg, var(--lr-bg) 0%, var(--lr-deep) 78%); color: #fff; box-shadow: 0 30px 90px rgba(0, 0, 0, .35); clip-path: circle(var(--lr-wipe, 0px) at var(--lr-wipe-x, 50%) var(--lr-wipe-y, 50%)); outline: none; pointer-events: auto; }
.lr-card.is-open { visibility: visible; }
.lr-card.is-revealed { clip-path: none; }
.lr-sky { position: absolute; inset: 0; pointer-events: none; background:
  radial-gradient(circle at 50% 76px, color-mix(in srgb, var(--lr-primary) 42%, transparent) 0, transparent 190px),
  radial-gradient(1.4px 1.4px at 14% 22%, #fff9 50%, transparent 51%), radial-gradient(1.2px 1.2px at 82% 14%, #fff8 50%, transparent 51%),
  radial-gradient(1.6px 1.6px at 70% 38%, #fff7 50%, transparent 51%), radial-gradient(1.2px 1.2px at 26% 46%, #fff6 50%, transparent 51%),
  radial-gradient(1.3px 1.3px at 90% 58%, #fff5 50%, transparent 51%), radial-gradient(1.1px 1.1px at 8% 64%, #fff5 50%, transparent 51%); }
.lr-head { position: relative; padding: var(--lr-head-pad, 140px) 24px 10px; text-align: center; opacity: 0; transform: translateY(10px); transition: opacity .4s ease .12s, transform .5s cubic-bezier(.2,.9,.3,1.2) .12s; }
.lr-card.is-showing .lr-head, .lr-card.is-showing .lr-actions { opacity: 1; transform: none; }
.lr-eyebrow { color: var(--lr-highlight); font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }
.lr-title { margin: 4px 0 2px; color: #fff; font: 700 30px/1.1 var(--serif, Georgia, serif); }
.lr-sub { margin: 0; color: color-mix(in srgb, #fff 62%, transparent); font-size: 13px; }
.lr-list { position: relative; display: grid; flex: 1; align-content: start; gap: 6px; min-height: 0; margin: 0; padding: 8px 16px; overflow-y: auto; list-style: none; scrollbar-width: none; transition: filter .3s ease;
  /* No scrollbar: the list fades out at its edges instead, so it still reads as scrollable. */
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 12px, #000 calc(100% - 18px), transparent 100%); }
.lr-list::-webkit-scrollbar { display: none; }
.lr-card.is-hushed .lr-list { filter: brightness(.45) saturate(.6); }
.lr-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 58px; padding: 6px 14px 6px 8px; border: 1px solid transparent; border-radius: 16px; background: rgba(255, 255, 255, .07); opacity: 0; transform: translateY(8px) scale(.97); }
.lr-row.is-in { animation: lr-row-in .42s cubic-bezier(.2, .9, .3, 1.35) forwards; }
.lr-row-art { display: grid; place-items: center; width: 46px; height: 46px; }
.lr-row-art img { width: 44px; height: 44px; object-fit: contain; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .3)); }
.lr-row.is-in .lr-row-art { animation: lr-icon-pop .45s cubic-bezier(.2, .9, .3, 1.5); }
.lr-row strong { overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.lr-row b { color: var(--lr-highlight); font-size: 15px; font-variant-numeric: tabular-nums; }
.lr-row.tier-notable.is-in { border-color: color-mix(in srgb, var(--lr-highlight) 30%, transparent); }
.lr-row.tier-rare.is-in { border-color: color-mix(in srgb, var(--lr-accent) 65%, transparent); background: color-mix(in srgb, var(--lr-accent) 14%, rgba(255,255,255,.06)); }
.lr-row.tier-exceptional.is-in { border-color: #ffe39a; background: linear-gradient(100deg, rgba(255, 214, 120, .24), rgba(255, 255, 255, .07) 70%); box-shadow: 0 0 0 1px rgba(255, 227, 154, .2), 0 6px 24px rgba(255, 200, 90, .18); }
.lr-row.tier-exceptional b { color: #ffe39a; }
.lr-row.is-gold b { color: #ffd66e; }
.lr-empty { padding: 20px; color: color-mix(in srgb, #fff 65%, transparent); text-align: center; }
.lr-fallback { color: var(--lr-highlight); font-size: 26px; }
.lr-actions { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 16px 16px; opacity: 0; transform: translateY(8px); transition: opacity .35s ease .2s, transform .4s ease .2s; }
.lr-done { flex: 1; min-height: 50px; border: 0; border-radius: 999px; background: var(--lr-highlight); color: var(--lr-deep); font-size: 16px; font-weight: 800; box-shadow: 0 8px 24px color-mix(in srgb, var(--lr-primary) 45%, transparent); transition: transform .15s ease, opacity .2s ease; }
.lr-done:not(:disabled):hover { transform: translateY(-1px); }
.lr-done:disabled { opacity: .35; box-shadow: none; }
.lr-skip { min-height: 50px; padding: 0 14px; border: 0; background: none; color: color-mix(in srgb, #fff 72%, transparent); font-weight: 600; }
.lr-skip[hidden] { display: none; }
.lr-card.is-leaving { opacity: 0; transform: scale(.97); transition: opacity .3s ease, transform .35s ease; }
.lr-status { position: absolute; right: 0; left: 0; margin: 0; color: #fff; font: italic 500 15px var(--serif, Georgia, serif); text-align: center; text-shadow: 0 2px 10px rgba(0, 0, 0, .4); opacity: 0; transition: opacity .3s ease; }
.lr-status.is-visible { opacity: .9; }
.lr-feature { position: absolute; display: grid; justify-items: center; gap: 4px; min-width: 240px; text-align: center; opacity: 0; transform: translate(-50%, -50%) scale(.3); pointer-events: auto; }
.lr-feature[hidden] { display: none; }
.lr-feature.is-in { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: opacity .2s ease, transform .5s cubic-bezier(.2, .9, .3, 1.5); }
.lr-feature-art { width: 150px; height: 150px; transition: transform .38s cubic-bezier(.5, 0, .3, 1); }
.lr-feature-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 22px rgba(255, 236, 170, .75)) drop-shadow(0 10px 12px rgba(0, 0, 0, .3)); }
.lr-feature strong { color: #fff; font: 700 30px/1.1 var(--serif, Georgia, serif); text-shadow: 0 3px 16px rgba(0, 0, 0, .45); }
.lr-feature b { color: #ffe39a; font-size: 18px; }
.lr-feature.is-leaving strong, .lr-feature.is-leaving b { opacity: 0; transition: opacity .15s ease; }
.lr-feature.is-leaving .lr-feature-art { transform: translate(var(--lr-fly-x), var(--lr-fly-y)) scale(var(--lr-fly-scale)); }
.lr-flyer { position: fixed; z-index: 1001; object-fit: contain; pointer-events: none; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .25)); }
.item-tile.lr-landed, #gold-count.lr-landed { animation: lr-land .6s cubic-bezier(.2, .9, .3, 1.5); }

@keyframes lr-row-in { to { opacity: 1; transform: none; } }
@keyframes lr-icon-pop { 0% { transform: scale(0); } 55% { transform: scale(1.18); } 80% { transform: scale(.95); } 100% { transform: scale(1); } }
@keyframes lr-land { 0% { transform: scale(1); } 35% { transform: scale(1.14); box-shadow: 0 0 0 3px rgba(84, 190, 150, .45); } 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(84, 190, 150, 0); } }

@media (prefers-reduced-motion: reduce) {
  .lr-veil { transition: opacity .2s ease; }
  .lr-root.is-dimmed .lr-veil { backdrop-filter: blur(4px); }
  .lr-card { clip-path: none; }
  .lr-row.is-in, .lr-row.is-in .lr-row-art { animation: lr-row-in .15s ease forwards; }
  .lr-head, .lr-actions { transition-duration: .15s; transition-delay: 0s; transform: none; }
}

/* MARK: In-panel enchanting */

.inventory-panel:has(.item-dialog.is-takeover[open]) { min-height: min(760px, calc(100dvh - 44px)); }
.inventory-panel .item-dialog.is-takeover[open] { inset: 0; display: flex; flex-direction: column; width: 100%; height: 100%; max-height: none; padding: 0; overflow: hidden; border: 0; border-radius: inherit; box-shadow: none; transform: none; animation: ep-takeover .28s ease both; }
.item-dialog.is-takeover > .dialog-close { display: none; }
.inventory-panel .item-dialog.is-takeover[open]:focus, .inventory-panel .item-dialog.is-takeover[open]:focus-visible { outline: none; }
.item-dialog.is-takeover > #item-dialog-content { display: flex; flex: 1; flex-direction: column; min-height: 0; }
@keyframes ep-takeover { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.ep { --ep-ink: #203028; --ep-muted: #66776c; --ep-card: #fff; --ep-soft: #f1f5f1; --ep-line: #e1e9e2; --ep-accent: #1488c2; --ep-danger: #c2413e; --ep-safe: #2f8a58;
  position: relative; display: flex; flex: 1; flex-direction: column; min-height: 0; color: var(--ep-ink); }
html[data-theme="dark"] .ep { --ep-ink: #eef0f5; --ep-muted: #aab2bf; --ep-card: #2a2e37; --ep-soft: #323744; --ep-line: #3c424e; --ep-accent: #5bbef0; --ep-danger: #f08b85; --ep-safe: #7fd4a0; }
.ep-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 4px; }
.ep-back, .ep-link { padding: 6px 4px; border: 0; background: none; color: var(--ep-accent); font-size: 14px; font-weight: 600; }
.ep-back span { font-size: 18px; line-height: 0; }
.ep-scroll { flex: 1; min-height: 0; padding: 0 14px 100px; overflow-y: auto; scrollbar-width: thin; }
.ep-hero { display: grid; justify-items: center; gap: 6px; padding-bottom: 6px; text-align: center; }
.ep-stage { display: grid; place-items: center; width: 100%; height: 150px; border-radius: 20px; background: radial-gradient(circle at 50% 62%, #effffc 5%, #b9e6e5 32%, #dbe7e2 70%, #edf1ed); }
html[data-theme="dark"] .ep-stage { background: radial-gradient(circle at 50% 62%, #3d6b6b 5%, #25444a 38%, #20262f 78%); }
.ep-art { width: 108px; height: 108px; transition: opacity .15s ease; }
.ep-art img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 9px 8px rgba(33, 74, 87, .28)); }
.ep-art.is-lifted { opacity: 0; }
.ep-name { margin: 6px 0 0; font: 700 25px/1.15 var(--serif, Georgia, serif); }
.ep-levels { display: flex; align-items: center; gap: 12px; font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ep-levels i { color: var(--ep-muted); font-size: 18px; font-style: normal; }
.ep-levels strong { color: var(--ep-accent); }
.ep-levels em { color: #c89a2c; font-size: 16px; font-style: normal; }
.ep-pips { display: flex; gap: 6px; padding-top: 12px; }
.ep-pip { position: relative; width: 28px; height: 6px; border-radius: 99px; background: color-mix(in srgb, var(--ep-muted) 22%, transparent); }
.ep-pip.is-done { background: var(--ep-accent); }
.ep-pip.is-next { background: color-mix(in srgb, var(--ep-accent) 38%, transparent); }
.ep-lock { position: absolute; top: -15px; left: 50%; width: 9px; height: 11px; color: var(--ep-muted); transform: translateX(-50%); }
.ep-section { padding-top: 18px; }
.ep-section h3, .ep-attempt h3 { margin: 0; font-size: 18px; }
.ep-note { margin: 4px 0 12px; color: var(--ep-muted); font-size: 13px; line-height: 1.45; }
.ep-paths { display: grid; gap: 9px; }
.ep-legacy { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.ep-legacy-entry { padding-top: 16px; color: var(--ep-muted); font-weight: 800; }
.ep-path { --ep-path: #3a8f86; overflow: hidden; border: 2px solid transparent; border-radius: 18px; background: var(--ep-card); box-shadow: 0 1px 0 var(--ep-line); transition: border-color .2s ease, background .2s ease; }
.ep-path.is-chosen { border-color: var(--ep-path); background: color-mix(in srgb, var(--ep-path) 7%, var(--ep-card)); }
.ep-path-head { display: grid; grid-template-columns: 48px minmax(0, 1fr) 24px; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; background: none; color: inherit; text-align: left; }
.ep-path-head:disabled { opacity: 1; cursor: default; }
.ep-path-art { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: color-mix(in srgb, var(--ep-path) 15%, transparent); }
.ep-path.is-chosen .ep-path-art { background: color-mix(in srgb, var(--ep-path) 26%, transparent); }
.ep-path-art img { width: 30px; height: 30px; object-fit: contain; }
.ep-path-copy { display: grid; gap: 2px; min-width: 0; }
.ep-path-copy strong { font-size: 16px; }
.ep-path-copy small { color: var(--ep-muted); font-size: 13px; }
.ep-radio { position: relative; width: 22px; height: 22px; border: 2px solid color-mix(in srgb, var(--ep-muted) 45%, transparent); border-radius: 50%; }
.ep-path.is-chosen .ep-radio { border-color: var(--ep-path); background: var(--ep-path); }
.ep-path.is-chosen .ep-radio::after { position: absolute; top: 3px; left: 6px; width: 5px; height: 9px; content: ""; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.ep-path-body { display: grid; gap: 14px; padding: 0 14px 14px; border-top: 1px solid var(--ep-line); animation: ep-open .25s ease; }
.ep-path-body > p { margin: 12px 0 0; font-size: 13px; line-height: 1.45; }
.ep-path-body > :first-child:not(p) { margin-top: 12px; }
@keyframes ep-open { from { opacity: 0; transform: translateY(-4px); } }
.ep-growth { display: grid; grid-template-columns: 92px minmax(0, 1fr); align-items: center; gap: 16px; }
.ep-bars > div { display: flex; align-items: flex-end; gap: 5px; height: 46px; }
.ep-bars i { width: 14px; border-radius: 3px; background: color-mix(in srgb, var(--ep-path) 22%, transparent); }
.ep-bars i:first-child { background: color-mix(in srgb, var(--ep-path) 62%, transparent); }
.ep-bars i.is-done { background: var(--ep-path); }
.ep-bars > span { display: flex; justify-content: space-between; margin-top: 4px; color: var(--ep-muted); font-size: 10px; font-weight: 600; }
.ep-stats { display: grid; gap: 7px; }
.ep-stat small { display: block; color: var(--ep-muted); font-size: 11px; }
.ep-stat strong { font-size: 15px; font-variant-numeric: tabular-nums; }
.ep-stat strong i { color: var(--ep-muted); font-size: 12px; font-style: normal; }
.ep-stat.is-negative strong { color: var(--ep-muted); }
.ep-cost-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ep-cost-head span { color: var(--ep-muted); font-size: 10px; font-weight: 800; letter-spacing: .1em; }
.ep-cost-head small { color: var(--ep-muted); font-size: 11px; }
.ep-material { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.ep-material img { width: 34px; height: 34px; object-fit: contain; }
.ep-material span { display: grid; gap: 1px; min-width: 0; }
.ep-material strong { font-size: 13px; font-weight: 600; }
.ep-material small { color: var(--ep-muted); font-size: 11px; }
.ep-material b { color: var(--ep-danger); font-size: 14px; font-variant-numeric: tabular-nums; }
.ep-material.is-met b { color: var(--ep-safe); }
.ep-path-body .ep-link { justify-self: start; padding: 0; }

.ep-card { margin-top: 16px; padding: 16px; border-radius: 20px; background: var(--ep-card); box-shadow: 0 1px 0 var(--ep-line); }
.ep-attempt { display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 14px 14px; align-items: center; }
.ep-chance { position: relative; display: grid; place-content: center; width: 78px; height: 78px; text-align: center; }
.ep-chance svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.ep-chance circle { fill: none; stroke-width: 7; }
.ep-chance circle:first-child { stroke: color-mix(in srgb, var(--ep-tone) 16%, transparent); }
.ep-chance circle:last-child { stroke: var(--ep-tone); stroke-dasharray: calc(var(--ep-chance) * 1) 100; stroke-linecap: round; }
.ep-chance.is-high { --ep-tone: #2aa58a; } .ep-chance.is-mid { --ep-tone: #e3a132; } .ep-chance.is-low { --ep-tone: #e06a44; }
.ep-chance strong { font-size: 19px; font-weight: 800; line-height: 1; }
.ep-chance small { color: var(--ep-muted); font-size: 10px; }
.ep-attempt-copy ul { display: grid; gap: 5px; margin: 7px 0 0; padding: 0; list-style: none; }
.ep-stake { display: flex; align-items: baseline; gap: 7px; font-size: 13px; }
.ep-stake-icon { flex: none; width: 14px; color: var(--ep-muted); font-weight: 800; text-align: center; }
.ep-stake.is-danger { color: var(--ep-danger); } .ep-stake.is-danger .ep-stake-icon { color: var(--ep-danger); }
.ep-stake.is-safe .ep-stake-icon { color: var(--ep-safe); }
.ep-stake.is-path .ep-stake-icon { color: #b88a2c; }
.ep-costs { display: grid; grid-column: 1 / -1; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 14px; border-top: 1px solid var(--ep-line); }
.ep-cost { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 9px 10px; border-radius: 13px; background: var(--ep-soft); }
.ep-cost img { flex: none; width: 30px; height: 30px; object-fit: contain; }
.ep-cost span { display: grid; min-width: 0; }
.ep-cost strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.ep-cost small { color: var(--ep-muted); font-size: 11px; }
.ep-cost.is-short strong, .ep-cost.is-short small { color: var(--ep-danger); }
.ep-masterwork strong { font-size: 18px; } .ep-masterwork p { margin: 4px 0 0; color: var(--ep-muted); }
.ep-row-link { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; margin-top: 12px; padding: 12px 14px; border: 0; border-radius: 18px; background: var(--ep-card); box-shadow: 0 1px 0 var(--ep-line); color: inherit; text-align: left; }
.ep-row-link span { display: grid; min-width: 0; }
.ep-row-link strong { font-size: 14px; } .ep-row-link small { overflow: hidden; color: var(--ep-muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ep-row-link i { color: var(--ep-muted); font-size: 20px; font-style: normal; }
.ep-row-icons { display: flex !important; }
.ep-row-icons img { width: 30px; height: 30px; margin-right: -8px; object-fit: contain; }
.ep-row-icons > span { color: var(--ep-accent); font-size: 20px; }

/* The Enchant button floats over the panel; the content scrolls underneath it. */
.ep-bar { position: absolute; right: 0; bottom: 0; left: 0; padding: 10px 14px 14px; pointer-events: none; }
.ep-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 52px; padding: 0 20px; border: 0; border-radius: 999px; background: linear-gradient(180deg, #25c1ef, #0a7ccb); color: #fff; font-size: 16px; font-weight: 800; box-shadow: 0 10px 26px rgba(10, 110, 180, .32), inset 0 1px 0 rgba(255, 255, 255, .35); pointer-events: auto; transition: transform .15s ease, box-shadow .2s ease; }
.ep-go:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(10, 110, 180, .38), inset 0 1px 0 rgba(255, 255, 255, .35); }
.ep-go:not(:disabled):active { transform: scale(.985); }
.ep-go:disabled { justify-content: center; border: 1px solid color-mix(in srgb, var(--ep-muted) 25%, transparent); background: color-mix(in srgb, var(--ep-card) 78%, transparent); color: var(--ep-muted); font-size: 14px; font-weight: 700; box-shadow: 0 8px 22px rgba(20, 40, 30, .12); backdrop-filter: blur(14px) saturate(1.4); opacity: 1; }
.ep-go > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ep-go-cost { display: flex; flex: none; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; }
.ep-go-cost img { width: 20px; height: 20px; object-fit: contain; }

/* The ritual plays over the whole panel. */
.ep-ritual { position: absolute; z-index: 5; inset: 0; overflow: hidden; border-radius: inherit; background: radial-gradient(circle at 50% 36%, #1b4a50 0, #0c2a31 42%, #061519 80%); color: #fff; opacity: 0; transition: opacity .35s ease; }
.ep-ritual.is-live { opacity: 1; }
.ep-ritual.is-leaving { opacity: 0; transition-duration: .25s; }
.ep-ritual canvas { position: absolute; top: 0; left: 0; pointer-events: none; }
.ep-ritual-item { position: absolute; top: 0; left: 0; will-change: transform; }
.ep-ritual-item img, .ep-shards img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ep-shards img { position: absolute; will-change: transform; }
.ep-ritual-scroll { position: absolute; top: 0; left: 0; width: 44px; height: 44px; object-fit: contain; opacity: 0; pointer-events: none; }
.ep-ritual-scroll.is-flying { opacity: 1; }
.ep-numerals { position: absolute; right: 0; left: 0; height: 56px; text-align: center; pointer-events: none; }
.ep-numeral { position: absolute; right: 0; left: 0; color: #dffbf6; font-size: 44px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.ep-numeral.is-current { opacity: .7; }
.ep-numeral.is-success { color: #ffd36e; animation: ep-numeral-pop .5s cubic-bezier(.2, .9, .3, 1.6) both; text-shadow: 0 0 24px rgba(255, 211, 110, .55); }
.ep-numeral.is-held { color: #ffb08a; animation: ep-numeral-shake .45s ease both; }
.ep-numeral.is-falling { animation: ep-numeral-fall .6s cubic-bezier(.5, 0, .8, .4) both; }
.ep-numeral.is-fallen { color: #ffb08a; animation: ep-numeral-rise .45s ease .25s both; }
@keyframes ep-numeral-pop { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }
@keyframes ep-numeral-shake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@keyframes ep-numeral-fall { to { opacity: 0; transform: translateY(46px) rotate(-12deg); } }
@keyframes ep-numeral-rise { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.ep-ritual-status { position: absolute; right: 0; left: 0; margin: 0; color: #cdeee8; font: italic 500 14px var(--serif, Georgia, serif); text-align: center; opacity: 0; transition: opacity .3s ease; }
.ep-ritual-status.is-visible { opacity: .9; }
.ep-result { position: absolute; right: 12px; bottom: 12px; left: 12px; padding: 18px 16px 14px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 22px; background: rgba(8, 26, 30, .82); box-shadow: 0 20px 40px rgba(0, 0, 0, .35); opacity: 0; transform: translateY(24px); backdrop-filter: blur(12px); transition: opacity .3s ease, transform .45s cubic-bezier(.2, .9, .3, 1.15); }
.ep-result[hidden] { display: none; }
.ep-result.is-in { opacity: 1; transform: none; }
.ep-result-eyebrow { color: #7fe6d6; font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.ep-result.is-success .ep-result-eyebrow { color: #ffd36e; }
.ep-result.is-failure .ep-result-eyebrow { color: #ff9f7a; }
.ep-result h3 { margin: 4px 0 6px; color: #fff; font: 700 23px/1.15 var(--serif, Georgia, serif); }
.ep-result ul { display: grid; gap: 4px; margin: 0 0 14px; padding: 0; list-style: none; color: #dbe9e6; font-size: 14px; }
.ep-result li.is-path { color: #ffd36e; font-weight: 700; }
.ep-result li.is-quiet { color: #93aaa6; font-size: 12px; }
.ep-result-actions { display: grid; gap: 6px; }
.ep-result .ep-go:disabled { background: rgba(255, 255, 255, .08); color: #b8cbc7; border-color: rgba(255, 255, 255, .12); }
.ep-done { min-height: 42px; border: 0; background: none; color: #cfe7e2; font-size: 15px; font-weight: 700; }

/* While the rune forms, the rest of the page dims so the panel carries the moment. */
.game-shell > .workspace, .game-shell > .sidebar { transition: filter .5s ease; }
.game-shell.ep-dimmed > .workspace, .game-shell.ep-dimmed > .sidebar { filter: brightness(.74) saturate(.6) blur(1.5px); }
html[data-theme="dark"] .game-shell.ep-dimmed > .workspace, html[data-theme="dark"] .game-shell.ep-dimmed > .sidebar { filter: brightness(.55) saturate(.6) blur(1.5px); }

@media (prefers-reduced-motion: reduce) {
  .inventory-panel .item-dialog.is-takeover[open], .ep-path-body { animation: none; }
  .ep-numeral { animation-duration: .01s !important; animation-delay: 0s !important; }
  .game-shell.ep-dimmed > .workspace, .game-shell.ep-dimmed > .sidebar { filter: brightness(.8); }
}
