/* Forged pixel frames share one optical center with the rank numeral. */
.rank-crest,.rank-crest:not([data-tier="0"]){width:84px;height:96px;min-width:84px;min-height:96px}
.rank-crest canvas.oath-frame{inset:0;width:100%;height:100%;transform:none;image-rendering:pixelated;filter:drop-shadow(0 2px 1px #000a) drop-shadow(0 0 5px var(--oath-glow))}
.rank-crest canvas[data-rank-number]{width:47%;height:41.125%;left:50%;top:44.792%;transform:translate(-50%,-50%);image-rendering:auto}
.rank-crest[data-tier="0"]{width:58px;height:48px;min-width:58px;min-height:48px}
.rank-crest[data-tier="0"] canvas[data-rank-number]{width:64px;height:64px;top:50%}
/* Content may grow on short phones; the stage must never crop the keyboard. */
html:has(.stage-combat,.stage-achievements,.stage-experience),body:has(.stage-combat,.stage-achievements,.stage-experience){min-width:0;overflow-x:clip}
.stage-combat .combat.screen{height:auto;min-height:calc(100svh - var(--ad-space));padding-bottom:16px}
/* The sixth spent row and the revived seventh row are both real layout content. */
.rune-board-controls .guess-board{flex-shrink:0;overflow:visible}
/* A raised ward is a large, recognizable shield beside the knight's health. */
.ward-rack{gap:3px;margin-left:3px;align-items:center}
.armed-ward,.ward-half canvas{width:40px;height:46px}
.armed-ward{filter:drop-shadow(0 0 4px #a5e8f080) drop-shadow(0 1px 1px #050d13)}
.ward-crack{inset:22% 40% 21% 40%;height:auto;width:auto}
.armed-ward>i{top:47%;left:48%}
.combat .command-line{min-height:49px}
/* The cipher arrives before its letters start visibly scrambling. */
.combat-entering:has(.cipher-keyboard) .combat-foot,.combat-entering .cipher-keyboard{animation-duration:.35s}
.combat-entering .cipher-symbol,.cipher-symbol{animation:none!important;opacity:1!important;filter:none!important}
.cipher-symbol{display:grid;place-items:center;min-height:1em}
.cipher-symbol.rune-changing{color:#d3b4e7;transform:translateY(var(--rune-jitter,0px));text-shadow:0 0 7px #bc8ee355}
.cipher-symbol:not(.rune-changing){transform:none}
.oath-ceremony{background:radial-gradient(ellipse at 50% 40%,#322320 0,#151713 35%,#060e0b 75%);padding:22px 16px 18px;gap:0;overflow:auto;justify-content:center}
.oath-forge{position:absolute;inset:0;width:100%;height:100%;image-rendering:pixelated;pointer-events:none;z-index:1}
.oath-ceremony>.eyebrow{font-size:7px;letter-spacing:2px;margin:0 0 10px;color:#d3b899}
.oath-ceremony h1{font-size:clamp(29px,6vw,43px);letter-spacing:3px;margin:0;color:var(--oath-metal);text-shadow:0 2px #030906}
.oath-heart{width:220px;height:232px;margin:8px 0 0;flex-shrink:0}
.oath-old-level{font-size:112px;color:#ead3a6;transition:opacity 1.1s,transform 1.4s,filter 1.2s;text-shadow:0 0 30px #eaa76566}
.oath-new-rank{position:absolute;inset:0;opacity:0;transform:translateY(10px) scale(.85);clip-path:inset(50% 0 50% 0);transition:clip-path 1.4s cubic-bezier(.2,.65,.2,1),opacity .5s,transform 1.6s}
.oath-new-rank .rank-crest{width:168px;height:192px;min-width:168px;min-height:192px}
.oath-ceremony[data-phase="forge"] .oath-new-rank,.oath-ceremony[data-phase="crowned"] .oath-new-rank{clip-path:inset(0);opacity:1;transform:none}
.oath-ceremony[data-phase="release"] .oath-old-level{transform:translateY(-7px) scale(1.08);filter:brightness(1.3);opacity:0}
.oath-ceremony[data-phase="forge"] .oath-old-level,.oath-ceremony[data-phase="crowned"] .oath-old-level{opacity:0;transform:translateY(-15px);filter:none}
.oath-forge-rails{position:absolute;inset:37px 31px;opacity:.5;transition:opacity .8s}
.oath-forge-rails i{position:absolute;width:20px;height:20px;border:solid #d6a96c77;border-width:2px 0 0 2px}
.oath-forge-rails i:nth-child(2){right:0;transform:rotate(90deg)}.oath-forge-rails i:nth-child(3){right:0;bottom:0;transform:rotate(180deg)}.oath-forge-rails i:nth-child(4){bottom:0;transform:rotate(270deg)}
.oath-ceremony:not([data-phase="gather"]) .oath-forge-rails{opacity:0}
.oath-earned-title{font-size:22px;letter-spacing:5px;margin:3px 0 7px}
.oath-earned-copy{font-size:13px;line-height:1.5;margin:0 0 15px;z-index:2}
.oath-earned-boons{gap:26px;padding:11px 9px;width:min(344px,100%);z-index:2;border-color:color-mix(in srgb,var(--oath-metal) 25%,transparent)}
.oath-earned-boons b{font-size:26px;margin-bottom:5px}.oath-earned-boons span{font-size:6px;white-space:nowrap}
.oath-witness{position:relative;width:160px;height:108px;margin:5px 0 -3px;flex-shrink:0;z-index:2;opacity:.8}
.oath-witness canvas{width:160px;height:120px;image-rendering:pixelated;position:absolute;bottom:0;left:0}
.oath-continue{z-index:2;font-size:9px;margin:8px 0 0;min-height:42px}
@media(max-width:700px){.armed-ward,.ward-half canvas{width:32px;height:38px}.combat .knight-status{gap:5px}.ward-rack{gap:2px;margin-left:2px}.combat .command-line{min-height:46px}.oath-heart{width:200px;height:210px}.oath-new-rank .rank-crest{width:154px;height:176px;min-width:154px;min-height:176px}}
@media(max-height:740px){.oath-ceremony{padding-block:13px}.oath-ceremony>.eyebrow{font-size:6px;margin-bottom:6px}.oath-ceremony h1{font-size:29px}.oath-heart{height:185px;margin:4px 0 0}.oath-new-rank .rank-crest{width:140px;height:160px;min-width:140px;min-height:160px}.oath-earned-title{font-size:19px;margin-top:0}.oath-earned-copy{margin-bottom:9px;font-size:12px}.oath-earned-boons{padding:9px}.oath-witness{height:88px;width:140px}.oath-witness canvas{width:140px;height:105px}.oath-continue{font-size:8px;min-height:39px}}
@media(max-width:350px){.combat .knight-status{gap:4px}.ward-rack{gap:0}.armed-ward,.ward-half canvas{width:30px;height:36px}.oath-earned-boons{gap:19px}}
@media(prefers-reduced-motion:reduce){.oath-new-rank,.oath-old-level,.oath-earned-title,.oath-earned-copy,.oath-earned-boons,.oath-continue{transition-duration:.1s}.cipher-symbol.rune-changing{transform:none;text-shadow:none}}

/* The frame earned at the forge travels with the knight into every XP reward. */
.oath-emblem{margin-top:14px;margin-bottom:4px}
.oath-emblem .xp-earned-crest{position:relative;z-index:1}
.xp-earned-crest .rank-crest{width:154px;height:176px;min-width:154px;min-height:176px}
.oath-emblem>small{top:-14px;bottom:auto;font-size:7px;letter-spacing:3px;padding-left:3px}
.xp-earned-crest .rank-crest canvas.rank-echo{inset:auto!important;left:50%!important;top:44.792%!important;width:47%;height:41.125%;transform:translate(-50%,-50%);opacity:0;z-index:2}
.rank-up .xp-earned-crest{animation:forged-rank-rises .65s ease-out both}
.rank-up .xp-earned-crest .rank-echo{animation:forged-rank-echo .7s ease-out both}
@keyframes forged-rank-rises{0%{scale:.95}32%{scale:1.08}65%{scale:.99}100%{scale:1}}
@keyframes forged-rank-echo{0%{opacity:.45;transform:translate(-50%,-50%) scale(1)}100%{opacity:0;transform:translate(-50%,-50%) scale(1.65)}}
.oath-preview{display:grid;justify-items:center;margin:16px auto 4px;gap:7px}
.oath-preview>small{font:5px/1.5 'Knightle Quill';letter-spacing:1.1px;color:#c1b68b}
/* The existing Ember Oath feat is also the permanent home for all five frames. */
.oath-collection{max-width:720px;margin:25px auto 0;padding:20px 0 0;border-top:1px solid #ad8b5144}
.oath-collection h3{font:16px/1.4 'Knightle Herald';letter-spacing:1.4px;color:#e2c58f;margin:0 0 8px}
.oath-collection>p{font:italic 13px/1.65 Georgia;color:#bdb69c;margin:0 0 18px}
.oath-collection-grid{display:flex;flex-wrap:wrap;justify-content:center;gap:10px}
.collected-oath{margin:0;flex:0 0 118px;min-width:0;display:flex;flex-direction:column;align-items:center;padding:9px 4px 13px;background:linear-gradient(#252c2177,#0b171333);border-bottom:2px solid #82765344}
.collected-oath.earned{border-color:var(--oath-metal);background:linear-gradient(#263226aa,#10201955)}
.collected-oath.next{border-color:var(--oath-shadow)}
.collected-oath:not(.earned) .rank-crest{filter:saturate(.65);opacity:.7}
.collected-oath.locked .rank-crest{filter:saturate(.25);opacity:.42}
.collected-oath figcaption{display:flex;flex-direction:column;gap:7px;margin-top:9px;text-align:center}
.collected-oath strong{font:13px 'Knightle Herald';color:var(--oath-metal);letter-spacing:1px}
.collected-oath figcaption>span{font:5px 'Knightle Quill';letter-spacing:.5px;color:#a9b29a}
.collected-oath.earned figcaption>span{color:#b7dcac}
.collected-oath figcaption>small{font:9px/1.6 Georgia;color:#b1b5a2}
/* Keep full HP on one line when both visible wards are armed. */
.combat .knight-status>span{white-space:nowrap}
@media(max-width:375px){.combat .command-line{gap:5px}.combat .knight-status{gap:3px}.combat .heart-rack{gap:1px}.combat .knight-status>span{font-size:11px}.combat .knight-status small{font-size:8px}}
@media(max-width:700px){.oath-collection-grid{gap:8px}.collected-oath{flex-basis:calc((100% - 16px)/3);padding:8px 2px 11px}.collected-oath .rank-crest{width:70px;height:80px;min-width:70px;min-height:80px}.collected-oath strong{font-size:11px;letter-spacing:.5px}.collected-oath figcaption>small{font-size:8px}.oath-collection h3{font-size:15px}}
@media(max-width:700px) and (max-height:760px){.xp-earned-crest .rank-crest{width:126px;height:144px;min-width:126px;min-height:144px}}
@media(prefers-reduced-motion:reduce){.rank-up .xp-earned-crest,.rank-up .xp-earned-crest .rank-echo{animation:none}.xp-earned-crest .rank-echo{display:none}}

/* A planted blade, then a raised-arm oath: the knight leads the ceremony. */
.oath-ceremony{padding:20px 16px 18px;justify-content:safe center;background:radial-gradient(ellipse at 50% 50%,color-mix(in srgb,var(--oath-metal) 12%,#101511),#060d0a 72%)}
.oath-ceremony .oath-heart{width:min(410px,100%);height:clamp(306px,46svh,392px);margin:8px 0 4px}
.oath-ceremony .oath-old-level{inset:6px 0 auto;height:92px;font-size:68px}
.oath-ceremony .oath-new-rank{inset:0 0 auto;height:116px;z-index:3;clip-path:none;transform:translateY(8px) scale(.94);transition:opacity .9s,transform 1.2s}
.oath-ceremony .oath-new-rank .rank-crest{width:98px;height:112px;min-width:98px;min-height:112px}
.oath-ceremony[data-phase="forge"] .oath-new-rank,.oath-ceremony[data-phase="crowned"] .oath-new-rank{transform:none}
.oath-ceremony .oath-witness{position:absolute;left:50%;bottom:0;width:min(340px,100%);height:auto;aspect-ratio:192/176;margin:0;transform:translateX(-50%);opacity:1}
.oath-ceremony .oath-witness canvas{inset:0;width:100%;height:100%;image-rendering:pixelated}
.oath-ceremony .oath-earned-title{margin:2px 0 6px;font-size:22px}
.oath-ceremony .oath-earned-copy{margin:0 0 12px;font-size:13px}
.oath-ceremony .oath-continue{margin-top:16px}
@media(max-height:740px){.oath-ceremony{padding-block:12px}.oath-ceremony h1{font-size:27px}.oath-ceremony .oath-heart{height:286px;margin-top:4px}.oath-ceremony .oath-witness{width:248px}.oath-ceremony .oath-new-rank{height:90px}.oath-ceremony .oath-new-rank .rank-crest{width:77px;height:88px;min-width:77px;min-height:88px}.oath-ceremony .oath-old-level{height:70px;font-size:54px}.oath-ceremony .oath-earned-title{font-size:19px}.oath-ceremony .oath-earned-boons{padding-block:8px}.oath-ceremony .oath-continue{margin-top:12px}}
/* The purse uses the same cut, medieval lettering as the controls. */
.combat .combat-purse b{font:700 12px/1.2 'Knightle Quill',serif;letter-spacing:.1px;color:#e6c98f;text-shadow:0 1px #342719,1px 0 #1a1911;font-variant-numeric:tabular-nums}
.combat .combat-purse .coin-debit{font-family:'Knightle Quill',serif;font-size:10px}
@media(max-width:700px){.combat .combat-purse b{font-size:10px}}
@media(max-width:375px){.combat .combat-purse b{font-size:9px}}
