/* ============================================================
   The Last Obelisk

   There is almost nothing here. The status bars, satchel, map,
   message box, menus and title screen are all painted into the
   pixel buffer by script.js using the game's own bitmap font,
   so this file only has to place the frame and the touch pad. Audio controls are
   handled entirely by the canvas UI; there is no separate speaker/mute button here.
   ============================================================ */

:root{ --z:2; --u:calc(var(--z) * 1px); }

*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;height:100%;overflow:hidden;background:#000;color:#f4f4ec}
body{display:grid;place-items:center;-webkit-user-select:none;user-select:none;touch-action:none}

/* the frame: exactly 800 x 600, centred, scaled down only if the window is smaller.
   Pinned by its middle rather than laid out by the grid: a grid cannot centre
   something wider than the window, so on a phone the frame used to start at
   the left edge and then shrink towards its own middle, half off the screen. */
#stage{
  position:absolute;
  left:50%;top:50%;
  margin:-300px 0 0 -400px;
  width:800px;height:600px;
  overflow:hidden;
  background:#07060b;
  transform-origin:center center;
  box-shadow:0 0 0 2px #17151f;
}

canvas{image-rendering:pixelated;image-rendering:crisp-edges}
#cv{display:block;position:absolute;inset:0;width:800px;height:600px}

/* ---------- touch pad, shown only on touch devices while playing ---------- */
#touch{position:absolute;inset:0;z-index:6;display:none}
#touch.on{display:block}
#stick{position:absolute;width:calc(var(--u)*40);height:calc(var(--u)*40);
  border:var(--u) solid rgba(244,244,236,.3);background:rgba(13,11,18,.45);opacity:0}
#knob{position:absolute;width:calc(var(--u)*16);height:calc(var(--u)*16);
  background:rgba(244,244,236,.35);border:var(--u) solid rgba(244,244,236,.6);
  left:calc(var(--u)*12);top:calc(var(--u)*12)}
.tbtn{position:absolute;pointer-events:auto;font-family:monospace;letter-spacing:1px;
  color:#f4f4ec;background:rgba(13,11,18,.6);border:var(--u) solid rgba(244,244,236,.45);
  font-size:calc(var(--u)*5);display:grid;place-items:center}
#tAtk{right:calc(var(--u)*6);bottom:calc(var(--u)*46);width:calc(var(--u)*30);height:calc(var(--u)*30)}
