/* JapanMelody V7: 4-way chibi movement, room navigation (additive over V6). */
:root{--v7-gold:#ffe4af;--v7-mint:#a5f6dc}
.player{transition:none!important;top:316px}
.player canvas{image-rendering:auto!important;filter:drop-shadow(0 3px 4px #0b081d99)}
.player.facing-left canvas{transform:none!important}
.player.moving canvas{animation:none!important}
.hall-walk-hint{top:442px}
.hall-floor{background-image:repeating-linear-gradient(90deg,transparent 0 78px,#ffffff11 79px 81px),repeating-linear-gradient(0deg,#4c3d55 0 27px,#5d5066 28px 55px)}
.hud-arrow:hover{background:#755b83}
.room-dock{width:min(870px,calc(100vw - 30px));max-width:calc(100vw - 30px)}
.v7-indoor-wrap{background:#1b192d;border:2px solid #987aa6;border-radius:12px;overflow:hidden;margin:1px 0 13px}
.v7-scene-top{padding:10px 14px;background:linear-gradient(90deg,#704c75,#3a3158);display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:13px;font-weight:900;color:#ffe8bd}
.v7-scene-top small{color:#eee0ee;font-size:11px;font-weight:500}
.v7-indoor-frame{border-top:2px solid #96779e;border-bottom:2px solid #96779e;background:#302c4d;touch-action:manipulation}
.v7-indoor-frame canvas{display:block;width:100%;height:auto;aspect-ratio:760/440;cursor:crosshair;user-select:none}
.v7-room-controls{display:flex;align-items:center;justify-content:space-between;gap:9px;padding:10px 12px;flex-wrap:wrap;background:#29233d}
.v7-dpad{display:flex;align-items:center;gap:5px}
.v7-dpad>div{display:flex;flex-direction:column;gap:3px}
.v7-dpad button{width:44px;height:33px;color:#fff8dd;border:2px solid #a48aac;background:#503e69;border-radius:8px;font-weight:900;touch-action:none;user-select:none}
.v7-dpad button:active{background:#ce84b2}
.v7-room-hint{font-size:11px;line-height:1.6;color:#d1c1dc;padding:0 12px 10px;background:#29233d}
.dock-body{padding:12px}
@media(max-width:780px){.v7-scene-top{font-size:12px;padding:8px}.v7-scene-top small{font-size:10px}.room-dock{width:100%;max-width:100%;border-radius:18px 18px 0 0;bottom:0;right:0;height:min(84vh,780px)}.v7-room-controls{justify-content:center}.v7-room-hint{text-align:center}.hud-arrow{width:38px}.hall-walk-hint{top:395px}}
@media(max-width:480px){.hall-walk-hint{top:386px;left:130px;max-width:200px}.v7-scene-top small{display:none}.room-dock{height:90vh}.v7-dpad button{width:39px;height:30px}}
@media(prefers-reduced-motion:reduce){.player.entering{animation:none!important}}

.room-dock[hidden],.dock-backdrop[hidden],#veil[hidden]{display:none!important}

/* V6.6 keep original V6 paper-doll hop; no 4-direction artwork. */
.player.moving canvas{animation:bobmove .27s ease-in-out infinite alternate!important}
.player canvas{transform:none!important}
.v7-indoor-frame{touch-action:pan-y}
@media(prefers-reduced-motion:reduce){.player.moving canvas{animation:none!important}}

/* V6.7: visible, explicit jump on a moving sprite in hall. */
.player.moving canvas{animation:jm-hall-hop .30s cubic-bezier(.30,.05,.55,.93) infinite alternate!important;will-change:translate}
@keyframes jm-hall-hop{from{translate:0 0}to{translate:0 -14px}}
.admin-settings{border:1px solid #756488;background:#241f3a;border-radius:13px;padding:16px;margin:14px 0}
.admin-settings h4{margin:0 0 12px;color:#ffe4bd;font-size:17px}
.admin-settings .form{margin-bottom:0}
.admin-settings .dock-btnrow{justify-content:flex-start}
@media(prefers-reduced-motion:reduce){.player.moving canvas{animation:none!important}}


/* JapanMelody V6.8.2: visible room chat + temporary avatar speech bubbles */
.room-dock:has(.jm68-room-grid){width:min(1190px,calc(100vw - 24px));max-width:calc(100vw - 24px)}
.jm68-room-grid{display:grid;grid-template-columns:minmax(0,760px) minmax(260px,1fr);align-items:stretch;gap:10px;margin:0 0 12px}
.jm68-room-grid>.v7-indoor-wrap{min-width:0;margin:0}
.jm68-chat{margin:0;min-width:0;display:flex;flex-direction:column;min-height:0;max-height:unset;border:2px solid #d4a3c6;background:#201930;border-radius:12px}
.jm68-chat .chathead{display:flex;align-items:center;justify-content:space-between;gap:5px;background:#443453;color:#ffeac2;padding:10px 10px;font-size:13px}
.jm68-chat-toggle{min-width:34px;min-height:30px;background:#5d4877;border:1px solid #a98da9;color:#fff;border-radius:7px;cursor:pointer}
.jm68-chat .message-list{min-height:160px;max-height:none;height:auto;flex:1;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;padding:10px}
.jm68-chat .compose{display:flex;flex:none;gap:5px;padding:7px;background:#282038}
.jm68-chat .compose .input{font-size:13px;min-width:0;padding:9px 6px}
.jm68-chat .compose .btn{flex:none;padding:8px 10px}
.jm68-chat .msg{font-size:12px}
.jm68-demo-friend{font-size:11px;border:0;border-top:1px solid #6a5678;background:#413451;color:#ffe4c2;padding:6px;cursor:pointer}
.jm68-chat.collapsed{flex:0 0 auto;align-self:start}
.jm68-chat.collapsed .message-list,.jm68-chat.collapsed .compose,.jm68-chat.collapsed .jm68-demo-friend{display:none}
@media(max-width:900px){
 .jm68-room-grid{display:block;position:relative}
 .jm68-room-grid>.v7-indoor-wrap{margin:0}
 .jm68-chat{position:absolute;z-index:4;right:6px;top:43px;width:min(46%,280px);height:min(250px,44vw);min-height:145px;box-shadow:0 7px 20px #060411a8;background:#201930ed}
 .jm68-chat .message-list{min-height:0;padding:6px}
 .jm68-chat .chathead{padding:5px 6px;font-size:11px}
 .jm68-chat .compose{padding:5px;flex-wrap:wrap}
 .jm68-chat .compose .input{font-size:12px;padding:5px;flex-basis:100%}
 .jm68-chat .compose .btn{font-size:11px;padding:4px 8px;margin-left:auto}
 .jm68-chat.collapsed{width:auto;height:auto;min-height:0}
}
@media(max-width:490px){.jm68-chat{top:39px;width:51%;height:190px;min-height:0}.jm68-chat .msg small{font-size:10px}.jm68-chat .msg .bubble{padding:5px;font-size:11px}.room-dock:has(.jm68-room-grid){top:auto;bottom:0;height:93vh}}
