/* Readable character card with bounded desktop and mobile footprints. */
#game-shell:has(#world) #player-card{transform:scale(.65);transform-origin:top left}
#game-shell #player-card .player-weight{display:none}
#game-shell #player-card.hud-expanded .player-weight{display:flex;align-items:center;justify-content:space-between;gap:8px;padding-top:9px;margin-top:10px;border-top:1px solid #8f977044;font-size:14px;color:#c4cfb4}
#game-shell #player-card .player-weight strong{font-size:14px;white-space:nowrap;font-variant-numeric:tabular-nums;color:#ead8ac}
#game-shell #player-card .player-weight strong.overweight{color:#f19b82}
#game-shell .chat-panel{border:1px solid #64795d;border-top:2px solid #c3ab78;border-radius:12px;background:linear-gradient(155deg,#20372ef5,#101e19f5);box-shadow:0 10px 32px #0006}
#game-shell .chat-toggle{background:linear-gradient(90deg,#304637,#203329);color:#f1e4c6}
#game-shell .chat-tabs{padding:0 8px;gap:4px}
#game-shell .chat-tabs button{border-radius:6px 6px 0 0}
#game-shell .chat-tabs button[aria-selected=true]{background:#c4ad761a}
#game-shell .chat-scope{color:#b4c2ad}
#game-shell .chat-message{padding:4px 0;border-bottom:1px solid #b9ceb008;line-height:1.7}
#game-shell .chat-form{padding:8px 9px 0;gap:5px}
#game-shell .chat-form input[type=text]{border-radius:7px;background:#0b1a15}
#game-shell .chat-send{border-radius:7px}
#game-shell .chat-latest{left:7px;bottom:5px;transform:none;width:28px;height:28px;min-height:28px;min-width:28px;padding:0;display:grid;place-items:center;font-size:19px;line-height:1;border-radius:7px;color:#f3e5be;background:#2b4538;box-shadow:0 2px 8px #0007}
#game-shell .action-dock>button{position:relative}
#game-shell .shortcut-hint{position:absolute;right:4px;top:3px;padding:0 3px;border:1px solid #87947580;border-radius:3px;color:#cad4b7;background:#101b1880;font:9px/14px monospace;pointer-events:none}
#game-shell #attack-button{padding-top:17px!important}
@media(min-width:761px) and (pointer:fine){
 #game-shell:not(.touch-playing) .action-dock:has(#emote-button){width:min(100%,690px);grid-template-columns:minmax(92px,1fr) 68px 76px 64px minmax(124px,1.15fr) 56px 58px;gap:5px;padding:5px;grid-auto-rows:66px}
 #game-shell:not(.touch-playing) .action-dock :is(.action-slot strong,.attack-button strong){font-size:14px}
 #game-shell:not(.touch-playing) .action-dock :is(.action-slot small,.attack-button small){font-size:10px}
}
@media(max-width:760px){
 #game-shell:not(.touch-playing) .action-dock:has(#emote-button){grid-auto-rows:54px}
 #game-shell .chat-panel{border-radius:10px}
}
@media(pointer:coarse), (any-pointer:coarse){
 #game-shell.touch-playing #emote-button,#game-shell.touch-playing #auto-attack-button{height:46px;min-height:46px}
 #game-shell.touch-playing .shortcut-hint{display:none}
 #game-shell.touch-playing #attack-button .shortcut-hint{display:block;font-size:8px;line-height:11px}
}

@media(max-width:760px){#game-shell:has(#world) #player-card{transform:scale(.6)}}
#game-shell .action-dock{border:1px solid #788765;border-radius:12px;background:linear-gradient(160deg,#26392ef2,#101e18f2);box-shadow:0 6px 22px #0006}
#game-shell .action-dock>button{border-radius:8px;border:1px solid #73816580;transition:background .15s,border-color .15s}
#game-shell .action-dock>button:hover:not(:disabled){background-color:#3b5140;border-color:#cbb880}
#game-shell #quick-medicine-button .shortcut-hint{display:block}

#game-shell:has(#world) #player-card .player-heading h2{font-size:20px;line-height:1.4}
#game-shell:has(#world) #player-card :is(.status-label,.hp-label,.vitals label){font-size:15px}
#game-shell:has(#world) #player-card .vitals strong{font-size:18px}

#game-shell:has(#world) #player-card #player-name{font-size:20px;line-height:1.4}
#game-shell:has(#world) #player-card:not(.hud-expanded) .vitals strong{font-size:18px}

/* Size touch HUD text in screen pixels; scaling the card and later expanding
   its heading font left the name squeezed between the portrait and arrow. */
@media(max-width:760px), (max-width:1100px) and (pointer:coarse){
 #game-shell:has(#world) #player-card,
 #game-shell:has(#world) #player-card.hud-expanded{
  transform:none;width:calc(100% - var(--mobile-map-width,96px) - var(--mobile-edge,8px) - max(8px,env(safe-area-inset-right,0px)) - 8px);
  max-width:256px;padding:8px 10px;
 }
 #game-shell:has(#world) #player-card .player-heading,
 #game-shell:has(#world) #player-card:not(.hud-expanded) .player-heading,
 #game-shell:has(#world) #player-card.hud-expanded .player-heading{
  min-height:0;padding:0 0 6px;gap:8px;align-items:flex-start;
 }
 #game-shell:has(#world) #player-card .player-heading>div:nth-child(2){flex:1;min-width:0;width:auto;}
 #game-shell:has(#world) #player-card .player-tier{max-width:calc(100% - 26px);font-size:9px;letter-spacing:.5px;}
 #game-shell:has(#world) #player-card #player-name{
  width:100%;font-size:14px;line-height:1.5;margin:4px 0 0;white-space:normal;
  overflow:visible;text-overflow:clip;overflow-wrap:anywhere;
 }
 #game-shell:has(#world) #player-card .signal{display:none;}
 #game-shell:has(#world) #player-card.hud-expanded .portrait,
 #game-shell:has(#world) #player-card.hud-expanded .portrait canvas{width:40px;height:48px;}
 #game-shell:has(#world) #player-card .hp-label{font-size:12px;}
 #game-shell:has(#world) #player-card .hp-label strong{font-size:14px;}
 #game-shell:has(#world) #player-card :is(.status-label,.vitals label){font-size:11px;}
 #game-shell:has(#world) #player-card .vitals strong,
 #game-shell:has(#world) #player-card:not(.hud-expanded) .vitals strong{font-size:13px;}
}
