/* v2.6 Macro Pad — fit the ENTIRE game panel to the 25 keys + controls.
   Record values, reset settings, theme and sound controls are unchanged. */
/* The previous version reduced only the inner viewport, leaving a 920px-wide
   outer game panel. Keep the sidebar internals untouched and shrink the ENTIRE
   game panel to a key-sized macro pad instead. */
.dashboard {
  grid-template-columns: 532px 300px;
  justify-content: center;
  column-gap: 18px;
}
.screen-panel { width: 532px; max-width: 532px; }
.screen-panel .screen-frame {
  width: 492px;
  max-width: 100%;
  margin: 0 auto;
  border-width: 8px;
  border-radius: 17px;
}
/* No dead air below the pad: 25 keys at top + a compact utility strip. */
.screen-panel .screen-viewport { height: 492px; }
.scene-macro {
  padding: 7px 8px 7px;
  background: linear-gradient(160deg,#363f48 0%,#29333b 62%,#232d35 100%);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}
.macro-body {
  width: 100%;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: none;
  min-height: 0;
}
.scene-macro .macro-board-shell,
.scene-macro .board-shell:has(>.board.keycap-board) {
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  border: 4px solid #6c7782;
  border-radius: 10px;
  padding: 2px;
  background: linear-gradient(155deg,#bec7cf,#a6b0b9);
  box-shadow: inset 0 2px 3px #fff7,0 4px 11px #0a111882,0 0 0 1px #c3ced755;
  overflow: hidden;
}
.scene-macro .board.keycap-board { width: 100%; aspect-ratio: 1 / 0.9266667; }
.macro-actions {
  min-height: 45px;
  height: 45px;
  display: grid;
  grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 0;
  padding: 2px 8px 0;
  border-top: 1px solid #dce5ea23;
}
.macro-action-group {
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
}
.macro-action{
  width:58px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid #8a959e;
  border-bottom:4px solid #11171d;
  border-radius:9px;
  color:#e88b42;
  background:linear-gradient(150deg,#596671,#414e59);
  box-shadow:inset 0 1px 0 #ffffff26,0 4px 8px #08101660;
  cursor:pointer;
  touch-action:manipulation;
}
.macro-action:hover{background:linear-gradient(150deg,#6b7984,#4c5b66)}
.macro-action:active{transform:translateY(2px);border-bottom-width:2px;box-shadow:inset 0 2px 3px #101b2455}
.macro-action .ui-icon{width:22px;height:22px}
.macro-action:focus-visible{outline:2px solid #f8af73;outline-offset:4px}
.macro-active-indicator{display:flex;align-items:center;gap:8px}
.macro-active-indicator span{display:block;width:5px;height:5px;border-radius:50%;background:#a77a50;box-shadow:0 0 0 1px #c0a18a44}
/* When a stack hits 6, flash only the red lights of all 25 keys.
   This animation is visual only; reset happens in main.js. */
.scene-macro .board.failure-blink .key.failure-on .level-fill{
  width:100%!important;
  opacity:1;
  transition:none;
  animation:macroFailureLight 280ms steps(1,end) 5 forwards;
  box-shadow:0 0 7px #ffedf0,0 0 18px #ff6474,0 0 28px #ff3d58;
}
.scene-macro .board.failure-blink .key.failure-on .level-track::after{
  width:100%!important;
  opacity:.72;
  animation:macroFailureGlow 280ms steps(1,end) 5 forwards;
}
@keyframes macroFailureLight {0%,49%{opacity:1}50%,100%{opacity:0}}
@keyframes macroFailureGlow {0%,49%{opacity:.72}50%,100%{opacity:0}}
@media (prefers-reduced-motion: reduce){
  .scene-macro .board.failure-blink .key.failure-on .level-fill,
  .scene-macro .board.failure-blink .key.failure-on .level-track::after{animation:none}
}
