/* Skyblade - the browser game page's styles (web/game/game.html; web019 docs/WEB_MOBILE_UI_MAINTENANCE.md: the one place
   to restyle the page). Positions and sizes written by the page scripts (inline styles) are not set here. */
html, body { margin: 0; height: 100%; background: #000; color: #ccc; font: 13px/1.4 system-ui, sans-serif; }
body { display: flex; flex-direction: column; }
/* Nothing inside the stage can scroll the page (the inline editor is clamped inside it as well). */
#stage { flex: 1 1 auto; min-height: 0; position: relative; overflow: hidden; }
/* No border or padding: input positions are measured against the canvas's border box (game-input.js). */
#canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; border: 0; padding: 0;
  outline: none; touch-action: none; user-select: none; -webkit-user-select: none; }
/* Web011 (docs/WEB_GAME_MOBILE.md): the inline text editor, a real input placed by the page script over the game
   field that was tapped (left/top/width/height in CSS pixels). Its font is 16px and it is never transformed or
   scaled: a smaller focused input makes mobile browsers zoom the page. */
#field-editor { position: absolute; z-index: 2; box-sizing: border-box; margin: 0; padding: 0 6px;
  border: 1px solid #998; border-radius: 2px; background: #000; color: #fff; font: 16px/1.2 system-ui, sans-serif;
  outline: none; }
#field-editor[hidden] { display: none; }
#field-editor[aria-invalid="true"] { border-color: #f66; }
/* Task web010 (docs/WEB_JOYSTICK.md): the joystick, over the lower-left corner of the letterboxed game view. The HUD
   script (game-hud.js) sets left/bottom (the view's corner inside the canvas, plus a margin and the left/bottom
   safe-area insets) and the size; only the round base and the mode button take pointer input. Web011: it exists only
   where the PRIMARY pointer is coarse (a phone or tablet; a laptop with a touch screen keeps mouse and keyboard), and
   then only while the game world is interactive. The page script gates the input adapter by the same media query. */
#stick-pad { position: absolute; left: 12px; bottom: 12px; z-index: 1; display: none; flex-direction: column;
  align-items: center; gap: 6px; pointer-events: none; }
#stick { position: relative; width: 96px; height: 96px; box-sizing: border-box; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.12); pointer-events: auto;
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; cursor: pointer; }
#stick[data-held="true"] { background: rgba(255, 255, 255, 0.2); }
#stick-thumb { position: absolute; left: 28%; top: 28%; width: 44%; height: 44%; border-radius: 50%;
  background: rgba(255, 255, 255, 0.45); pointer-events: none; }
#stick-mode { pointer-events: auto; font: inherit; min-width: 48px; min-height: 40px; padding: 4px 10px;
  opacity: 0.75; }
/* Web012 (docs/WEB_ACTION_CLUSTER.md): the action cluster over the lower-right corner of the letterboxed game view.
   The HUD script sets the square's right/bottom/size and every button's box (from the button's data-hud-x/-y/-size);
   the square itself is transparent to input (only the round buttons take it). Same device gate as the joystick, and
   shown only while the game offers it. Warm stone faces with bronze rims; the selected target itself is highlighted by
   the game, not here. Web019: a button's look follows its data-hud-command, so a further button for an existing
   command looks and highlights like the first. */
#action-cluster { position: absolute; right: 12px; bottom: 12px; width: 170px; height: 170px; z-index: 1;
  display: none; pointer-events: none; }
.action { position: absolute; box-sizing: border-box; margin: 0; padding: 0; display: flex; align-items: center;
  justify-content: center; border-radius: 50%; border: 2px solid #7d6033; color: #e6d3a0;
  background: radial-gradient(circle at 50% 34%, rgba(74, 70, 62, 0.84), rgba(26, 24, 21, 0.88) 72%);
  box-shadow: inset 0 1px 1px rgba(255, 228, 160, 0.35), inset 0 -2px 4px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(18, 12, 4, 0.85), 0 2px 5px rgba(0, 0, 0, 0.5);
  pointer-events: auto; touch-action: none; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; cursor: pointer; outline: none;
  font: 600 13px/1 Georgia, "Times New Roman", serif; }
.action svg { width: 56%; height: 56%; pointer-events: none; }
/* Web019: the authored display: flex above would otherwise beat the browser's own [hidden] rule. */
.action[hidden] { display: none; }
/* Command faces. `#action-cluster` keeps them above the pressed look below (as the former per-id rules were). */
#action-cluster .action[data-hud-command="ATTACK"] { border: 3px solid #a8823c; color: #f0dfae;
  background: radial-gradient(circle at 50% 32%, rgba(86, 80, 68, 0.86), rgba(24, 22, 19, 0.9) 70%); }
#action-cluster .action[data-hud-command="NEXT_PLAYER"] { color: #bcd8c8; }
#action-cluster .action[data-hud-command="NEXT_MONSTER"] { color: #e8c49a; }
.action[data-pressed="true"] { border-color: #e2c271;
  background: radial-gradient(circle at 50% 40%, rgba(60, 74, 62, 0.9), rgba(20, 24, 20, 0.92) 72%);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(18, 12, 4, 0.85),
    0 0 8px rgba(150, 210, 170, 0.45); }
.action:focus-visible { box-shadow: 0 0 0 2px #cfe6d6, 0 2px 5px rgba(0, 0, 0, 0.5); }
/* The game's validated selection (never a guess of this page). */
#action-cluster[data-selection="monster"] .action[data-hud-command="NEXT_MONSTER"] { border-color: #e0b660;
  color: #ffe2b0; box-shadow: inset 0 1px 1px rgba(255, 228, 160, 0.4), 0 0 0 1px rgba(18, 12, 4, 0.85),
    0 0 7px rgba(232, 176, 96, 0.6); }
#action-cluster[data-selection="player"] .action[data-hud-command="NEXT_PLAYER"] { border-color: #9cc6ae;
  color: #e4f4ea; box-shadow: inset 0 1px 1px rgba(220, 255, 235, 0.35), 0 0 0 1px rgba(18, 12, 4, 0.85),
    0 0 7px rgba(140, 200, 170, 0.6); }
#action-cluster[data-attacking="true"] .action[data-hud-command="ATTACK"] { border-color: #e0b660;
  box-shadow: inset 0 1px 1px rgba(255, 228, 160, 0.45), 0 0 0 1px rgba(18, 12, 4, 0.85),
    0 0 9px rgba(232, 176, 96, 0.55); }
/* A player is selected: PK combat is not available yet, so the sword is shown subdued (the game answers a tap). */
#action-cluster[data-selection="player"] .action[data-hud-command="ATTACK"] { color: #8f8670; border-color: #6c5a3a; }
/* Future skills: disabled, dim, a dashed inner ring and a faint numeral; never pressed, never sending anything. */
.action-skill { border: 1px solid rgba(125, 96, 51, 0.6); color: rgba(214, 190, 138, 0.38);
  background: radial-gradient(circle at 50% 36%, rgba(48, 46, 42, 0.55), rgba(18, 17, 15, 0.6) 72%);
  box-shadow: inset 0 -1px 3px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4); cursor: default; }
.action-skill::after { content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 1px dashed rgba(170, 138, 84, 0.32); pointer-events: none; }
/* Web013 (docs/WEB_MOBILE_FULLSCREEN.md): the mobile fullscreen prompt, over the whole stage (never over Diagnostics)
   while the game world is shown on a coarse primary pointer outside fullscreen. It takes every tap on the stage, so
   nothing reaches the game through it. The page script shows and hides it; a desktop never shows it. */
#fullscreen-gate { position: absolute; inset: 0; z-index: 3; display: flex; align-items: center;
  justify-content: center; padding: 12px; box-sizing: border-box; background: rgba(0, 0, 0, 0.6);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
#fullscreen-gate[hidden] { display: none; }
#fullscreen-panel { max-width: 300px; padding: 14px 18px; text-align: center; border-radius: 6px;
  border: 2px solid #7d6033; color: #e6d3a0; background: rgba(26, 24, 21, 0.94);
  box-shadow: inset 0 1px 1px rgba(255, 228, 160, 0.25), 0 0 0 1px rgba(18, 12, 4, 0.85), 0 4px 12px rgba(0, 0, 0, 0.6);
  font: 14px/1.4 Georgia, "Times New Roman", serif; }
#fullscreen-title { font-size: 17px; font-weight: 600; color: #f0dfae; margin-bottom: 4px; }
#fullscreen-message { margin: 0 0 12px; }
#fullscreen-panel button { display: block; width: 100%; min-height: 40px; margin: 6px 0 0; padding: 6px 12px;
  border-radius: 4px; border: 2px solid #a8823c; color: #f0dfae; background: #3a3229; font: 600 15px/1.2 Georgia,
  "Times New Roman", serif; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#fullscreen-panel button:disabled { opacity: 0.55; }
#fullscreen-panel button[hidden] { display: none; }
#fullscreen-continue { border-color: #6c5a3a; color: #d6c08a; background: transparent; }
@media (pointer: coarse) {
  #stick-pad { display: flex; }
  #stick-pad[hidden] { display: none; }
  #action-cluster { display: block; }
  #action-cluster[hidden] { display: none; }
}
/* Web011: the one element below the game. Collapsed it is a single line; opened it never takes more than part of
   the page (it scrolls inside). The page script opens it when the game fails or stops. */
#diagnostics { flex: 0 0 auto; max-height: 45%; overflow-y: auto; padding: 2px 8px; background: #111;
  border-top: 1px solid #333; }
#diagnostics summary { cursor: pointer; color: #888; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
#diagnostics[data-state="failed"] summary { color: #f66; }
.line { white-space: pre-wrap; overflow-wrap: anywhere; }
.single { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#status-error { color: #f66; }
#notices { color: #888; }
/* Developer telemetry: one scrollable line. */
#status-detail { color: #8a8; font-family: ui-monospace, monospace; font-size: 11px; white-space: pre;
  overflow-x: auto; }
