/* Retrato privado e editável no Meu Bruxo — Avada Kedavra 2.0 */
.character-card .character-portrait-shell { position:relative; width:100%; max-width:236px; aspect-ratio:3/4; margin:0 auto 24px; padding:8px; background:linear-gradient(135deg,#91774b,#291f17 26%,#c1a570 50%,#291f17 77%,#887144); border:1px solid #bca272; box-shadow:0 14px 35px #0009, inset 0 0 0 3px #151514; overflow:hidden; }
.character-card .character-portrait-shell::after {content:'✦';position:absolute;bottom:6px;right:8px;font-size:12px;color:#e6ce92;text-shadow:0 1px 3px #000;pointer-events:none}
.character-card .character-portrait-shell img {display:block;width:100%;height:100%;object-fit:contain;object-position:center bottom;background:radial-gradient(ellipse at 50% 62%,#424938 0%,#1b211e 62%,#131918 100%)}
.character-card .character-portrait-shell .character-medallion {height:100%;width:100%;max-width:none; margin:0; border:0; border-radius:0; font-size:60px}
.portrait-editor {background:linear-gradient(155deg,#181c1b,#212625 70%,#171b19);border:1px solid #826f4d;color:#e9e2cf;padding:clamp(18px,4vw,34px);margin:24px 0 32px;box-shadow:0 20px 40px #0002}
.portrait-editor-intro .eyebrow {color:#d5b77b;font-size:10px}
.portrait-editor-intro h3 {font:normal clamp(25px,3vw,34px)/1.2 Georgia,serif;margin:9px 0;color:#eee4cc}
.portrait-editor-intro>p:last-child {font-size:13px;color:#bfbbaa;line-height:1.7;max-width:660px}
.portrait-editor-grid {display:grid;grid-template-columns:minmax(160px,240px) minmax(0,1fr);gap:clamp(18px,4vw,34px);align-items:start;margin-top:24px}
.portrait-editor-stage {position:relative;aspect-ratio:3/4;padding:8px;background:linear-gradient(135deg,#bc9d62,#191b1a 23%,#82683e 48%,#191b1a 75%,#bc9d62);border:1px solid #b8a174;box-shadow:0 12px 32px #0007;overflow:hidden}
.portrait-editor-stage .portrait-crop-canvas,.portrait-editor-stage .portrait-saved-preview {width:100%;height:100%;display:block;object-fit:contain;object-position:center bottom;background:radial-gradient(ellipse at 50% 64%,#3c4a48 0%,#212827 55%,#121a18 100%)}
.portrait-editor-stage .portrait-crop-canvas {touch-action:none;cursor:grab}
.portrait-editor-stage .portrait-crop-canvas:active {cursor:grabbing}
.portrait-editor-stage .portrait-editor-empty {height:100%;display:flex;flex-direction:column;gap:12px;justify-content:center;align-items:center;text-align:center;background:radial-gradient(circle,#353a31,#19211e);color:#d5c69e;padding:18px;font:14px Georgia,serif}
.portrait-editor-empty span {font-size:40px;font-weight:normal;color:#c8ab6d}
.portrait-editor-stage .portrait-stage-label {position:absolute;bottom:7px;left:50%;transform:translateX(-50%);white-space:nowrap;max-width:95%;overflow:hidden;text-overflow:ellipsis;font-size:8px;letter-spacing:1.1px;color:#f4e3ae;background:#0f1518d9;padding:5px 9px;pointer-events:none}
.portrait-editor-controls {display:flex;flex-direction:column;gap:13px;min-width:0}
.portrait-editor-controls label:not(.portrait-picker) {font-size:12px;display:flex;flex-direction:column;gap:7px;color:#ede2c6}
.portrait-editor-controls label output {font-size:11px;color:#d8bd83}
.portrait-editor-controls input[type=range] {width:100%;accent-color:#bea06b;margin:0;cursor:pointer}
.portrait-picker {display:inline-flex;align-items:center;justify-content:center;min-height:44px;gap:9px;cursor:pointer;text-align:center;border:1px solid #ddbe81;color:#eee1c8;background:#72593233;padding:12px 15px;font-size:12px;font-weight:600}
.portrait-picker:focus-within {outline:2px solid #e3c893;outline-offset:3px}
.portrait-picker input[type=file] {position:absolute;width:1px;height:1px;opacity:0}
.portrait-help {font-size:11px!important;line-height:1.65!important;color:#bfb8a8!important;margin:0!important}
.portrait-fit-choices {display:flex;gap:7px;flex-wrap:wrap}
.portrait-fit-choices button {padding:10px 12px;border:1px solid #695d4c;background:#222828;color:#d8cab0;font-size:11px;min-height:42px;flex:1}
.portrait-fit-choices button.active {border-color:#d4b77e;color:#fff4d5;background:#675335}
.portrait-save {background:#c7aa72;color:#161b19;padding:13px 16px;min-height:44px;font-size:12px;font-weight:700;cursor:pointer}
.portrait-save:hover {background:#e4c98f}
.portrait-discard {color:#e2d6bc;background:transparent;min-height:42px;border:1px solid #796851;padding:10px 15px;cursor:pointer;font-size:11px}
.portrait-editor-controls button:disabled,.portrait-picker:has(input:disabled){opacity:.55;cursor:not-allowed}
.portrait-error,.portrait-success,.portrait-hint {font-size:12px!important;line-height:1.6!important;margin:0!important;padding:10px 12px}
.portrait-error {color:#ffe3d9;background:#8d322540;border-left:2px solid #ff9981}
.portrait-success {color:#e6ffe3;background:#2b744135;border-left:2px solid #83ba8f}
.portrait-hint {color:#e9dfc7;background:#bea4671a;border-left:2px solid #bfa16e}
@media (max-width:710px) {.portrait-editor-grid{grid-template-columns:1fr;justify-items:center}.portrait-editor-stage{width:min(100%,260px)}.portrait-editor-controls{width:100%}.character-card .character-portrait-shell{max-width:205px}}
@media (max-width:400px) {.portrait-editor{padding:18px 14px}.portrait-editor-stage{width:min(100%,230px)}}
@media(prefers-reduced-motion:reduce){.portrait-editor *, .portrait-editor *::before,.portrait-editor *::after{transition:none!important}}
