@import url("./dfk-card-front.css");
@import url("./dfk-card-back.css");
.apprentice-card{position:relative;isolation:isolate;width:300px;height:390px;flex:none;margin:0;padding:0;border:0;border-radius:20px;overflow:visible;background:transparent;color:#dbe3e8;font-family:Georgia,serif;perspective:1100px}
.apprentice-card *{box-sizing:border-box}
.apprentice-card-turn{position:relative;width:100%;height:100%;transform-style:preserve-3d;transition:transform .5s ease}
.apprentice-card.is-flipped .apprentice-card-turn{transform:rotateY(180deg)}
.apprentice-card.is-previewing .apprentice-card-turn{transition:none}
.apprentice-card-actions{display:flex;gap:12px}
.apprentice-card-face{position:absolute;inset:0;border-radius:20px;overflow:hidden;backface-visibility:hidden;-webkit-backface-visibility:hidden;background:var(--card-body) center/100% 100% no-repeat;box-shadow:0 12px 25px #0005}
.apprentice-card-back{transform:rotateY(180deg)}
.apprentice-card-front{cursor:pointer}
.apprentice-card-layer{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;image-rendering:pixelated}
.apprentice-card-portrait-frame{height:430px}
.apprentice-card-border{z-index:3}
.apprentice-card-trim-top,.apprentice-card-trim-bottom{position:absolute;z-index:3;left:0;right:0;overflow:hidden;pointer-events:none}
.apprentice-card-trim-top{top:0;height:296px}
.apprentice-card-trim-bottom{top:296px;bottom:0}
.apprentice-card-trim-top img,.apprentice-card-trim-bottom img{position:absolute;left:0;width:300px;height:430px;image-rendering:pixelated}
.apprentice-card-trim-top img{top:0}
/* Remove 24px from the XP panel's middle, preserving its original border pixels. */
.apprentice-card-trim-bottom img:first-child{top:-312px;clip-path:inset(312px 0 74px)}
.apprentice-card-trim-bottom img:last-child{top:-336px;clip-path:inset(380px 0 0)}
.apprentice-card-scene{position:absolute;left:36px;top:40px;width:228px;height:212px;overflow:hidden;isolation:isolate;background-position:center;background-size:cover;image-rendering:pixelated}
.apprentice-card-scene:before{content:"";position:absolute;inset:0;background:linear-gradient(#11172225,#11172205 55%,#11172265);z-index:0}
.apprentice-card-scene>.stronghold-archer{position:absolute;z-index:2;left:34px;bottom:12px;width:160px;height:192px;max-width:none}
.apprentice-card-ground{position:absolute;z-index:1;bottom:15px;left:81px;width:66px;height:9px;background:#14201ca8;border-radius:50%}
.apprentice-card-heading{position:absolute;z-index:4;top:10px;left:26px;right:26px;height:14px;text-align:center;color:#232332;font:9px/14px 'Segoe UI',sans-serif;letter-spacing:1.1px}
.apprentice-card-heading>img{position:absolute;right:0;top:0}
.apprentice-card-heading img{width:14px;height:14px;object-fit:contain;image-rendering:pixelated}
.apprentice-card-name{position:absolute;z-index:4;top:30px;left:50%;transform:translateX(-50%);white-space:nowrap;max-width:230px}
.apprentice-card-name span{position:relative;display:block;height:26px;line-height:26px;padding:0 5px;background:var(--card-ribbon) repeat-x;font-size:14px;max-width:230px}
.apprentice-card-name span:before,.apprentice-card-name span:after{content:"";position:absolute;top:0;width:16px;height:26px;background-repeat:no-repeat}
.apprentice-card-name span:before{left:-15px;background-image:var(--card-ribbon-left)}
.apprentice-card-name span:after{right:-15px;background-image:var(--card-ribbon-right)}
.apprentice-card-vitals{position:absolute;z-index:4;top:229px;left:43px;right:43px;display:flex;align-items:center;justify-content:space-between;font-size:11px;text-shadow:0 1px 3px #000}
.apprentice-card-vitals>span{display:flex;gap:4px;align-items:center}
.apprentice-card-vitals>span:nth-child(2){font:8px 'Segoe UI',sans-serif;letter-spacing:1px}
.apprentice-card-vitals img{width:16px;height:16px;image-rendering:pixelated}
.apprentice-card-info{position:absolute;z-index:4;left:36px;right:36px;top:267px;display:flex;justify-content:space-between;align-items:center;color:#18182a}
.apprentice-card-info>div:first-child{display:grid;gap:0}
.apprentice-card-info strong{font-weight:400;font-size:17px;line-height:18px}
.apprentice-card-info span{display:block;margin-top:0;text-transform:capitalize;font:9px/9px 'Segoe UI',sans-serif;letter-spacing:1px}
.apprentice-card-level{font-size:12px}.apprentice-card-level strong{margin-left:4px}
.apprentice-card-back-summary{position:absolute;z-index:4;top:77px;left:44px;right:44px;display:flex;align-items:center;justify-content:space-between;font-size:12px;color:#fff4db}
.apprentice-card-back-summary strong{font-size:18px;font-weight:400}
.apprentice-card-back-vitals{position:absolute;z-index:4;top:110px;left:44px;right:44px;display:flex;gap:28px;color:#fff4db;font-size:13px}
.apprentice-card-back-vitals span{display:flex;gap:6px;align-items:center}
.apprentice-card-back-vitals img{width:16px;height:16px;image-rendering:pixelated}
.apprentice-card-stats{position:absolute;z-index:4;top:142px;left:44px;right:44px;margin:0;display:grid;grid-template-columns:1fr;gap:0;text-align:left}
.apprentice-card-stats>div{display:flex;justify-content:space-between;align-items:center;min-height:24px;border-bottom:1px solid #e8e6ef25}
.apprentice-card-stats dt{font:12px/18px 'Segoe UI',sans-serif;opacity:.9}
.apprentice-card-stats dd{margin:0;font:15px/18px Georgia,serif}
.apprentice-card-xp{position:absolute;z-index:4;top:308px;left:44px;right:44px;height:30px;display:grid;grid-template-rows:18px 8px;row-gap:4px;color:#fff4db}
.apprentice-card-xp-label{display:flex;justify-content:space-between;align-items:center;font:11px/16px 'Segoe UI',sans-serif;letter-spacing:1px}
.apprentice-card-xp-label strong{font:14px/16px Georgia,serif;letter-spacing:0}
.apprentice-card-xp-track{box-sizing:border-box;min-width:0;width:100%;height:8px;margin:0;border:1px solid #d4dfed70;background:#0e1429;border-radius:2px;overflow:hidden}
.apprentice-card-xp-track>span{display:block;height:100%;background:linear-gradient(#8bcce7,#488fcb);box-shadow:inset 0 1px #d5f1ff90;transition:width .3s ease}
.apprentice-card-footer{position:absolute;z-index:4;left:30px;right:30px;bottom:12px;text-align:center;font:9px 'Segoe UI',sans-serif;letter-spacing:1px}
.apprentice-card-name,.apprentice-card-footer{color:#fff4db;text-shadow:0 1px 2px #000}
.apprentice-card-vitals{color:#fff4db}
.apprentice-card-stats{color:#e8e6ef}

/* Mint-page integration. Keep the reference card's 300 x 390 pixel geometry. */
#requests{grid-template-columns:repeat(auto-fit,300px);justify-content:center;gap:28px 26px}
.nft-tile{width:300px;min-width:0}
.apprentice-card-scene>.card-dwarf-image{position:absolute;z-index:2;left:2px;bottom:4px;width:224px;height:212px;max-width:none;object-fit:contain;image-rendering:pixelated}
.nft-card-caption{display:flex;justify-content:space-between;gap:8px;align-items:center;margin:10px 4px 0;font-size:10px;color:var(--muted)}
.nft-card-caption a{color:var(--gold);border-bottom:1px solid #7e7751;white-space:nowrap}
@media(max-width:389px){#requests{grid-template-columns:264px}.nft-tile{width:264px}.apprentice-card{transform:scale(.88);transform-origin:top left;margin-bottom:-46.8px}}
@media(prefers-reduced-motion:reduce){.apprentice-card-turn,.apprentice-card.is-flipped .apprentice-card-turn,.apprentice-card-back{transform:none;transition:none}.apprentice-card-face[aria-hidden=true]{visibility:hidden}.apprentice-card-xp-track>span{transition:none}}

.card-view-hint{margin:8px 0 0;color:var(--muted);font-size:11px}

/* Canonical shiny status has a text label as well as a visual accent. */
.apprentice-card.is-shiny .apprentice-card-face{box-shadow:0 0 0 2px #edce75,0 0 18px #edce7555,0 12px 25px #0005}
.apprentice-card.is-shiny .apprentice-card-heading{font-weight:700}

/* A fixed footer inside the frame stays above both rotating card faces. */
.card-navigation{position:absolute;z-index:6;left:22px;right:22px;bottom:11px;display:grid;grid-template-columns:25px repeat(4,minmax(0,1fr));gap:3px;margin:0}
.card-navigation button{min-width:0;min-height:27px;padding:3px 1px;border:1px solid #827448;border-radius:4px;background:#151c19;color:#eee3b0;font:11px/1.15 'Segoe UI',sans-serif;box-shadow:none;text-shadow:none;letter-spacing:0}
.card-navigation .apprentice-card-flip{font:21px/1 Georgia,serif}
.card-navigation button:hover{background:#393d29;border-color:#d7bf78}
.card-navigation button[aria-pressed=true]{background:#4b4828;color:#fff5c7;border-color:#e5c776;box-shadow:inset 0 -2px #e5c776}
.card-navigation button:focus-visible,.card-detail-body:focus-visible{outline:2px solid #fff1a3;outline-offset:2px}
.card-detail-body{position:absolute;z-index:4;top:72px;bottom:48px;left:42px;right:39px;padding:0 5px 4px 0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#95b5c5 #202340;color:#eeeaf5;text-align:left;font:12px/1.4 'Segoe UI',sans-serif}
.card-detail-summary{display:flex;justify-content:space-between;align-items:center;color:#fff4db;margin-bottom:6px}
.card-detail-summary strong{font:18px/1.3 Georgia,serif}
.card-detail-summary span{font:12px Georgia,serif}
.card-detail-vitals{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-bottom:8px;color:#fff4db;font:12px/18px Georgia,serif}
.card-detail-vitals span{display:flex;align-items:center;gap:5px}
.card-detail-vitals img{width:15px;height:15px;image-rendering:pixelated}
.card-detail-rows{margin:0}
.card-detail-rows>div{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:8px;padding:4px 0;border-bottom:1px solid #e8e6ef25;align-items:baseline}
.card-detail-rows dt{font-size:11px;color:#d0d3e0}
.card-detail-rows dd{margin:0;text-align:right;overflow-wrap:anywhere;font-size:12px;font-variant-numeric:tabular-nums}
.apprentice-card[data-card-view=stats] .card-detail-rows>div{padding:2px 0}
.card-detail-heading{margin:14px 0 5px!important;padding-bottom:4px;border-bottom:1px solid #c3d9df66;color:#fff4db;font:14px/1.4 Georgia,serif}
.card-detail-note{margin:7px 0!important;color:#c0cadb;font:10px/1.4 'Segoe UI',sans-serif}
.card-color{display:inline-block;width:10px;height:10px;margin-right:4px;border:1px solid #ffffff70;border-radius:2px;vertical-align:baseline}
.card-data-table{width:100%;border-collapse:collapse;table-layout:fixed;font:11px/1.4 'Segoe UI',sans-serif}
.card-data-table th,.card-data-table td{border-bottom:1px solid #e8e6ef25;padding:5px 1px;text-align:right;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.card-data-table th{font-weight:400;color:#d0d3e0}
.card-data-table th:first-child{width:44%;text-align:left}
.card-data-table thead th{color:#f5e4ab;font-size:10px}
.card-gene-details{margin-top:12px;border-top:1px solid #c3d9df55;padding-top:6px}
.card-gene-details>summary{padding:3px 0;color:#f5e4ab;font:12px/1.4 Georgia,serif}
.card-gene-table th:first-child{width:48%}
.card-gene-table td{font-size:10px}

/* Move the cached foil layer, never the portrait or card geometry. */
.apprentice-card.is-shiny .apprentice-card-scene:after,
.apprentice-card.is-shiny .apprentice-card-back:after{content:"";position:absolute;inset:-20%;z-index:0;pointer-events:none;background:url("./card-art/shiny/foil.png") center/cover no-repeat;mix-blend-mode:screen;opacity:.58;animation:dwarf-foil-drift 7s ease-in-out infinite alternate;animation-play-state:paused}
.apprentice-card.is-shiny .apprentice-card-back:after{z-index:1;mix-blend-mode:soft-light;opacity:.42}
.apprentice-card.is-shiny[data-shine-active=true]:not(.is-flipped) .apprentice-card-scene:after,
.apprentice-card.is-shiny[data-shine-active=true].is-flipped .apprentice-card-back:after{animation-play-state:running}
@keyframes dwarf-foil-drift{0%{transform:translate3d(-9%,-6%,0) rotate(-4deg)}50%{transform:translate3d(1%,4%,0) rotate(1deg)}100%{transform:translate3d(9%,-1%,0) rotate(4deg)}}
.card-shine-toggle{display:block;width:max-content;margin:5px 0 0;padding:2px 5px;border:1px solid #edce7560;border-radius:3px;color:inherit;background:transparent;font:inherit;cursor:pointer}
.card-shine-toggle:focus-visible{outline:2px solid #edce75;outline-offset:2px}

/* Card portraits: 15% larger, preserving the existing female proportion and boot baseline. */
.apprentice-card-scene>.card-dwarf-image{transform:scale(1.15);transform-origin:50% 92.45283%}
.apprentice-card-scene>.card-dwarf-image[data-gender="female"]{transform:scale(1.035)}
/* Female roster-card art is 25% larger than its former 1.035 scale. */
.tavern-detailed-card .hero-portrait .hero-portrait-dwarf-art:is(:has(svg[data-gender="female"]),[data-gender="female"]){transform:translateX(-50%) scale(1.29375);transform-origin:50% 95.833333333%}

/* Keep regular hero portrait wrappers at the full card scene height. */
.tavern-detailed-card .apprentice-card-scene > div{position:absolute!important;inset:0;width:100%;height:100%}

/* Tavern portraits: modest size adjustment without moving the boot baseline. */
.tavern-detailed-card .hero-portrait-viewer{transform:translate(-50%,6%) scale(1)!important}
.tavern-detailed-card .hero-portrait-dwarf-art{height:79.2%}
/* Keep foil behind the character inside its stacking context. */
.tavern-detailed-card .apprentice-card.is-shiny .apprentice-card-scene:after{display:none}
.tavern-detailed-card .apprentice-card.is-shiny .hero-portrait:before{content:"";position:absolute;inset:-20%;pointer-events:none;background:url("/testsummon/player/card-art/shiny/foil.png") center/cover no-repeat;mix-blend-mode:screen;opacity:.32;animation:dwarf-foil-drift 7s ease-in-out infinite alternate;animation-play-state:paused}
.tavern-detailed-card .apprentice-card.is-shiny[data-shine-active=true]:not(.is-flipped) .hero-portrait:before{animation-play-state:running}

.tavern-detailed-card .apprentice-card.is-shiny[data-shine-active=true]:not(.is-flipped) .hero-portrait:before{animation-duration:7s!important;animation-iteration-count:infinite!important}

.apprentice-card .apprentice-card-front .apprentice-card-info{top:274px;left:30px;right:30px;height:27px;align-items:start}
.apprentice-card-info:has(>.apprentice-card-number){display:grid;grid-template-columns:max-content minmax(0,1fr) max-content;column-gap:4px}
.apprentice-card-info>div{min-width:0}
.apprentice-card .apprentice-card-front .apprentice-card-info>div:first-child{display:grid;grid-template-rows:16px 11px;gap:0}
.apprentice-card .apprentice-card-front .apprentice-card-info>div:first-child>strong{font-size:15px;line-height:16px}
.apprentice-card .apprentice-card-front .apprentice-card-info .apprentice-card-level{position:relative;height:27px;font-size:12px;line-height:16px}
.apprentice-card .apprentice-card-front .apprentice-card-info .apprentice-card-level strong{font-size:14px;line-height:16px}
.apprentice-card .apprentice-card-front .apprentice-card-info span{line-height:11px}
.apprentice-card .apprentice-card-front .apprentice-card-info .apprentice-card-generation{position:absolute;right:0;bottom:0;line-height:11px}
.apprentice-card-info>div:last-child{text-align:right;justify-self:end}
.apprentice-card .apprentice-card-front .apprentice-card-info>.apprentice-card-number{position:static;transform:none;justify-self:center;align-self:end;margin:0;color:inherit;font:400 12px/11px Georgia,serif;letter-spacing:0;text-shadow:none;white-space:nowrap}

.card-owner-details{margin:0 0 12px;padding-bottom:10px;border-bottom:1px solid #b7ac7055}.card-owner-wallet{overflow-wrap:anywhere;font:11px/1.5 monospace;user-select:text;margin:5px 0}.card-owner-town{font:12px/1.5 Georgia,serif;color:inherit;margin:5px 0}.dwarf-expanded-details .card-owner-wallet{font-size:12px}

.nft-tile[data-card-load="loading"]{visibility:hidden;pointer-events:none}
.nft-tile[data-card-load="ready"]{animation:dwarf-card-loaded .22s ease-out both}
@keyframes dwarf-card-loaded{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){.nft-tile[data-card-load="ready"]{animation:none}}
