#gameDialogText { --c:#7BD838; }

* { box-sizing:border-box; margin:0; padding:0; }
@font-face { font-family:'Renogare'; src:url('../celeste-font-en/Renogare-Regular.otf') format('opentype'); font-display:swap; }
@font-face { font-family:'CelesteZH'; src:url('../fonts/NotoSansCJKsc-Medium.otf') format('opentype'); font-display:swap; }
body { min-height:100vh; background:#07040e; image-rendering:pixelated; font-family:'Renogare','CelesteZH','Microsoft YaHei',sans-serif; overflow-x:hidden; }
.topbar { position:fixed; top:14px; left:16px; z-index:20; }
.topbar a { display:inline-block; padding:8px 14px; background:rgba(22,34,60,.88); color:#ffe36d; border:2px solid #ffe36d; border-radius:6px; text-decoration:none; font-size:13px; box-shadow:0 0 10px rgba(255,230,109,.35); }
/* 冰山返回主页按钮（同 diary 的 #homePosterBtn） */
#homePosterBtn {
    position:fixed; top:16px; left:16px; z-index:900;
    width:96px; height:96px; padding:0; border:none; background:transparent; cursor:pointer;
    transition:transform .2s, filter .2s;
}
#homePosterBtn img { width:100%; height:100%; object-fit:contain; display:block; }
#homePosterBtn:hover {
    transform:translateY(-2px) scale(1.05);
    filter:
        drop-shadow(1px 0 0 #10101c) drop-shadow(-1px 0 0 #10101c)
        drop-shadow(0 1px 0 #10101c) drop-shadow(0 -1px 0 #10101c)
        drop-shadow(0 0 10px rgba(200,235,255,1)) drop-shadow(0 0 24px rgba(120,190,255,.8));
}
h1 { position:fixed; top:14px; left:50%; transform:translateX(-50%); font-family:'Press Start 2P',monospace; font-size:14px; color:#ffe36d; text-shadow:0 2px 0 rgba(0,0,0,.6); letter-spacing:2px; z-index:20; }
#shopMemo { position:fixed; inset:0; z-index:999; background:rgba(4,4,16,.96); display:flex; align-items:center; justify-content:center; flex-direction:column; cursor:pointer; opacity:0; pointer-events:none; transition:opacity .6s ease; }
#shopMemo.show { opacity:1; pointer-events:auto; }
#shopMemo img { max-width:min(92vw,560px); max-height:72vh; border-radius:6px; box-shadow:0 10px 50px rgba(0,0,0,.7); transform:scale(.94); transition:transform .8s cubic-bezier(.2,.8,.3,1); }
#shopMemo.show img { transform:scale(1); }
#shopMemo .memo-card {
    position:relative; max-width:min(92vw,560px); max-height:72vh;
    border-radius:6px; overflow:hidden; box-shadow:0 10px 50px rgba(0,0,0,.7);
    transform:scale(.94); transition:transform .8s cubic-bezier(.2,.8,.3,1);
}
#shopMemo.show .memo-card { transform:scale(1); }
#shopMemo .memo-card img { width:100%; height:100%; display:block; box-shadow:none; border-radius:0; }
#shopMemo .memo-text {
    position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center;
    padding:10% 12%; text-align:center; color:#1a1a1a;
    font-family:'Renogare','CelesteZH',sans-serif; line-height:1.9;
    text-shadow:0 1px 1px rgba(255,255,255,.3);
}
#shopMemo .memo-text .m-line1 { font-size:clamp(14px,2.2vmin,20px); letter-spacing:.08em; }
#shopMemo .memo-text .m-line2 { font-size:clamp(13px,1.8vmin,17px); letter-spacing:.04em; opacity:.92; }
#shopMemo .memo-text .m-line3 { font-size:clamp(13px,1.8vmin,17px); letter-spacing:.04em; opacity:.92; }
#shopMemo .memo-text .m-sign { font-size:clamp(12px,1.6vmin,15px); margin-top:14px; opacity:.82; letter-spacing:.06em; }
#shopMemo .memo-tip { position:absolute; bottom:26px; left:50%; transform:translateX(-50%); color:rgba(255,230,109,.6); font-size:12px; letter-spacing:2px; }

/* ===== Oshiro 对话框（遮罩 fill 铺满） ===== */
#gameDialog {
    position: fixed;
    left: 50%;
    bottom: 66px;
    transform: translateX(-50%) translateY(24px);
    width: min(94vw, 900px);
    min-height: 128px;
    z-index: 950;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 20px 30px;
    background: url('../Atlases/Portraits/textbox/oshiro.png') center / 100% 100% no-repeat;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
#gameDialog.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
#gameDialogOverlay { position:absolute; left:0; top:0; width:100%; height:100%; object-fit:fill; pointer-events:none; z-index:1; }
#gameDialogPortrait { width:92px; height:92px; flex-shrink:0; border-radius:6px; overflow:hidden; z-index:2; }
#gameDialogPortrait img { width:100%; height:100%; object-fit:cover; display:block; }
#gameDialogBody { flex:1; min-width:0; z-index:2; }
#gameDialogName { font-family:'Press Start 2P',monospace; color:#ffe36d; font-size:13px; margin-bottom:5px; }
#gameDialogText { font-family:'Renogare','CelesteZH','Microsoft YaHei',sans-serif; color:#fff; font-size:14px; line-height:1.7; word-break:break-word; }

/* ===== 大厅场景层：运行时绘制的 lvl_0x-a（320×184 原生像素，cover 缩放） ===== */
#sceneZoom { position:fixed; inset:0; z-index:1; overflow:hidden; pointer-events:none; will-change:transform; }
#hallCanvas { position:absolute; left:0; top:0; image-rendering:pixelated; pointer-events:none; }
#gameStage { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; image-rendering:pixelated; z-index:2; }
/* ===== 光照 RT / Bloom（对齐 Celeste.LightingRenderer + BloomRenderer）=====
   hallLight：320×184 黑底，按 Lighting.Alpha（area_3 DarknessAlpha=0.15）整屏压暗，灯位用 destination-out 挖亮；
   hallBloom：BloomBase=0 / Strength=1，bloomgradient 以 mix-blend-mode:screen 叠加（灯笼 BloomPoint 半径 8、Oshiro 聚光 16）。
   z-index:5 覆盖 hallCanvas/gameStage 与 Oshiro，灯笼(6)/introFx(7) 在其上；必须覆盖 body 继承的 pixelated。 */
#hallLight, #hallBloom {
    position:absolute; left:0; top:0; z-index:5; pointer-events:none;
    image-rendering:auto;
}
#hallBloom { mix-blend-mode:screen; }
#introFx { position:absolute; inset:0; width:100%; height:100%; z-index:7; pointer-events:none; }
/* 开场跳过层 */
#introSkip {
    position:fixed; inset:0; z-index:960; display:none;
    align-items:flex-end; justify-content:center; padding-bottom:34px;
    cursor:pointer; background:transparent;
}
#introSkip span { color:rgba(255,230,109,.62); font-size:12px; letter-spacing:3px; animation:skipPulse 1.8s ease-in-out infinite; }
@keyframes skipPulse { 0%,100% { opacity:.42; } 50% { opacity:.9; } }
/* 重播登场按钮已移除：登场只由前台服务铃触发 */
body.intro .dot-bubble { opacity:0; pointer-events:none; }
body.intro #sceneZoom #gameStage { opacity:0; }

/* ===== resortLantern（REA：VertexLight/Bloom Alpha=0.95+Sin(t)*0.05 呼吸；Wiggler(2.5,1.2,StartZero) → Rotation=value*mult*30°） ===== */
.resort-lantern {
    position:absolute; z-index:6; pointer-events:auto; cursor:pointer;
}
.lantern-holder, .lantern-body {
    position:absolute; left:0; top:0; width:100%; height:100%;
    image-rendering:pixelated; pointer-events:none;
    user-select:none; -webkit-user-drag:none;
}
/* 灯体绕挂点（holder 挂环）倾摆，holder 固定 —— 对齐原版只旋转 lantern Sprite 而 holder 不动 */
.lantern-body { transform-origin:50% 30%; will-change:transform; }
/* 灯笼辉光：DOM 径向渐变承载柔光（BloomPoint(0.8, 8) 直接贴 bloomgradient 在 16px 直径下
   核心不透明 → 退化成硬边白球；真实 BloomRenderer 是整张光 RT 高斯模糊后才出光），
   明暗由 JS 按 0.95+Sin(t)*0.05 呼吸并与 nonSpotlightAlphaMultiplier 相乘 */
.lantern-glow {
    position:absolute; left:50%; top:56%; width:320%; height:260%;
    transform:translate(-50%,-50%); pointer-events:none;
    background:radial-gradient(ellipse at center,
        rgba(255,226,150,.42) 0%,
        rgba(255,196,96,.16) 38%,
        rgba(255,170,70,0) 72%);
}

/* ===== 像素 Oshiro（atlas 96×96 帧；缩放/锚点在 shop.js 中按 cover 比例设置） ===== */
#pixelOshiro {
    position:absolute;
    top: 0;
    left: 0;
    width: 96px;
    height: 96px;
    object-fit: contain;
    object-position: center bottom;
    image-rendering: pixelated;
    z-index: 5;
    pointer-events: auto;
    cursor: pointer;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,.5));
    user-select: none;
    -webkit-user-drag: none;
}

/* ===== Oshiro 聊天历史框（双击打开） ===== */
#oshiroChatDialog {
    position: fixed;
    right: 12px;
    bottom: 12px;
    width: 380px;
    max-width: 92vw;
    height: 480px;
    z-index: 955;
    background: url('../celeste-gui/card_golden.webp') top / 100% 123% no-repeat;
    border: none;
    border-radius: 0;
    display: none;
    flex-direction: column;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    overflow: hidden;
}
#oshiroChatDialog.show { display: flex; }
#oshiroChatDialog .chat-header {
    display:flex; align-items:center; gap:10px;
    padding:14px 16px 8px 42px;
    border-bottom:none;
    background:url('../celeste-gui/cardtop_golden.webp') center / 100% 100% no-repeat;
    flex-shrink:0;
}
#oshiroChatDialog .chat-header img { width:36px; height:36px; object-fit:cover; border-radius:6px; }
#oshiroChatDialog .chat-title { flex:1; color:#2b2018; font-family:'Renogare','CelesteZH','Microsoft YaHei',sans-serif; font-size:18px; letter-spacing:1px; }
#oshiroChatDialog .close-btn { background:none; border:none; color:rgba(43,32,24,.55); font-size:16px; cursor:pointer; }
#oshiroChatDialog .close-btn:hover { color:#2b2018; }
#oshiroChatMessages { flex:1; overflow-y:auto; padding:14px 16px 10px 42px; display:flex; flex-direction:column; gap:10px; min-height:0; }
.och-msg { max-width:85%; padding:8px 12px; border-radius:10px; font-size:13px; line-height:1.6; word-break:break-word; font-family:'Renogare','CelesteZH','Microsoft YaHei',sans-serif; }
.och-msg.user { align-self:flex-end; background:rgba(74,144,226,.14); color:#2b3a52; border:1px solid rgba(74,144,226,.4); }
.och-msg.assistant { align-self:flex-start; background:transparent; border:none; padding:4px 6px; color:#3a2e2a; }
#oshiroChatDialog .chat-input { display:flex; gap:8px; padding:8px 12px 6px 12px; border-top:1px dashed rgba(58,46,42,.35); flex-shrink:0; }
#oshiroChatDialog .chat-input input { flex:1; padding:8px 10px; border:1px solid rgba(125,207,255,.5); border-radius:6px; background:rgba(125,207,255,.18); color:#2b3a52; font-size:13px; outline:none; font-family:'Renogare','CelesteZH','Microsoft YaHei',sans-serif; }
#oshiroChatDialog .chat-input input:focus { border-color:#7DCFFF; background:rgba(125,207,255,.3); }
#oshiroChatDialog .chat-input input::placeholder { color:rgba(43,58,82,.45); }
#oshiroChatDialog .chat-input button { padding:8px 14px; border:none; border-radius:6px; background:#FFEB3B; color:#111; cursor:pointer; font-size:14px; letter-spacing:1px; font-family:'Renogare','CelesteZH',sans-serif; box-shadow:inset 0 -2px #111111; }
#oshiroChatDialog .chat-input button:hover { background:#ffeb85; }

/* ===== 水晶之心收集仪式：Poem —— IL: Poem 无背景（画出的是透明层），
   Alpha 1s Ease.CubeOut 淡入 / 0.5s Ease.CubeIn 淡出；FormationBackdrop 黑幕另起 z-index 1900 层 ===== */
#heartGet {
    position:fixed; inset:0; z-index:2000; display:none;
    align-items:center; justify-content:center; flex-direction:column;
    background:transparent;
    opacity:0; cursor:pointer; overflow:hidden;
}
#heartGet.show { display:flex; pointer-events:auto; }
#heartGet #hgFx {
    position:absolute; inset:0; width:100%; height:100%;
    z-index:0; pointer-events:none;
}
#heartGet .hg-poem-tip {
    position:absolute; bottom:30px; left:50%; transform:translateX(-50%);
    color:rgba(255,230,109,.55); font-size:12px; letter-spacing:3px;
}

/* ===== 悬停提示按钮：idle 指针呼吸，hover 切换图示（右=highlight 左=resort 挂牌） ===== */
.dot-bubble {
    position:fixed; z-index:940; padding:0; border:none; background:transparent;
    cursor:pointer; user-select:none; -webkit-user-drag:none;
}
.dot-bubble .dot-layer {
    position:absolute; display:block; pointer-events:none;
}
.dot-bubble .dot-hover { opacity:0; transition:opacity .15s ease; }
.dot-bubble:hover .dot-idle { opacity:0; }
.dot-bubble:hover .dot-hover { opacity:1; }
/* idle 黑色指针在深墙上加白色光晕，呼吸 = 缩放 + 光晕起伏，锚点为三个黑点(49.6%,71.5%) */
.dot-bubble .dot-idle {
    transform-origin:49.6% 71.5%;
    animation:dotBreathe 2.2s ease-in-out infinite;
    will-change:transform,filter;
}
@keyframes dotBreathe {
    0%,100% { transform:scale(1);     filter:drop-shadow(0 0 1px rgba(255,255,255,.65)); }
    50%     { transform:scale(1.13);  filter:drop-shadow(0 0 4px rgba(255,255,255,.95)); }
}
#dotRight .dot-idle { animation-duration:2.7s; }
