.mbtn {
  padding: 12px 0;
  width: 220px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  transition: all 0.25s cubic-bezier(0.34,1.56,0.64,1);
  position: relative;
  overflow: hidden;
  will-change: transform;
}
.mbtn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
}
.mbtn:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 3px 10px rgba(0,0,0,0.25);
  transition: all 0.1s cubic-bezier(0.22,1,0.36,1);
}
.mbtn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255,255,255,0.12) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.4s ease-out;
  border-radius: inherit;
  pointer-events: none;
}
.mbtn:active::after {
  opacity: 1;
  transition: opacity 0.08s ease-in;
}
.mbtn-primary {
  background: #2563eb;
  color: #fff;
}
.mbtn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 8px 28px rgba(37,99,235,0.5);
}
.mbtn-secondary {
  background: #0d0d0d;
  color: #888;
  border: 1px solid #1a1a1a;
}
.mbtn-secondary:hover {
  background: #151515;
  color: #bbb;
  border-color: #2a2a2a;
}
.mbtn-exit {
  background: #151515;
  color: #f87171;
  border: 1px solid #2a1515;
}
.mbtn-exit:hover {
  background: #1a1010;
}
.mbtn-admin {
  background: linear-gradient(135deg, #2d1b69, #1a0d40);
  color: #c4b5fd;
  border: 1px solid #7c3aed44;
  box-shadow: 0 0 16px rgba(124,58,237,0.15);
}
.mbtn-admin:hover {
  background: linear-gradient(135deg, #3b2380, #2a1560);
  border-color: #7c3aed88;
  box-shadow: 0 0 24px rgba(124,58,237,0.3);
}
.op-column {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 76px;
  flex-shrink: 0;
}
.op-btn {
  flex: 1;
  font-size: 32px;
  font-weight: 700;
  background: #0d0d0d;
  color: #333;
  border: 1px solid #1a1a1a;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  align-items: center;
  justify-content: center;
  will-change: transform;
}
.op-btn:hover {
  background: #181818;
  color: #666;
  transform: scale(1.05);
}
.op-btn:active {
  transform: scale(0.92);
  transition: transform 0.08s;
  animation: opBtnPress 0.12s ease both;
}
.op-btn.active {
  background: #172554;
  color: #93c5fd;
  border-color: #1e40af;
  box-shadow: 0 0 16px rgba(37,99,235,0.22);
}
.op-btn.swapped {
  background: #2e1065;
  color: #c4b5fd;
  border-color: #7c3aed;
  animation: swapGlow 0.8s ease-in-out infinite alternate;
}
.op-btn.swapped.active {
  background: #3b0f8a;
  color: #e9d5ff;
  border-color: #9333ea;
}
.digit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.grid-cell {
  display: flex;
  align-items: stretch;
  justify-content: stretch;
}
.digit-btn {
  flex: 1;
  font-size: 32px;
  font-weight: 700;
  background: #1a1a1a;
  color: #ddd;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.34,1.56,0.64,1);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  will-change: transform;
}
.digit-btn:hover:not(.on-cd) {
  background: #272727;
  border-color: #444;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.digit-btn.pressed {
  transform: scale(0.9);
  background: #323232;
  transition: transform 0.06s cubic-bezier(0.22,1,0.36,1), background 0.06s;
}
.digit-btn.on-cd {
  cursor: not-allowed;
  background: #0d0000;
  border-color: #1a0505;
  color: #ef4444;
  font-size: 22px;
  font-weight: 900;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
}
