/* Shared game-page styles: stage, overlays, right-click menu, paused overlay */
.game-shell { margin: 10px 0 6px; }
.game-stage {
  position: relative;
  width: 100%;
  max-width: 860px;
  margin: 0 auto;
  background: #070a10;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.game-stage canvas {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  display: block;
  touch-action: none;
}
/* Default aspect (games can override with an inline style or their own css) */
.game-stage.ar-5x3 { aspect-ratio: 800 / 480; }
.game-stage.ar-square { aspect-ratio: 1 / 1; }
.game-stage.ar-portrait { aspect-ratio: 10 / 12; }
.game-stage.ar-4x3 { aspect-ratio: 4 / 3; }

/* Overlay screens (menu / game over / waiting) */
.screen {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center;
  background: rgba(7, 10, 16, .82);
  backdrop-filter: blur(3px);
  padding: 20px; text-align: center;
}
.screen[hidden] { display: none; }
.screen-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 26px 30px; max-width: 460px; width: 100%; box-shadow: var(--shadow);
}
.screen-emoji { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.screen-card h2 { margin: 6px 0 8px; font-size: 26px; }
.screen-sub { color: var(--muted); margin: 0 0 18px; font-size: 15px; }
.screen-sub kbd, .bosshint kbd, .controls kbd {
  background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px;
  border-radius: 5px; padding: 1px 7px; font-family: ui-monospace, monospace; color: var(--text); font-size: 13px;
}
.screen-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.screen-note { color: var(--accent-2); font-size: 13px; margin: 14px 0 0; min-height: 16px; }
.screen-score { font-size: 40px; font-weight: 800; color: var(--accent); margin: 4px 0 6px; }

/* Footer under the stage */
.game-footer {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 860px; margin: 10px auto 0; gap: 12px; flex-wrap: wrap;
}
.game-footer .bosshint, .game-footer .hint { font-size: 13px; color: var(--muted); }

/* Right-click context menu */
.cg-ctxmenu {
  position: fixed; z-index: 2147483000; min-width: 168px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 34px rgba(0,0,0,.5); padding: 6px; display: none;
  font-family: var(--font); font-size: 14px;
}
.cg-ctxmenu.on { display: block; }
.cg-ctxmenu button {
  display: flex; width: 100%; align-items: center; gap: 10px;
  background: transparent; border: 0; color: var(--text);
  padding: 9px 12px; border-radius: 7px; cursor: pointer; text-align: left; font-size: 14px;
}
.cg-ctxmenu button:hover { background: rgba(56,225,255,.12); }
.cg-ctxmenu button[disabled] { opacity: .4; cursor: default; }
.cg-ctxmenu button:hover[disabled] { background: transparent; }
.cg-ctxmenu .cg-ctx-key { margin-left: auto; color: var(--muted); font-size: 12px; }
.cg-ctxmenu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 2px; }

/* Paused overlay */
.cg-paused {
  position: absolute; inset: 0; z-index: 6; display: none;
  place-items: center; text-align: center;
  background: rgba(7,10,16,.72); backdrop-filter: blur(2px);
}
.cg-paused.on { display: grid; }
.cg-paused .p-badge { font-size: 30px; font-weight: 800; letter-spacing: 2px; color: var(--accent); }
.cg-paused .p-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
