#game-shell .target-card,#game-shell.touch-playing .target-card{top:auto;left:auto;right:24px;bottom:126px;transform:none;width:min(270px,calc(100vw - 32px));height:max-content;padding:15px 16px;border:1px solid #a4a17373;border-radius:14px;background:linear-gradient(145deg,#1b2c25f5,#101b18f5);box-shadow:0 12px 36px #0009;text-align:left;z-index:5}
#game-shell .target-card-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}
#game-shell .target-card-heading small{color:#c6b88d;font-size:10px;letter-spacing:.08em}
#game-shell .target-card h3{margin:8px 0 10px;color:#f0ead9;font-size:16px;line-height:1.35;overflow-wrap:anywhere}
#game-shell .target-card .bar{margin:0 0 5px}
#game-shell .target-card>span{display:block;text-align:right;color:#d3d7c9;font-size:11px}
#game-shell .target-card button{position:static;color:#e4ebdb}
#game-shell .target-card #clear-target{display:grid;place-items:center;flex:none;width:30px;height:30px;border:1px solid #ffffff26;border-radius:8px;background:#ffffff0b;font-size:20px;line-height:1}
#game-shell .target-card-actions{display:flex;gap:8px;margin-top:12px}
#game-shell .target-card-actions:not(:has(button:not(.hidden))){display:none}
#game-shell .target-card-actions button{flex:1;min-width:0;padding:8px 10px;border:1px solid #9ab49165;border-radius:8px;background:#8da67a22;font-size:11px;line-height:1.4}
#game-shell .target-card-actions button:hover,#game-shell .target-card-actions button:focus-visible{background:#a5bb8e38;border-color:#c2ce9d}
/* Monster status sits beside the scene, clear of the player's fighting area. */
@media(min-width:761px){
  #game-shell .target-card.monster-target,#game-shell.touch-playing .target-card.monster-target{top:clamp(275px,42dvh,410px);right:24px;bottom:auto;left:auto;width:210px;padding:9px 11px}
  #game-shell .target-card.monster-target .target-card-heading small{font-size:10px;line-height:1.3;letter-spacing:0}
  #game-shell .target-card.monster-target #clear-target{width:26px;height:26px;font-size:17px}
  #game-shell .target-card.monster-target h3{margin:3px 0 5px;font-size:13px;line-height:1.35}
  #game-shell .target-card.monster-target .bar{height:4px;margin:0 0 3px}
  #game-shell .target-card.monster-target>span{font-size:11px;line-height:1.3}
}
.player-equipment-dialog{width:min(760px,calc(100% - 24px))}
.player-equipment-dialog .stats-body{min-height:0}
.player-equipment-dialog .stats-identity{padding:3px 0 16px;margin:0;border-bottom:1px solid #ffffff19}
.player-equipment-dialog .equipment-intro{margin:15px 0 12px;color:#a9baa9;font-size:12px}
.player-equipment-dialog .stats-columns{gap:10px;grid-template-columns:repeat(2,minmax(0,1fr))}
.player-equipment-dialog .equipment-slot{display:flex;align-items:center;gap:12px;min-width:0;width:100%;min-height:76px;margin:0;padding:10px;border:1px solid #ffffff1d;border-radius:11px;background:#ffffff08;text-align:left;color:#e4ecdd;font:inherit}
.player-equipment-dialog button.equipment-slot{cursor:pointer}
.player-equipment-dialog button.equipment-slot:hover,.player-equipment-dialog button.equipment-slot:focus-visible,.player-equipment-dialog button.equipment-slot[aria-pressed="true"]{border-color:#d0ba81a6;background:#c0b28318}
.player-equipment-dialog .equipment-slot-icon,.player-equipment-dialog .equipment-slot-placeholder{display:grid;place-items:center;flex:none;width:52px;height:52px}
.player-equipment-dialog .equipment-slot-icon .item-image{width:52px;height:52px;object-fit:contain;image-rendering:pixelated}
.player-equipment-dialog .equipment-slot-placeholder{border:1px dashed #ffffff24;border-radius:8px;color:#84988a;font-size:25px}
.player-equipment-dialog .equipment-slot-copy{display:grid;gap:3px;min-width:0;flex:1}
.player-equipment-dialog .equipment-slot-copy small{font-size:11px;color:#b8c9b7}
.player-equipment-dialog .equipment-slot-copy strong{font-size:13px;line-height:1.4;overflow-wrap:anywhere}
.player-equipment-dialog .equipment-slot-copy>span{font-size:11px;color:#9fb19f}
.player-equipment-dialog .equipment-slot-arrow{font-size:24px;color:#cbbb89}
.player-equipment-dialog .equipment-detail{margin:0 0 16px;padding:16px;border:1px solid #c9b47b59;border-radius:12px;background:linear-gradient(145deg,#b4a36d17,#ffffff05)}
.player-equipment-dialog .equipment-detail-heading{display:flex;align-items:center;gap:13px}
.player-equipment-dialog .equipment-detail-heading .item-image{width:64px;height:64px;flex:none;object-fit:contain;image-rendering:pixelated}
.player-equipment-dialog .equipment-detail-heading small{font-size:11px;color:#c8c6a6}
.player-equipment-dialog .equipment-detail h3{margin:4px 0 0;font-size:18px;line-height:1.4}
.player-equipment-dialog .equipment-detail p{margin:10px 0 0;font-size:12px;line-height:1.65;color:#b5c7b7}
.player-equipment-dialog .equipment-effect{display:grid;gap:5px;margin-top:13px;padding-top:12px;border-top:1px solid #ffffff1e}
.player-equipment-dialog .equipment-effect small{font-size:11px;color:#cbbb89}
.player-equipment-dialog .equipment-effect strong{font-size:13px;line-height:1.6;font-weight:500;color:#e5eddb}
.own-equipment{min-width:0;margin:14px 0 20px}
.own-equipment .equipment-intro{margin:0 0 12px;color:#a9baa9;font-size:12px}
.own-equipment .equipment-slots{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
#game-shell .own-equipment .equipment-slot{display:flex;align-items:center;gap:8px;min-width:0;min-height:78px;margin:0;padding:8px;border:1px solid #ffffff1d;border-radius:11px;background:#ffffff08}
#game-shell .own-equipment .equipment-slot:has(.own-equipment-select[aria-pressed="true"]){border-color:#d0ba81a6;background:#c0b28318}
#game-shell .own-equipment .own-equipment-select{display:flex;align-items:center;gap:10px;flex:1;min-width:0;padding:0;border:0;background:none;text-align:left;color:#e4ecdd;cursor:pointer}
#game-shell .own-equipment .own-equipment-select:hover .equipment-slot-copy strong,#game-shell .own-equipment .own-equipment-select:focus-visible .equipment-slot-copy strong{color:#f1d995!important}
#game-shell .own-equipment .equipment-item-image{width:52px;height:52px;flex:0 0 52px;object-fit:contain;image-rendering:pixelated}
#game-shell .own-equipment .equipment-slot-copy{display:grid;gap:3px;min-width:0;flex:1}
#game-shell .own-equipment .equipment-slot-copy small{font-size:11px;color:#b8c9b7}
#game-shell .own-equipment .equipment-slot-copy strong{font-size:13px;line-height:1.4;overflow-wrap:anywhere}
#game-shell .own-equipment .equipment-slot-copy>span{font-size:11px;color:#9fb19f}
#game-shell .own-equipment .equipment-empty{display:grid;place-items:center;flex:0 0 52px;width:52px;height:52px;border:1px dashed #ffffff24;border-radius:8px;color:#84988a;font-size:25px}
#game-shell .own-equipment .own-equipment-remove{flex:none;padding:7px 8px;border:1px solid #ffffff24;border-radius:7px;color:#d9c08f;font-size:11px}
#game-shell .own-equipment .own-equipment-remove:hover{background:#ffffff13}
.own-equipment-detail .equipment-detail{margin:0 0 16px;padding:16px;border:1px solid #c9b47b59;border-radius:12px;background:linear-gradient(145deg,#b4a36d17,#ffffff05)}
.own-equipment-detail .equipment-detail-heading{display:flex;align-items:center;gap:13px}
.own-equipment-detail .equipment-detail-heading .item-image{width:64px;height:64px;flex:none;object-fit:contain;image-rendering:pixelated}
.own-equipment-detail .equipment-detail-heading small{font-size:11px;color:#c8c6a6}
.own-equipment-detail .equipment-detail h3{margin:4px 0 0;font-size:18px;line-height:1.4}
.own-equipment-detail .equipment-detail p{margin:10px 0 0;font-size:12px;line-height:1.65;color:#b5c7b7}
.own-equipment-detail .equipment-effect{display:grid;gap:5px;margin-top:13px;padding-top:12px;border-top:1px solid #ffffff1e}
.own-equipment-detail .equipment-effect small{font-size:11px;color:#cbbb89}
.own-equipment-detail .equipment-effect strong{font-size:13px;line-height:1.6;font-weight:500;color:#e5eddb}
.own-character-equipment{display:grid;grid-template-columns:minmax(0,1fr) minmax(160px,220px);gap:16px;align-items:start}
.own-character-equipment .own-avatar-model{min-width:0}
.own-character-equipment .avatar-preview{display:block;width:min(100%,180px);height:auto;margin:0 auto;border:1px solid #ffffff16;border-radius:10px;background:#12211c;image-rendering:pixelated}
.own-character-equipment .equipment-rotation{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;margin:8px 0}
.own-character-equipment .equipment-rotation button{min-width:0;min-height:28px;padding:4px;font-size:10px;line-height:1.3}
.own-character-equipment .own-gear-panel>h3{margin:2px 0 9px}
.own-character-equipment .own-equipment{margin:0}
.own-character-equipment .own-equipment .equipment-slots{grid-template-columns:1fr;gap:6px}
.character-fashion-fold{margin:12px 0;border:1px solid #526848;border-radius:7px;background:#102119}
.character-fashion-layout{min-width:0}
.character-fashion-fold>summary{padding:12px 14px;cursor:pointer;color:#e5d8ae;font-size:14px;font-weight:600}
.character-fashion-fold>summary small{float:right;color:#aac0a5;font-size:11px;font-weight:400}
.character-fashion-fold[open]>summary{border-bottom:1px solid #526848}
.character-fashion-fold .own-character-equipment,.character-fashion-fold>.service-note{margin:12px}
.fashion-wardrobe{padding:12px}
.fashion-wardrobe>h3,.fashion-shop>h3{margin:0 0 6px;color:#e5d8ae}
.fashion-wardrobe-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-top:12px}
.fashion-card{display:flex;align-items:center;gap:9px;min-width:0;padding:9px;border:1px solid #526848;border-radius:7px;background:#172b22}
.fashion-card .fashion-image{width:48px;height:48px;flex:none;object-fit:contain;image-rendering:pixelated}
.fashion-card>div{display:grid;gap:2px;min-width:0;flex:1}
.fashion-card small,.fashion-card span{color:#aac0a5;font-size:10px}
.fashion-card strong{font-size:12px;color:#e7ddbb}
.fashion-card button,.fashion-remove{padding:8px;border:1px solid #8a986a;border-radius:4px;background:#344934;color:#e3d09b;font-size:11px;cursor:pointer}
.fashion-card button:disabled{opacity:.65;cursor:default}
.fashion-remove{margin:10px 8px 0 0}
.fashion-shop{margin-top:20px}
.fashion-shop-row>div{display:grid;grid-template-columns:64px minmax(0,1fr);column-gap:10px;align-items:center;min-width:0}
.fashion-shop-row .item-image{grid-row:1/3;width:60px;height:60px;object-fit:contain;image-rendering:pixelated}
.fashion-shop-row h3,.fashion-shop-row p{grid-column:2}
@media(min-width:1000px){.character-fashion-layout{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);align-items:start;gap:14px}.character-fashion-fold{min-width:0}.character-fashion-layout .fashion-wardrobe-grid{grid-template-columns:1fr}.character-fashion-layout .own-character-equipment{grid-template-columns:minmax(0,1fr) minmax(150px,180px);gap:10px}.character-fashion-layout .own-character-equipment .equipment-rotation{grid-template-columns:repeat(2,minmax(0,1fr))}}
#game-shell .equipment-preview .own-equipment .equipment-slots{grid-template-columns:1fr;gap:6px}
#game-shell .equipment-preview .equipment-model canvas{width:min(100%,190px)}
#game-shell .own-equipment .equipment-slot{min-height:64px}
#game-shell .own-equipment .equipment-item-image,#game-shell .own-equipment .equipment-empty{width:44px;height:44px;flex-basis:44px}
#game-shell .own-equipment .equipment-slot-copy strong{font-size:12px}
.own-equipment-detail .equipment-detail{padding:12px}
.own-equipment-detail .equipment-detail-heading .item-image{width:48px;height:48px}
.own-equipment-detail .equipment-detail h3{font-size:15px}
.own-equipment-detail .equipment-detail p{margin-top:7px;font-size:11px}
.own-equipment-detail .equipment-effect{margin-top:9px;padding-top:8px}
.own-equipment-detail .equipment-effect strong{font-size:12px}
.own-equipment-detail:not(:empty){margin-bottom:10px;padding:8px 10px;border-left:3px solid #baaa78;background:#0e1d19}
.own-equipment-detail .own-detail-label{display:block;margin-bottom:4px;color:#cbbb89;font-size:10px;letter-spacing:.03em}
.own-equipment-detail .equipment-detail{margin:0;padding:0;border:0;border-radius:0;background:none;outline:none}
.own-equipment-detail .equipment-detail-heading{gap:0}
.own-equipment-detail .equipment-detail-heading .item-image{display:none}
.own-equipment-detail .equipment-detail-heading small{font-size:10px}
.own-equipment-detail .equipment-detail h3{margin:1px 0 0;font-size:12px}
.own-equipment-detail .equipment-detail p{margin:4px 0 0;font-size:10px;line-height:1.45}
.own-equipment-detail .equipment-effect{display:flex;gap:7px;align-items:baseline;flex-wrap:wrap;margin-top:5px;padding-top:5px}
.own-equipment-detail .equipment-effect small,.own-equipment-detail .equipment-effect strong{font-size:10px}
.own-equipment-detail .equipment-extra{margin-top:5px;color:#a9baa9;font-size:10px}
.own-equipment-detail .equipment-extra summary{cursor:pointer;color:#cbbb89}
@media(max-width:760px){#game-shell .target-card,#game-shell.touch-playing .target-card{top:238px;right:12px;left:auto;bottom:auto;transform:none;width:min(190px,calc(100vw - 24px));padding:11px 12px}#game-shell .target-card h3{font-size:13px}#game-shell .target-card-actions{flex-wrap:wrap;margin-top:9px}#game-shell .target-card-actions button{font-size:10px;padding:7px}.player-equipment-dialog .stats-columns{grid-template-columns:1fr}.player-equipment-dialog .equipment-slot{min-height:68px}}
@media(max-width:600px){.own-equipment .equipment-slots{grid-template-columns:1fr}}
@media(max-width:600px){.own-character-equipment{grid-template-columns:1fr;gap:8px}.own-character-equipment .own-avatar-model{grid-row:1}.own-character-equipment .avatar-preview{width:135px}.own-character-equipment .equipment-rotation{grid-template-columns:repeat(4,minmax(0,1fr))}.own-character-equipment .equipment-rotation button{font-size:9px}.own-character-equipment .own-gear-panel>h3{margin:6px 0 9px}.fashion-wardrobe-grid{grid-template-columns:1fr}}
@media(max-height:610px) and (max-width:760px){#game-shell .target-card,#game-shell.touch-playing .target-card{top:190px;max-height:calc(100dvh - 420px);overflow:auto}}

/* Keep monster health visible without covering the middle of a phone screen. */
@media(max-width:760px), (max-width:1100px) and (max-height:500px) and (pointer:coarse){
  #game-shell .target-card.monster-target,
  #game-shell.touch-playing .target-card.monster-target{
    top:calc(var(--mobile-hud-top,72px) + 76px);
    right:max(8px,env(safe-area-inset-right,0px));
    left:auto;
    bottom:auto;
    width:clamp(120px,37vw,148px);
    height:max-content;
    max-height:none;
    padding:5px 7px;
    overflow:visible;
    border-radius:8px;
  }
  #game-shell .target-card.monster-target .target-card-heading small{font-size:9px;line-height:1.2;letter-spacing:0}
  #game-shell .target-card.monster-target #clear-target{width:25px;height:25px;font-size:17px}
  #game-shell .target-card.monster-target h3{margin:2px 0 4px;font-size:11px;line-height:1.25;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
  #game-shell .target-card.monster-target .bar{height:4px;margin:0 0 2px}
  #game-shell .target-card.monster-target>span{font-size:10px;line-height:1.2}
}

/* Bag equipment: fixed front portrait and two columns of equipment cards. */
#game-shell .bag-gear .equipment-preview{grid-template-columns:minmax(150px,190px) minmax(0,1fr);gap:18px;align-items:start}
#game-shell .bag-gear .equipment-preview .own-equipment .equipment-slots{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
#game-shell .bag-gear .equipment-model{width:100%;max-width:190px}
#game-shell .bag-gear .own-equipment{min-width:0}
@media(max-width:1000px){
 #game-shell .bag-gear .equipment-preview{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:600px){
 #game-shell .bag-gear .own-equipment .equipment-slot{flex-wrap:wrap;gap:6px;padding:8px}
 #game-shell .bag-gear .own-equipment .own-equipment-select{flex-direction:column;align-items:flex-start;width:100%;gap:6px}
 #game-shell .bag-gear .own-equipment .equipment-slot-copy{width:100%}
 #game-shell .bag-gear .own-equipment .own-equipment-remove{margin-left:auto}
}

.player-equipment-dialog{width:min(1200px,calc(100% - 24px))}
/* Matched portrait and equipment panels with independent desktop gear scrolling. */
.equipment-player-layout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;align-items:stretch;height:clamp(350px,calc(100dvh - 240px),620px)}
.equipment-player-stage,.equipment-player-gear{border:1px solid #c9b47b59;border-radius:14px;background:radial-gradient(ellipse at center,#29463866,#0b1c1466);padding:18px;min-width:0;min-height:0;box-sizing:border-box}
.equipment-player-stage{display:flex;flex-direction:column;justify-content:center;align-items:center}
.equipment-player-stage canvas{display:block;width:100%;max-height:100%;object-fit:contain;min-height:0;image-rendering:pixelated}
.equipment-player-stage p{font-size:12px;text-align:center;color:#b5c7b7;margin:8px 0;overflow-wrap:anywhere}
.equipment-player-stage p:empty{display:none}
.equipment-player-gear{overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable}
@media(max-width:760px){.equipment-player-layout{grid-template-columns:minmax(0,1fr);gap:16px;height:auto}.equipment-player-stage,.equipment-player-gear{padding:14px}.equipment-player-stage canvas{max-width:320px;margin:auto}.equipment-player-gear{overflow:visible;scrollbar-gutter:auto}}
