/* Profile portrait and game experience gallery */
.hero{grid-template-columns:140px minmax(0,1fr);gap:38px;align-items:start;min-height:294px}
.profile-card{width:140px;margin:4px 0 0;justify-self:start}
.photo-frame{width:140px;height:140px;border-radius:50%;overflow:hidden;border:1px solid #d7ddea;background:#f4f5f7}
.photo-frame:before{display:none}
.photo-frame img{display:block;width:100%;height:100%;object-fit:cover;object-position:center 36%}
.game-gallery{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;max-height:480px;overflow-y:auto;overscroll-behavior-y:auto;padding:8px 22px 18px 8px;align-content:start;scrollbar-color:#c4ccda #f5f6f8;scrollbar-width:thin}
.game-hint{margin-left:12px;color:#8a8d84;font-size:14px;font-weight:600;letter-spacing:0}
.works.game-mode .library-toolbar{scroll-margin-top:10px}
.works.game-mode .game-gallery{height:calc(100vh - 116px);min-height:240px;max-height:none}
.works.game-mode:not(.admin-game-mode) .game-gallery{height:calc(100vh - 74px)}
.game-gallery[hidden]{display:none!important}
.demo-gallery{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:0 0 20px}
.demo-gallery[hidden]{display:none!important}
.demo-image-card{min-width:0;border:1px solid #d7ddea;background:#fff;overflow:hidden}
.demo-image-preview{display:block;width:100%;padding:0;border:0;background:#eef1f6;cursor:zoom-in;overflow:hidden}
.demo-image-preview img{display:block;width:100%;aspect-ratio:16/9;object-fit:cover;transition:transform .2s ease}
.demo-image-preview:hover img{transform:scale(1.025)}
.demo-image-caption{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;color:#4d5870;font-size:12px}
.demo-image-caption span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.demo-image-caption button{flex:none;border:1px solid #ead4d5;border-radius:999px;background:#fff;padding:4px 10px;color:#a54b50;font:inherit;font-size:11px;cursor:pointer}
.demo-image-caption button:hover{background:#fff1f1}
.game-card{min-width:0;cursor:pointer;text-align:center}
.game-image-frame{position:relative;overflow:visible;aspect-ratio:3/4;background:#eef0f4;border:0}
.game-image-frame img{position:relative;z-index:1;display:block;width:100%;height:100%;object-fit:cover;transition:transform .24s ease;transform-origin:center}
.game-card:hover .game-image-frame img{z-index:3;transform:scale(1.045)}
.game-card h3{margin:10px 3px 3px;font-size:13px;line-height:1.5;font-weight:500;color:#34405a;text-align:center;overflow-wrap:anywhere}
.game-card:hover h3{color:#292fe0}
.game-card.is-dragging{opacity:.4}
.game-card.drag-over{outline:2px solid #292fe0;outline-offset:3px}
.game-card h3{display:flex;align-items:center;justify-content:center;gap:6px}
.game-card h3 span{min-width:0;overflow-wrap:anywhere}
.game-sort-handle{flex:none;width:20px;height:24px;padding:0;border:0;background:transparent;color:#8b95aa;font-size:18px;line-height:1;cursor:grab;touch-action:none}
.game-sort-handle:active{cursor:grabbing}
.game-admin-actions{display:flex;justify-content:center;gap:7px}
.game-admin-actions>button{margin:5px 0 0;padding:4px 12px;border:1px solid #d7ddea;border-radius:999px;background:#fff;color:#59647a;font:inherit;font-size:11px;cursor:pointer}
.game-admin-actions>.game-delete-label{margin:5px 0;border-color:#ead4d5;color:#a54b50}
.game-delete-label{margin:5px auto 0;padding:4px 12px;border:1px solid #ead4d5;border-radius:999px;background:#fff;color:#a54b50;font:inherit;font-size:11px;cursor:pointer;transition:background .18s,color .18s}
.game-delete-label:hover,.game-detail-delete:hover{background:#fff1f1;color:#8e2930}
.game-detail-dialog{position:fixed;inset:auto;margin:0;width:max-content;max-width:calc(100vw - 24px);height:max-content;max-height:calc(100vh - 24px);overflow:visible;padding:0;border:0;background:transparent;color:#202735;outline:none}
.game-detail-dialog::backdrop{background:#19243b22;backdrop-filter:blur(1px)}
.game-popup-scene{display:flex;align-items:center;gap:12px;max-width:calc(100vw - 24px)}
.game-popup-scene[data-side="left"]{flex-direction:row-reverse}
.game-detail-deck{position:relative;z-index:2;flex:0 0 276px;width:276px;height:324px;overflow:visible;filter:drop-shadow(0 14px 24px #18213638)}
.game-detail-card{position:absolute;left:0;top:14px;width:220px;height:293px;overflow:hidden;aspect-ratio:3/4;border-radius:3px;background:#eef0f4;box-shadow:0 12px 30px #17223b38;transform-origin:50% 78%}
.game-detail-card img{display:block;width:100%;height:100%;object-fit:cover}
.game-detail-card-back{z-index:1;left:42px;top:2px;opacity:.7;filter:blur(3px) saturate(.72);transform:rotate(8deg);animation:card-back-spread .42s cubic-bezier(.2,.75,.25,1) both}
.game-detail-card-back:after{content:"";position:absolute;inset:0;background:#ffffff45;border:1px solid #fff9;backdrop-filter:blur(2px)}
.game-detail-card-front{z-index:2;transform:rotate(-3deg);animation:card-front-open .4s cubic-bezier(.2,.75,.25,1) both}
@keyframes card-back-spread{from{opacity:.18;transform:translate(-20px,14px) rotate(0)}to{opacity:.7;transform:translate(0,0) rotate(8deg)}}
@keyframes card-front-open{from{opacity:.55}to{opacity:1}}
.game-bubble{position:relative;z-index:1;flex:0 1 320px;min-width:230px;max-width:min(320px,calc(100vw - 175px));min-height:158px;display:flex;flex-direction:column;justify-content:center;padding:24px 22px 20px;border:1px solid #e1e6ef;border-radius:24px;background:#fff;color:#202735;box-shadow:0 20px 55px #16223b2b;animation:bubble-pop .28s ease-out both}
.game-bubble:before{content:"";position:absolute;left:-11px;top:calc(50% - 11px);width:20px;height:20px;border-left:1px solid #e1e6ef;border-bottom:1px solid #e1e6ef;background:#fff;transform:rotate(45deg)}
.game-popup-scene[data-side="left"] .game-bubble:before{left:auto;right:-11px;border:0;border-top:1px solid #e1e6ef;border-right:1px solid #e1e6ef}
@keyframes bubble-pop{from{opacity:0;transform:scale(.94) translateY(6px)}to{opacity:1;transform:scale(1) translateY(0)}}
.game-detail-dialog .close{position:absolute;right:10px;top:8px;z-index:4;width:25px;height:25px;border:0;border-radius:50%;background:#f2f4f8;color:#647087;font-size:20px;line-height:1;cursor:pointer}
.game-detail-top{display:flex;justify-content:space-between;gap:12px;padding:0 20px 12px 0;color:#273454}
.game-detail-top strong{font-size:15px;font-weight:750;line-height:1.55}
.game-bubble>p{margin:0;padding-top:12px;border-top:1px solid #e8ebf0;color:#59647a;font-size:13px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}
.game-detail-delete{align-self:flex-start;margin-top:14px;padding:6px 12px;border:1px solid #ead4d5;border-radius:999px;background:#fff;color:#a54b50;font:inherit;font-size:11px;cursor:pointer}
.admin-mode-badge{color:#8792a7;font:9px var(--mono);letter-spacing:.06em}
.preview-body img.demo-expanded-image{max-width:100%;max-height:100%;object-fit:contain;cursor:zoom-in}
.hero-meta{font-size:13px;gap:16px}
.hero-meta b{font-size:12px}
.field strong{font-size:14px}
@media(max-width:680px){.hero-meta{gap:8px;font-size:11px}.hero-meta b{font-size:11px}}
@media(max-width:850px){.hero{grid-template-columns:120px minmax(0,1fr);gap:25px}.profile-card,.photo-frame{width:120px}.photo-frame{height:120px}.game-gallery{grid-template-columns:repeat(3,minmax(0,1fr));max-height:440px}.demo-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){.hero{grid-template-columns:86px minmax(0,1fr);gap:16px}.profile-card,.photo-frame{width:86px}.photo-frame{height:86px}.hero .hero-meta{grid-template-columns:1fr 1fr}.game-gallery{grid-template-columns:repeat(2,minmax(0,1fr));gap:13px;max-height:390px}.game-popup-scene{gap:9px}.game-detail-deck{flex-basis:160px;width:160px;height:190px}.game-detail-card{width:112px;height:149px;top:20px}.game-detail-card-back{left:28px;top:8px}.game-bubble{flex-basis:250px;min-width:0;max-width:calc(100vw - 181px);padding:22px 14px 16px;border-radius:20px}.game-detail-top{display:block;padding-right:14px}.game-detail-top strong{display:block;font-size:12px;line-height:1.65}.game-bubble>p{font-size:12px;line-height:1.7;padding-top:9px}}
@media(max-width:600px){.works.game-mode .game-gallery{height:calc(100vh - 165px);max-height:none}}
@media(max-width:600px){.works.game-mode:not(.admin-game-mode) .game-gallery{height:calc(100vh - 120px)}}
@media(max-width:600px){.empty-state{margin-top:14px}}
@media(max-width:380px){.demo-gallery{grid-template-columns:1fr}}
@media(max-width:380px){.game-popup-scene{flex-direction:column!important;align-items:center;max-height:calc(100vh - 24px);overflow:auto;padding:8px}.game-detail-deck{flex-basis:180px;width:180px;height:178px}.game-detail-card{width:115px;height:153px;top:12px}.game-detail-card-back{left:34px;top:2px}.game-bubble{width:min(290px,calc(100vw - 48px));max-width:none;flex:0 0 auto}.game-bubble:before{left:calc(50% - 10px);top:-11px;border:0;border-left:1px solid #e1e6ef!important;border-top:1px solid #e1e6ef!important}.game-detail-top{display:flex}.game-detail-top strong{font-size:11px}}
@media(max-width:400px){.footer{align-items:flex-start;gap:10px;flex-wrap:wrap}.footer-contact{display:flex;flex-direction:column;gap:5px}}

/* Game experience cosmic backdrop */
#works{position:relative;isolation:isolate;transition:color .55s ease}
#works::before{content:"";position:absolute;z-index:-1;top:0;bottom:0;left:50%;width:100vw;transform:translateX(-50%);pointer-events:none;opacity:0;background-color:#050713;background-image:radial-gradient(1px 1px at 7% 13%,#fff 99%,transparent 100%),radial-gradient(1.5px 1.5px at 16% 72%,#b7d2ff 99%,transparent 100%),radial-gradient(1px 1px at 24% 39%,#fff 99%,transparent 100%),radial-gradient(2px 2px at 34% 84%,#dbe7ff 99%,transparent 100%),radial-gradient(1px 1px at 43% 19%,#fff 99%,transparent 100%),radial-gradient(1.5px 1.5px at 52% 57%,#9bbcff 99%,transparent 100%),radial-gradient(1px 1px at 63% 28%,#fff 99%,transparent 100%),radial-gradient(2px 2px at 72% 76%,#d5e2ff 99%,transparent 100%),radial-gradient(1px 1px at 81% 45%,#fff 99%,transparent 100%),radial-gradient(1.5px 1.5px at 93% 17%,#9bbcff 99%,transparent 100%),radial-gradient(1px 1px at 89% 91%,#fff 99%,transparent 100%),radial-gradient(ellipse at 53% 36%,#111b37 0%,#090e20 40%,#050713 78%);transition:opacity .7s ease}
#works.cosmic-mode::before{opacity:1;animation:cosmic-breathe 8s ease-in-out infinite alternate}
@keyframes cosmic-breathe{from{filter:brightness(.88)}to{filter:brightness(1.13)}}
#works.cosmic-mode .section-heading h2,#works.cosmic-mode .section-heading .eyebrow,#works.cosmic-mode .section-note{color:#e7edff}
#works.cosmic-mode .work-layout{border-color:#ffffff2b}
#works.cosmic-mode .category-list{border-color:#ffffff2b}
#works.cosmic-mode .category{border-color:#ffffff20;color:#b8c3df}
#works.cosmic-mode .category:hover,#works.cosmic-mode .category.active{color:#fff;border-bottom-color:#a7bfff}
#works.cosmic-mode .category.active{background:#ffffff0b}
#works.cosmic-mode .cat-num,#works.cosmic-mode .cat-icon,#works.cosmic-mode .category-hint{color:#b6c6ef}
#works.cosmic-mode .library-kicker,#works.cosmic-mode .result-count,#works.cosmic-mode .game-hint,#works.cosmic-mode .sort-hint{color:#c2cbe0}
#works.cosmic-mode .search-box{border-color:#ffffff45;background:#ffffff0c}
#works.cosmic-mode .search-box>span,#works.cosmic-mode .search-box input,#works.cosmic-mode .search-box input::placeholder,#works.cosmic-mode .search-box kbd{color:#e7edff}
#works.cosmic-mode .search-box kbd{border-color:#ffffff45}
#works.cosmic-mode .game-card h3{color:#e7edff}
#works.cosmic-mode .game-card:hover h3{color:#bdcaff}
#works.cosmic-mode .empty-state,#works.cosmic-mode .empty-state strong{color:#e7edff}
@media(prefers-reduced-motion:reduce){#works,#works::before{transition:none!important}#works.cosmic-mode::before{animation:none}}
