/* Cuddle Corner owns only its quest-sized dialog and its collection view. */
/* Only the illustrated machine and its close control occupy the popup. */
dialog:has([data-cuddle-corner]){--cc-safe-top:env(safe-area-inset-top,0px);--cc-safe-bottom:env(safe-area-inset-bottom,0px);position:fixed;inset:auto;left:var(--cc-dialog-left,50%);top:var(--cc-dialog-top,12px);margin:0;transform:none;width:var(--cuddle-width,min(720px,calc(100vw - 32px)));max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px);padding:32px 0 0;background:transparent;border:0;border-radius:0;overflow:hidden;box-shadow:none;box-sizing:content-box}
dialog:has([data-cuddle-corner]) .modal-header{position:absolute;inset:0 0 auto;height:44px;margin:0;padding:0!important;z-index:5;pointer-events:none;border:0;background:none}
dialog:has([data-cuddle-corner]) .modal-header h2{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;margin:-1px;padding:0}
dialog:has([data-cuddle-corner]) .modal-header [data-action="close"]{position:absolute;top:0;right:0;display:grid;place-items:center;width:44px;height:44px;min-width:44px;margin:0;padding:11px;pointer-events:auto;border:0;border-radius:50%;background:#fffdf4f2;color:#294e41;box-shadow:0 2px 9px #273e3524;transform:none}
dialog:has([data-cuddle-corner]) .modal-header [data-action="close"]:hover{background:#fffdf4}
dialog:has([data-cuddle-corner]) .modal-header [data-action="close"]:focus-visible{outline:2px solid #69a187;outline-offset:2px}
dialog:has([data-cuddle-corner]) .modal-body{padding:0!important;overflow:visible;max-height:none}
[data-cuddle-corner]{color:#355d50;width:100%;min-width:0;container-type:inline-size}
.cuddle-machine{position:relative;width:100%;isolation:isolate;display:flex;flex-direction:column}
/* Contain the whole cabinet without stretching the wallpaper or squashing its controls. */
.cuddle-glass{position:relative;order:0;width:100%;aspect-ratio:320/var(--cuddle-scene-height,373);overflow:hidden;background:transparent}
.cuddle-scene{display:block;width:100%;height:100%}
.cuddle-console{position:absolute;inset:0;pointer-events:none;border:0;background:none;padding:0}
.cuddle-tries{pointer-events:auto;cursor:pointer;appearance:none;border:0;background:none;box-shadow:none;padding:0;border-radius:10px;min-height:28px;font-family:inherit;position:absolute;left:50%;top:var(--cc-tries-top,4.6%);transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;gap:4px;width:22%;color:#7b7757;white-space:nowrap;font-variant-numeric:tabular-nums;line-height:1;font-size:clamp(7px,1.9cqw,12px)}
.cuddle-tries:hover{background:#fffdf018}.cuddle-tries:disabled{cursor:default;opacity:1}.cuddle-tries strong{font:500 clamp(11px,3.4cqw,22px)/1 'Outfit',sans-serif;color:#62724f}
/* Invisible, generous touch targets sit over the illustrated controls. */
.cuddle-joystick,.cuddle-lower{position:absolute;pointer-events:auto;transform:translate(-50%,-50%);width:14cqw;height:14cqw;min-width:44px;min-height:44px;max-width:90px;max-height:90px;box-sizing:border-box;padding:0;border:0;border-radius:50%;background:none;box-shadow:none;touch-action:none}
.cuddle-joystick{left:47.1875%;top:var(--cc-stick-top,79.09%);cursor:grab;outline-offset:1px;--cc-x:0;--cc-y:0}
.cuddle-joystick{clip-path:inset(0 max(0px,calc(50% - 5.8cqw)) 0 0 round 50%)}
.cuddle-lower{clip-path:inset(0 0 0 max(0px,calc(50% - 5.8cqw)) round 50%)}
.cuddle-joystick:active{cursor:grabbing}
.cuddle-lower{left:59.22%;top:var(--cc-button-top,82.17%);cursor:pointer;touch-action:manipulation}
.cuddle-lower:disabled{cursor:default;background:none;opacity:1}
.cuddle-glass [data-cc-button-art]{opacity:1}
.cuddle-glass [data-cc-button-press]{transform:translateY(0);transform-box:view-box;transition:transform 90ms ease-out}
.cuddle-glass:has(.cuddle-lower:active:not(:disabled)) [data-cc-button-press]{transform:translateY(.95px)}
.cuddle-illustrated-controls{pointer-events:none}
/* Warm chasing bulbs whenever the machine is on, including joystick aiming. */
.cuddle-lights{opacity:.12;pointer-events:none}.is-on .cuddle-lights{opacity:1}
.cuddle-lamp-glow{opacity:.65}.cuddle-bulb{opacity:.72}
.is-on .cuddle-lamp-glow{animation:cuddle-warm-light 2.4s ease-in-out calc(var(--lamp)*-.8s) infinite}
.is-on .cuddle-bulb{animation:cuddle-pearl-light 2.4s ease-in-out calc(var(--lamp)*-.34s) infinite}

.cuddle-tray-collect{position:absolute;left:12.5%;top:var(--cc-tray-top,83.91%);width:24.375%;height:var(--cc-tray-height,15.68%);min-height:44px;padding:0;border:0;border-radius:12px;background:transparent;cursor:pointer}
.cuddle-tray-collect:hover{background:#fff7dc08}
@keyframes cuddle-warm-light{0%,100%{opacity:.2}40%,55%{opacity:1}}@keyframes cuddle-pearl-light{0%,12%,75%,100%{opacity:.14}30%,48%{opacity:1}}
.cuddle-machine.is-paused .cuddle-lamp-glow,.cuddle-machine.is-paused .cuddle-bulb{animation-play-state:paused}
@media(prefers-reduced-motion:reduce){.cuddle-machine.is-on .cuddle-lamp-glow,.cuddle-machine.is-on .cuddle-bulb{animation:none;opacity:.8}}
[data-cuddle-corner] button:focus-visible,.cuddle-joystick:focus-visible{outline:2px solid #3d876e;outline-offset:4px}
/* Keep spoken progress without adding any text or spacer above the cabinet. */
.cuddle-caption{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
.cuddle-prize-card{display:block;width:230px;max-width:100%;flex:none;text-align:left;font:inherit;color:inherit;cursor:pointer}
.cuddle-prize-card .shelf-item-top{margin:0}.cuddle-prize-card .shelf-item-top>.item-art{width:45px;height:45px;flex-basis:45px}.cuddle-prize-card .shelf-item-top strong{white-space:normal;line-height:1.3}
.cuddle-card-action{display:flex;justify-content:center;align-items:center;gap:5px;font-size:11px;color:#39816a;margin-top:5px}.cuddle-card-action .icon{width:13px;height:13px}
.cuddle-feedback{position:absolute;z-index:3;top:23%;left:10%;right:10%;max-height:33%;overflow:auto;padding:10px 14px;margin:0;border-radius:12px;background:#fff9edee;color:#896b49;font-size:12px;line-height:1.5;text-align:center;box-shadow:0 3px 14px #45674618}.cuddle-feedback button{display:block;margin:6px auto 0}
.cuddle-collect{text-align:center;color:#355d50}.cuddle-collect-art{display:grid;place-items:center;width:150px;height:150px;margin:0 auto 16px;border-radius:50%;background:radial-gradient(circle,#faf1d9,transparent 70%)}
.cuddle-collect-art.rarity-4{background:radial-gradient(circle,#f0e6f5,transparent 70%)}.cuddle-collect-art.rarity-5{background:radial-gradient(circle,#fff1bf,transparent 70%)}.cuddle-collect-art .item-art{width:138px;height:138px;object-fit:contain}
.cuddle-collect h3{font:500 24px 'Outfit',sans-serif;margin:8px 0 12px}.cuddle-collect p{font-size:14px;line-height:1.65;color:#788a7b}.cuddle-collect .cuddle-collect-note{font-size:12px}.cuddle-collect-actions{display:flex;flex-direction:column;align-items:center;gap:16px;margin-top:22px}.cuddle-claim-feedback{color:#98724d!important}
.cuddle-chest-contents{display:flex;align-items:center;justify-content:center;gap:12px;margin:14px auto;padding:12px 16px;max-width:280px;border-radius:16px;background:#f5f7ed;color:#46654f;font-size:14px}.cuddle-chest-contents .item-art{width:56px;height:56px;object-fit:contain}.cuddle-chest-contents strong{font-weight:600}
.cuddle-prize-list{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:22px 0}.cuddle-prize-list .cuddle-prize-info{display:flex;align-items:center;gap:9px;padding:10px;border:1px solid #e6ebdf;border-radius:12px;background:#fffdf8;font:inherit;color:inherit;text-align:left;cursor:pointer;margin:0;min-width:0;width:auto}.cuddle-prize-list .item-art{width:48px;height:48px;object-fit:contain}.cuddle-prize-list strong{display:block;font-size:12px}.cuddle-prize-list small{display:block;font-size:10px;color:#85917f;margin-top:4px}.cuddle-prizes p,.cuddle-saved p{font-size:13px;line-height:1.7;color:#7a8c7e}.cuddle-saved{display:flex;flex-wrap:wrap;gap:12px;justify-content:center}.cuddle-saved>p,.cuddle-saved>.text-link{flex-basis:100%;text-align:center}
.cuddle-empty,.cuddle-visit-page{text-align:center;padding:0 0 20px}.cuddle-empty>img,.cuddle-visit-page>img{width:100%;max-width:600px;border-radius:14px}.cuddle-empty p,.cuddle-visit-page p{margin:20px;font-size:14px;color:#7a8c7e}
@media(max-width:420px){.cuddle-prize-list{grid-template-columns:1fr}}
@media(max-height:500px) and (min-width:600px){dialog:has([data-cuddle-corner]) .modal-header{padding:8px 12px}dialog:has([data-cuddle-corner]) .modal-header h2{font-size:18px}}

@media(max-height:500px){dialog:has([data-cuddle-corner]){max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}}

/* Portrait cabinet cover: no inherited panoramic art wrapper or cover crop. */
dialog:has([data-cuddle-discovery]){width:min(620px,calc(100vw - 32px),calc((100dvh - 304px)*.8 + 40px));max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);padding:0;border-radius:23px;background:#fffdf8;overflow:auto}
dialog:has([data-cuddle-discovery]) .modal-header{padding:17px 24px 12px}
dialog:has([data-cuddle-discovery]) .modal-body{padding:0 20px 18px}
[data-cuddle-discovery] .cuddle-discovery-card{display:block!important;height:auto!important;max-height:none!important;aspect-ratio:auto!important;overflow:hidden;background:#fff8e9;border-radius:18px}
[data-cuddle-discovery] .cuddle-cover-frame{display:block;position:relative;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:auto!important;background:#fff7e7;overflow:visible!important}
[data-cuddle-discovery] img.cuddle-discovery-cover{display:block!important;position:static!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;aspect-ratio:1122/1402!important;object-fit:contain!important;object-position:center!important;transform:none!important;border:0;border-radius:0}
[data-cuddle-discovery] .company-encounter-copy{padding:14px 20px;background:#f5f8ee}
[data-cuddle-discovery] .company-encounter-copy h4{margin:5px 0 7px}
[data-cuddle-discovery] .company-encounter-copy p{margin:0;font-size:13px;line-height:1.6}
[data-cuddle-discovery] .journey-return-actions{margin-top:15px;padding:0;border:0}
[data-cuddle-discovery] .cuddle-discovery-actions{display:flex;justify-content:center;align-items:center;gap:12px;flex-wrap:wrap;width:100%}
[data-cuddle-discovery] .cuddle-discovery-actions .button{box-sizing:border-box;width:auto!important;min-width:120px!important;min-height:48px;flex:0 0 auto;max-width:100%;margin:0!important;padding:14px 20px!important;line-height:1.25}
@media(max-width:480px){dialog:has([data-cuddle-discovery]) .modal-header{padding:15px 16px 10px}dialog:has([data-cuddle-discovery]) .modal-body{padding:0 12px 14px}[data-cuddle-discovery] .company-encounter-copy{padding:13px 15px}[data-cuddle-discovery] .company-encounter-copy p{font-size:12px}}

.cuddle-collect-actions small{max-width:280px;font-size:11px;line-height:1.5;color:#7b8c7d}
dialog:has([data-cuddle-collect]){max-width:calc(100vw - 32px);max-height:calc(100dvh - 32px);overflow:auto}
@media(max-height:540px){dialog:has([data-cuddle-discovery]){width:min(400px,calc(100vw - 24px));max-height:calc(100dvh - 24px)}[data-cuddle-discovery] .cuddle-cover-frame{display:flex;justify-content:center}[data-cuddle-discovery] img.cuddle-discovery-cover{width:auto!important;max-width:100%!important;max-height:calc(100dvh - 270px)!important;aspect-ratio:1122/1402!important}}

/* Header navigation leaves the cabinet artwork completely free of footer text. */
dialog:has([data-cuddle-corner]) .modal-header h2{flex:1;min-width:0}
.cuddle-header-prizes{display:inline-flex;align-items:center;justify-content:center;gap:5px;flex:0 0 auto;min-height:36px;padding:5px 7px;font-size:12px;color:#4e7a66;white-space:nowrap;border-radius:9px}
.cuddle-header-prizes:hover{background:#edf4e8}.cuddle-saved-badge{display:inline-grid;place-items:center;min-width:17px;height:17px;padding:0 3px;box-sizing:border-box;border-radius:50%;background:#e9efde;color:#54754b;font-size:10px}
.cuddle-prize-info:hover{border-color:#b9cfb6;background:#f6f8ee}.cuddle-prize-info:focus-visible{outline:2px solid #3d876e;outline-offset:3px}
.cuddle-prizes-actions{display:flex;align-items:center;justify-content:center;gap:16px;flex-wrap:wrap;margin-top:20px}
.cuddle-prizes>.button{display:flex;margin:0 auto}.cuddle-item-description .cuddle-chest-contents small,.cuddle-item-description .cuddle-chest-contents strong{display:block}.cuddle-item-description .cuddle-chest-contents small{font-size:11px;color:#7b8c7d;margin-bottom:4px}

/* The input target never moves; its cap is the only pressed artwork. */
.cuddle-lower:hover,.cuddle-lower:active,.cuddle-lower:focus{background:none;box-shadow:none;transform:translate(-50%,-50%);opacity:1}
@media(prefers-reduced-motion:reduce){.cuddle-glass [data-cc-button-press]{transition:none}}
