/* Box-memory game. Colours for boxes and bubbles are measured from the reference app; art is original shapes.
   Box size, play-area size and box positions are set from JS (box-hide-core geometry). */
.full { position: relative; height: 100%; overflow: hidden; }

/* The shell draws the top bar over the whole screen; the play area keeps the old full-screen coordinates by resolving against the game root, not the body below the bar. */
.gk-game:has(.bh-game) .gk-body { position: static; }
.gk-game:has(.bh-game)::before, .gk-game:has(.bh-game)::after { display: none; }
.bh-game { position: absolute; inset: 0; z-index: 1; background: linear-gradient(#d3e8f6, #dbe3ea 40%, #c9d3dc); }
.bh-level { position: absolute; top: 64px; left: 16px; padding: 4px 12px; border: 2px solid #8fb4bd; border-radius: 14px; color: #8fa8ae; font-size: 14px; z-index: 3; }
.bh-stamps { position: absolute; top: 62px; right: 16px; display: flex; gap: 6px; z-index: 3; }
.bh-stamp { width: 36px; height: 36px; border-radius: 50%; border: 3px solid #fff; background: #fff; display: grid; place-items: center; font-size: 16px; transition: background .2s; }
.bh-stamp[hidden] { display: none; }
.bh-stamp[data-state="ok"] { background: #7bcb94; }
.bh-stamp[data-state="ng"] { background: #e0706c; }
.bh-msg { position: absolute; top: 98px; left: 0; right: 0; margin: 0 auto; width: 240px; text-align: center; font-weight: 700; font-size: 15px; z-index: 2; }
.bh-msg[hidden] { display: none; }

.bh-area { position: absolute; background: #ffffff80; transition: opacity .1s; }
.bh-box { position: absolute; background: #c8a77c; border-radius: 2px; box-shadow: inset 20px 0 0 #917049; touch-action: manipulation; cursor: pointer; }
.bh-box[hidden] { display: none; }
.bh-box.ghost { opacity: .5; }
button.bh-box { border: 0; padding: 0; font: inherit; -webkit-tap-highlight-color: transparent; }
.bh-play-box::after { content: ""; position: absolute; left: -3px; right: -3px; top: 50%; height: 44px; transform: translateY(-50%); } /* hit area at least 44px high (the touch minimum) whatever the screen size, without changing the art */
.bh-pal { position: absolute; left: 50%; bottom: 60%; width: 22px; height: 22px; margin-left: -11px; border-radius: 50%; background: #f5c542; opacity: 0; transform: translateY(14px); transition: opacity .3s, transform .3s; }
.bh-pal::before { content: ""; position: absolute; left: 5px; top: 8px; width: 3px; height: 3px; border-radius: 50%; background: #333; box-shadow: 9px 0 0 #333; }
.bh-pal::after { content: ""; position: absolute; left: 9px; top: 13px; width: 5px; height: 3px; border-radius: 0 0 4px 4px; background: #e8833a; }
.bh-box.has-pal .bh-pal { opacity: 1; transform: none; }

.bh-peek { position: absolute; top: 118px; left: 50%; width: 120px; height: 56px; margin-left: -60px; background: #917049; border-radius: 3px; opacity: 0; transition: opacity .2s; z-index: 2; }
.bh-peek.on { opacity: 1; }
.bh-peek .bh-box { left: 0; top: 100%; width: 120px; height: 20px; }
.bh-peek .bh-pal { opacity: 1; transform: none; bottom: 100%; width: 34px; height: 34px; margin-left: -17px; }
.bh-peek .bh-pal:not(:first-child) { display: none; }
.bh-peek.many .bh-pal { display: block; }
.bh-peek.many .bh-pal:nth-child(2) { margin-left: -44px; }
.bh-peek.many .bh-pal:nth-child(3) { margin-left: 10px; }
.bh-peek.many .bh-pal:nth-child(4) { margin-left: 36px; }

.bh-bubble { position: absolute; left: 50%; top: 60%; z-index: 2; transform: translateX(-50%); padding: 12px 22px; border: 3px solid #fff; border-radius: 28px; color: #fff; font-weight: 800; opacity: 0; transition: opacity .2s; white-space: nowrap; }
.bh-bubble.on { opacity: 1; }
.bh-bubble.good { background: #60cd92; }
.bh-bubble.retry { background: #ed6969; }
.bh-bubble, .bh-peek, .bh-msg, .bh-stamps, .bh-level { pointer-events: none; } /* decorations must never swallow a box tap */

.bh-modal-art { position: relative; flex: 1; width: 100%; }
.bh-modal-art .bh-box { position: relative; display: inline-block; width: 58px; height: 34px; margin: 14px; }

