/* Layout and motion adapters only; typography and colors come from Words. */
.standalone{margin:0;}
.wb,.wb *,.wb *::before,.wb *::after{box-sizing:border-box;}
.wb .wb-fight > .wb-tray {width:100%;min-height:42px;margin:0 0 5px;flex:none;}
.wb .wb-tray .wb-tile {flex:none;}
.wb-tile-flight {position:fixed!important;z-index:10000!important;pointer-events:none!important;margin:0!important;}
@media(max-width:640px) and (orientation:portrait){
  body.words-mobile-active .game-site-header{display:none;}
  body.words-mobile-active main,body.words-mobile-active .games{margin:0;padding:0;width:100%;max-width:none;}
  body.words-mobile-active .game-panel{margin:0;padding:0;}
  .standalone.standalone-words .wb{height:100dvh;}
  .wb .wb-board{grid-template-rows:20px 24px minmax(0,1fr) 44px;}
  .wb .wb-fight > .wb-tray{height:40px;min-height:40px;order:-1;padding:3px;box-sizing:border-box;width:var(--sw);}
  .wb .wb-fight > .wb-tray .wb-tile{--w:min(2.2rem,(100cqw - (var(--n) - 1)*.3rem)/var(--n));}
  .wb .wb-scene{order:0;}
}
.wb.desk .wb-fight > .wb-tray {width:calc(var(--wt)*9 + 2.4rem);min-height:0;margin-top:1rem;}

/* Panels must include their padding and carved borders in their half-column
   widths. The lab shell deliberately does not load the site's global reset. */
.wb.desk :is(.wb-lore,#wb-tactics,.wb-relic-panel){min-width:0;overflow-x:hidden;}
.wb.desk :is(.wb-lore,#wb-tactics){width:calc(50% - .45rem);}
.wb.desk :is(.wb-lore summary,#wb-tactics > summary){
  min-height:3.5em;line-height:1.4;overflow-wrap:anywhere;
}
.wb.desk .wb-relic-panel{width:100%;overflow-y:auto;}
.wb .wb-relics{margin:0;padding:10px 4px 12px;}
.wb .wb-socket{padding:0 6px 8px;gap:16px;}
.wb .wb-socket > div{width:100%;}
.wb .wb-socket-name{overflow:visible;white-space:normal;}
.wb.desk .wb-socket-n{max-width:calc(100% - 16px);flex:none;}

/* Only lettering over the artwork changes: no new surfaces or site theme.
   A dark keyline keeps gold readable on both bright and dark scene details. */
.wb{
  --battle-gold:#ffe28a;
  --battle-text-shadow:-1px 0 0 #100b05,1px 0 0 #100b05,0 -1px 0 #100b05,0 1px 0 #100b05,0 2px 2px #000,0 0 4px #000;
}
.wb .wb-scene .wb-who,
.wb .wb-scene .wb-who .wb-name,
.wb .wb-scene .wb-who .wb-hearts,
.wb .wb-scene .wb-status li,
.wb .wb-scene .wb-float{
  color:var(--battle-gold);opacity:1;text-shadow:var(--battle-text-shadow);
}
.wb.desk .wb-who.low .wb-hearts{color:var(--battle-gold);}
.wb.desk .wb-meter{filter:drop-shadow(0 1px 1px #000) drop-shadow(0 0 1px #000);}
.wb.desk .wb-scene .wb-meter{grid-template-columns:repeat(10,16px);}
.wb.desk .wb-scene .wb-health-pip{
  width:16px;height:14px;
  background:linear-gradient(to right,#ff5757 0 var(--fill),#482626 var(--fill) 100%);
}
.wb.desk .wb-verdict{
  background:none;color:var(--battle-gold);text-shadow:var(--battle-text-shadow);
  border:0;border-radius:0;padding:5px 8px;
  height:auto;min-height:28px;max-height:80px;line-height:1.35;
  white-space:normal;overflow-wrap:anywhere;flex-wrap:wrap;
}
.wb.desk .wb-verdict :is(.grade,.dmg,.fx,.wb-preview-compact){color:var(--battle-gold);opacity:1;text-shadow:var(--battle-text-shadow);}
.wb.desk .wb-verdict:empty{padding:0;min-height:0;border:0;background:none;}

/* Tap a selected tray letter to return it. Keep keyboard editing, but give
   every layout just a square shuffle action and the larger primary attack. */
.wb .wb-actions #wb-scramble{
  display:grid;place-items:center;flex:0 0 44px;
  width:44px;height:44px;min-width:44px;min-height:44px;
  padding:9px;font-size:0;line-height:0;border-radius:0;
}
.wb #wb-scramble::before{
  content:"";display:block;width:24px;height:24px;background:currentColor;
  mask:center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7h3c4 0 8 10 12 10h3M18 14l3 3-3 3M3 17h3c1.5 0 3-1.5 4-3M14 10c1.5-2 2.5-3 4-3h3M18 4l3 3-3 3'/%3E%3C/svg%3E");
}
.wb .wb-actions #wb-attack{
  flex:1;min-height:44px;background:#78ed4c;color:#101707;
  border:2px solid #397425;border-radius:0;
  font-size:1.15rem;font-weight:600;letter-spacing:1px;
}
.wb .wb-actions #wb-attack:disabled{opacity:1;background:#9bc886;color:#31502a;border-color:#6a8e60;}
.wb .wb-actions #wb-attack:not(:disabled):hover{background:#91ff65;}
.wb .wb-actions #wb-attack:not(:disabled):active{background:#65d93e;}
/* One compact, labelled toggle in the top-right, never in the relic toolbar.
   The original audio module still owns its aria-label and pressed state. */
.wb #wb-audio-mute{
  display:grid;place-items:center;box-sizing:border-box;
  width:40px;height:40px;min-width:40px;min-height:40px;
  padding:8px;font-size:0;line-height:0;flex:none;cursor:pointer;
}
.wb #wb-audio-mute::before{
  content:"";display:block;width:22px;height:22px;background:currentColor;
  mask:center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4zM15 8a6 6 0 0 1 0 8M18 5a10 10 0 0 1 0 14'/%3E%3C/svg%3E");
}
.wb #wb-audio-mute[aria-pressed="true"]::before{
  mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4zM16 9l5 6M21 9l-5 6'/%3E%3C/svg%3E");
}
.wb #wb-audio-mute:focus-visible{outline:2px solid var(--accent);outline-offset:3px;}
.wb > #wb-audio-mute{position:fixed;top:max(16px,env(safe-area-inset-top));right:max(20px,env(safe-area-inset-right));z-index:30;}
.wb .wb-mobile-header #wb-audio-mute{margin-left:auto;}
@media(min-width:641px),(orientation:landscape){
  .standalone .game-site-header{padding-right:calc(max(20px,env(safe-area-inset-right)) + 56px);}
}
