/* Beta V3 controls inherit the existing seasonal palette. */
/* Single animation action; the static mode remains the default. */
.haven .haven-animation-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:36px;padding:8px 11px;border:1px solid var(--card-border);border-radius:12px;background:var(--panel-soft);color:var(--text);font-size:11px;font-weight:800;white-space:nowrap;box-shadow:none}
.haven .haven-animation-toggle[aria-pressed=true]{border-color:var(--accent);background:var(--panel-strong)}
.haven-animation-toggle svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
.haven-animation-toggle img{width:21px;height:21px;object-fit:contain;flex-shrink:0}
.haven .haven-animation-toggle:focus-visible{outline:2px solid var(--text);outline-offset:3px}
.haven .haven-animation-toggle:disabled{opacity:.65;cursor:not-allowed}.haven .haven-animation-toggle[aria-busy=true]{opacity:1;cursor:wait}
.haven-animation-toggle[aria-busy=true] img{animation:haven-animation-loading 1.2s ease-in-out infinite}
@keyframes haven-animation-loading{0%,100%{opacity:.45;transform:scale(.88)}50%{opacity:1;transform:scale(1.08)}}
#haven-render-status{display:block;margin:0;padding:10px 16px;color:var(--text);background:var(--panel-soft);font-size:11px;line-height:1.6;border-top:1px solid var(--card-border)}
#haven-render-status[hidden]{display:none!important}#haven-render-mode{display:none!important}
@media(prefers-reduced-motion:reduce){.haven-animation-toggle[aria-busy=true] img{animation:none}}
/* Native canvas is strictly isolated; Unity sizing must never cover the page. */
#haven-native-engine{overflow:hidden;contain:strict}
#haven-native-canvas{width:960px!important;height:600px!important;max-width:none!important;display:block}
.haven-theme-card>span{align-items:center;min-height:48px}
.haven-theme-card .haven-animation-available{display:grid;place-items:center;flex-shrink:0;padding:3px;color:var(--text);border:1px solid var(--card-border);background:var(--panel-strong);border-radius:8px}
.haven-animation-play{transform-origin:12px 12px;animation:haven-play-pulse 1.8s ease-in-out infinite}
.haven-theme-card:hover .haven-animation-available,.haven-theme-card:focus-visible .haven-animation-available{color:var(--text);box-shadow:0 0 0 2px var(--card-border)}
.haven-theme-card{position:relative}
.haven-theme-card:has(.haven-animation-available):is(:hover,:focus-visible)::after{content:'Animation disponible';position:absolute;top:8px;left:8px;padding:6px 9px;border-radius:8px;background:var(--panel-strong);color:var(--text);font-size:10px;box-shadow:0 2px 12px #0004;pointer-events:none}
.haven-share-options:has(#haven-video-export:not([hidden])){grid-template-columns:repeat(3,minmax(0,1fr))}
.haven-share-dialog:has(#haven-video-export:not([hidden])){max-width:860px}
.haven #haven-video-export[hidden]{display:none}
.haven-video-progress{width:min(420px,calc(100vw - 32px));max-height:calc(100dvh - 32px);padding:32px 28px;text-align:center;color:var(--text);background:var(--panel-strong);border:1px solid var(--card-border);border-radius:24px;box-shadow:0 24px 90px #0007}
.haven-video-progress::backdrop{background:#08060ed1;backdrop-filter:blur(3px)}
.haven-video-progress h2{margin:8px 0 14px;font-size:24px;line-height:1.3;color:var(--text)}
.haven-video-progress p{color:var(--muted);font-size:12px;line-height:1.7}
.haven-video-progress .haven-eyebrow{margin:20px 0 0;font-size:9px}
.haven-video-progress #haven-video-status{min-height:21px;color:var(--text)}
.haven-video-emblem{position:relative;width:88px;height:88px;margin:0 auto;animation:haven-video-breathe 2s ease-in-out infinite}
.haven-video-emblem img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.haven-video-emblem-empty{filter:grayscale(1);opacity:.22}
#haven-video-emblem-fill{clip-path:inset(100% 0 0)}
#haven-video-meter{display:block;width:100%;height:6px;margin:18px 0;border:0;border-radius:6px;overflow:hidden;background:var(--panel-soft);accent-color:var(--text)}
#haven-video-meter::-webkit-progress-bar{background:var(--panel-soft);border-radius:6px}
#haven-video-meter::-webkit-progress-value{background:var(--text);border-radius:6px}
#haven-video-meter::-moz-progress-bar{background:var(--text);border-radius:6px}
.haven-video-progress #haven-video-tip{font-size:11px;margin-bottom:22px}
.haven-video-progress #haven-video-cancel{font-size:12px;padding:10px 16px;border-radius:12px;color:var(--text);background:var(--panel-soft);border:1px solid var(--card-border)}
@keyframes haven-video-breathe{0%,100%{transform:scale(.96)}50%{transform:scale(1.04)}}
@media(prefers-reduced-motion:reduce){.haven-video-emblem{animation:none}}
@keyframes haven-play-pulse{0%,100%{opacity:.55;transform:scale(.85)}50%{opacity:1;transform:scale(1.12)}}
@media(prefers-reduced-motion:reduce){.haven-animation-play{animation:none}}
@media(max-width:650px){.haven-share-options:has(#haven-video-export:not([hidden])){grid-template-columns:1fr}}

.haven #haven-video-export:disabled{opacity:.85;cursor:default}

/* Room opening choices use the same palette and leave editing mode independent. */
.haven-room-mode-dialog{width:min(470px,calc(100vw - 32px))}
.haven-room-mode-dialog h2{font-size:23px}
.haven-room-mode-preview{position:relative;margin:8px 0 18px;border-radius:15px;overflow:hidden;background:#111016}
.haven-room-mode-preview img{display:block;width:100%;height:155px;object-fit:contain}
.haven-room-mode-preview strong{position:absolute;left:12px;bottom:10px;padding:5px 10px;border-radius:8px;background:#111016db;color:#fff;font-size:12px}
.haven-room-mode-options{display:grid;gap:10px}
.haven .haven-room-mode-option{display:flex;align-items:center;gap:13px;width:100%;padding:16px;border:1px solid var(--card-border);border-radius:14px;color:var(--text);background:var(--panel-soft);text-align:left}
.haven-room-mode-option>svg{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.5;flex-shrink:0}
.haven-room-mode-option>span:first-of-type{display:grid;gap:5px;flex:1}
.haven-room-mode-option strong{font-size:14px}
.haven-room-mode-option small{font-size:11px;color:var(--muted);font-weight:500;line-height:1.4}
.haven .haven-room-mode-option:hover,.haven .haven-room-mode-option:focus-visible{border-color:var(--text);outline:2px solid var(--card-border);outline-offset:2px;background:var(--panel-strong)}
.haven .haven-room-mode-back{font-size:11px;background:transparent;color:var(--muted);padding:9px 0;border:0}

.haven-hub-tabs{display:flex;gap:6px;margin:8px 0 24px;padding:4px;border:1px solid var(--card-border);border-radius:14px;background:var(--panel-soft)}
.haven .haven-hub-tabs button{flex:1;padding:12px 16px;border:1px solid transparent;border-radius:10px;background:transparent;color:var(--muted);font-size:12px}
.haven .haven-hub-tabs button[aria-pressed=true]{background:var(--panel-strong);border-color:var(--card-border);color:var(--text);box-shadow:0 2px 8px #0001}
.haven #haven-hub-saved[hidden],.haven #haven-hub-share[hidden]{display:none!important}
#haven-hub-saved{min-height:180px}
#haven-hub-saved .haven-dialog-note{font-size:11px;line-height:1.7;color:var(--muted)}
.haven-hub-import{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-top:24px;padding-top:20px;border-top:1px solid var(--card-border)}
.haven-hub-import>div{display:grid;gap:5px}
.haven-hub-import strong{font-size:12px;color:var(--text)}
.haven-hub-import span{font-size:11px;line-height:1.6;color:var(--muted)}
.haven-hub-import button{flex-shrink:0;font-size:11px}
.haven-hub-tabs button:focus-visible{outline:2px solid var(--text);outline-offset:2px}
@media(max-width:520px){.haven-hub-import{align-items:stretch;flex-direction:column}.haven-hub-tabs button{padding:10px 7px;font-size:11px}#haven-save-form{flex-direction:column;align-items:stretch}#haven-save-form label{width:100%}}

@media(max-width:1100px){.haven .haven-heading{flex-wrap:wrap}.haven-title{flex:1 1 100%}.haven-actions{flex:1 1 100%;justify-content:flex-start}}

.haven-canvas.has-lottery-surprise,#haven-canvas.has-lottery-surprise{cursor:pointer}
.haven-lottery-keyboard{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}
.haven .haven-lottery-keyboard:focus-visible{left:12px;bottom:12px;width:auto;height:auto;z-index:3;padding:10px}
.haven-lottery-dialog{position:relative;max-width:430px;text-align:center;overflow:hidden}
.haven-lottery-dialog .haven-dialog-heading{margin-bottom:20px;text-align:left}
.haven-lottery-dialog h2{font-size:34px;margin:14px 0}
.haven-lottery-dialog p{font-size:13px;line-height:1.7}
.haven-lottery-prize{display:block;margin:12px 0 18px;font-family:'Bricolage Grotesque',sans-serif;font-size:27px;line-height:1.25;color:var(--accent)}
.haven-lottery-reels{display:flex;justify-content:center;gap:7px}
.haven-lottery-reels span{display:grid;place-items:center;width:55px;height:60px;border:1px solid var(--card-border);border-radius:12px;background:var(--panel-soft);color:var(--accent);font-size:30px;animation:haven-lottery-reveal .65s ease both}
.haven-lottery-reels span:nth-child(2){animation-delay:.12s}.haven-lottery-reels span:nth-child(3){animation-delay:.24s}
.haven-lottery-inventory strong{color:var(--text)}
.haven-lottery-dialog #haven-lottery-note{margin:18px 0 22px;font-size:10px;color:var(--muted)}
.haven-lottery-sparkles{pointer-events:none;position:absolute;inset:70px 16px auto;display:flex;justify-content:space-around;color:var(--accent);font-size:22px}
.haven-lottery-sparkles span{animation:haven-lottery-star 1.5s ease-in-out infinite alternate}.haven-lottery-sparkles span:nth-child(2){animation-delay:.4s}.haven-lottery-sparkles span:nth-child(3){animation-delay:.8s}
@keyframes haven-lottery-reveal{from{opacity:0;transform:translateY(-14px) rotate(-9deg)}to{opacity:1;transform:none}}
@keyframes haven-lottery-star{from{opacity:.25;transform:scale(.7)}to{opacity:1;transform:scale(1.15)}}
@media(prefers-reduced-motion:reduce){.haven-lottery-reels span,.haven-lottery-sparkles span{animation:none}}
